Codebase list ros-bloom / ffaa09a
New upstream version 0.10.7 Timo Röhling 2 years ago
19 changed file(s) with 418 addition(s) and 114 deletion(s). Raw diff Collapse all Expand all
0 name: bloom-ci
1
2 on:
3 push:
4 branches: ['master']
5 pull_request:
6 branches: ['*']
7
8 jobs:
9 build:
10 strategy:
11 matrix:
12 os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-latest]
13 python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
14 exclude:
15 - os: ubuntu-16.04
16 python: 3.6
17 - os: ubuntu-16.04
18 python: 3.7
19 - os: ubuntu-16.04
20 python: 3.8
21 - os: ubuntu-16.04
22 python: 3.9
23 - os: ubuntu-18.04
24 python: 3.5
25 - os: ubuntu-20.04
26 python: 2.7
27 - os: ubuntu-20.04
28 python: 3.5
29 - os: ubuntu-20.04
30 python: 3.6
31 - os: ubuntu-20.04
32 python: 3.7
33 - os: macos-latest
34 python: 3.5
35 - os: macos-latest
36 python: 3.6
37 name: bloom tests
38 runs-on: ${{matrix.os}}
39
40 steps:
41 - uses: actions/checkout@v2
42 - name: Set up Python ${{matrix.python}}
43 uses: actions/setup-python@v1
44 with:
45 python-version: ${{matrix.python}}
46 - name: Install dependencies
47 run: |
48 python -m pip install --upgrade pip setuptools
49 python -m pip install PyYAML argparse empy rosdep vcstools catkin-pkg python-dateutil
50 python -m pip install nose coverage pep8
51 - name: Run tests
52 run: |
53 BLOOM_VERBOSE=1 python setup.py nosetests -s --tests test
00 language: python
11 python:
2 - "2.7"
32 - "3.4" # When support for 3.4 is removed unpin the PyYAML version below.
4 - "3.6"
5 - "3.7"
6 - "3.8"
73 # command to install dependencies
84 install:
95 - if [ $TRAVIS_PYTHON_VERSION == "3.4" ]; then pip install PyYAML==5.2; fi # Forcing PyYAML 5.2 while we retain Python 3.4 support PyYAML 5.3 and higher does not support python 3.4
10 - pip install PyYAML argparse rosdep vcstools catkin-pkg python-dateutil setuptools
6 - pip install PyYAML argparse empy rosdep vcstools catkin-pkg python-dateutil setuptools
117 - pip install nose coverage pep8
12 - git clone https://github.com/dirk-thomas/empy.git /tmp/empy
13 - cd /tmp/empy
14 - python setup.py install
15 - cd -
16 - sudo `which rosdep` init
17 - rosdep update
188 # command to run tests
199 script:
2010 - BLOOM_VERBOSE=1 python setup.py nosetests -s --tests test
0 0.10.7 (2021-04-16 11:30:00 -0700)
1 ----------------------------------
2 - Fix basic authentication issue affecting new GitHub tokens. `#633 <https://github.com/ros-infrastructure/bloom/issues/633>`_
3
4 0.10.6 (2021-04-07 11:30:00 -0700)
5 ---------------------------------
6 - Fix a packaging bug affecting only Debian packages.
7
8 0.10.5 (2021-04-07 10:30:00 -0700)
9 ---------------------------------
10 - Fix a packaging bug affecting only Debian packages.
11
12 0.10.4 (2021-04-07 10:00:00 -0700)
13 ----------------------------------
14 - Use basic authentication with the new personal access tokens. `#627 <https://github.com/ros-infrastructure/bloom/issues/627>`_
15 - Add a fast check for the likely fork name. `#629 <https://github.com/ros-infrastructure/bloom/issues/629>`_
16 - Specify patch level in RPM templates. `#626 <https://github.com/ros-infrastructure/bloom/issues/626>`_
17 - Collect manually created token rather than attempting to create one. `#628 <https://github.com/ros-infrastructure/bloom/issues/628>`_
18
19 0.10.3 (2021-03-25 11:08:00 -0700)
20 ----------------------------------
21 - Rewire the typesupport dependencies for post-Foxy. `#625 <https://github.com/ros-infrastructure/bloom/issues/625>`_
22
23 0.10.2 (2021-03-11 17:05:00 -0800)
24 ----------------------------------
25 - Drop Connext from typesupport dependencies for RPMs `#623 <https://github.com/ros-infrastructure/bloom/issues/623>`_
26 - Enable output from CTest failures in RPMs `#620 <https://github.com/ros-infrastructure/bloom/issues/620>`_
27 - Only suggest resetting action list if it's old `#622 <https://github.com/ros-infrastructure/bloom/issues/622>`_
28
29 0.10.1 (2021-02-04 15:00:00 -0800)
30 ----------------------------------
31 - Do not verify package version on ignored packages `#610 <https://github.com/ros-infrastructure/bloom/pull/610>`_
32 - Update email addresses and remove 404 download url `#607 <https://github.com/ros-infrastructure/bloom/pull/607>`_
33 - Align CMake args in RPMs with debs `#617 <https://github.com/ros-infrastructure/bloom/pull/617>`_
34 - Add a template substitution for the ROS distro `#612 <https://github.com/ros-infrastructure/bloom/pull/612>`_
35 - Create and use a 'fake' rosdep cache for tests `#614 <https://github.com/ros-infrastructure/bloom/pull/614>`_
36 - Add --debian-inc option to bloom-generate `#428 <https://github.com/ros-infrastructure/bloom/pull/428>`_
37 - Solve shlibdeps errors in REP136 packages that use GNUInstallDirs. `#600 <https://github.com/ros-infrastructure/bloom/pull/600>`_
38 - Don't prompt if --override-release-repository-url `#594 <https://github.com/ros-infrastructure/bloom/pull/594>`_
39
040 0.10.0 (2020-09-28 16:30:00 -0700)
141 ----------------------------------
242 - Add CMAKE_PREFIX_PATH to ament_cmake and cmake templates `#606 <https://github.com/ros-infrastructure/bloom/pull/606>`_
4080
4181 0.9.2 (2020-03-02 13:00:00 -0800)
4282 ---------------------------------
43 - Add option to disable weak RPM dependencies. `#574 <https://github.com/cottsay/bloom/issues/574>`_
44 - If not interactive, don't prompt to fix broken rosdep keys. `#573 <https://github.com/cottsay/bloom/issues/573>`_
45 - Make the RPM spec templates look more like the results. `#568 <https://github.com/cottsay/bloom/issues/568>`_
46 - Suppress automatic rosdep with BLOOM_SKIP_ROSDEP_UPDATE. `#565 <https://github.com/cottsay/bloom/issues/565>`_
47 - Provide group membership information in RPM packages. `#564 <https://github.com/cottsay/bloom/issues/564>`_
48 - Add an optional release version suffix to RPM templates. `#569 <https://github.com/cottsay/bloom/issues/569>`_
49 - Drop Connext from RPM RMW list. `#566 <https://github.com/cottsay/bloom/issues/566>`_
50 - Provide -devel, -doc and -runtime virtual packages in RPM. `#563 <https://github.com/cottsay/bloom/issues/563>`_
51 - Print the OS name along with OS version for RPMs. `#562 <https://github.com/cottsay/bloom/issues/562>`_
83 - Add option to disable weak RPM dependencies. `#574 <https://github.com/ros-infrastructure/bloom/issues/574>`_
84 - If not interactive, don't prompt to fix broken rosdep keys. `#573 <https://github.com/ros-infrastructure/bloom/issues/573>`_
85 - Make the RPM spec templates look more like the results. `#568 <https://github.com/ros-infrastructure/bloom/issues/568>`_
86 - Suppress automatic rosdep with BLOOM_SKIP_ROSDEP_UPDATE. `#565 <https://github.com/ros-infrastructure/bloom/issues/565>`_
87 - Provide group membership information in RPM packages. `#564 <https://github.com/ros-infrastructure/bloom/issues/564>`_
88 - Add an optional release version suffix to RPM templates. `#569 <https://github.com/ros-infrastructure/bloom/issues/569>`_
89 - Drop Connext from RPM RMW list. `#566 <https://github.com/ros-infrastructure/bloom/issues/566>`_
90 - Provide -devel, -doc and -runtime virtual packages in RPM. `#563 <https://github.com/ros-infrastructure/bloom/issues/563>`_
91 - Print the OS name along with OS version for RPMs. `#562 <https://github.com/ros-infrastructure/bloom/issues/562>`_
5292
5393 0.9.1 (2020-02-03 10:00:00 -0800)
5494 ---------------------------------
3737 import subprocess
3838 import sys
3939
40 from bloom.config import ACTION_LIST_HISTORY
4041 from bloom.config import BLOOM_CONFIG_BRANCH
4142 from bloom.config import config_template
4243 from bloom.config import DEFAULT_TEMPLATE
215216 warning("Your track's '{0}' configuration is not the same as the default."
216217 .format(key))
217218 default = 'n'
218 if key == 'actions':
219 if key == 'actions' and track_dict[key] in ACTION_LIST_HISTORY:
219220 default = 'y'
220221 warning("Unless you have manually modified your 'actions' "
221222 "(the commands which get run for a release), "
275275
276276 def get_release_repo(repository, distro, override_url):
277277 global _repositories
278 url = get_repo_uri(repository, distro)
278
279 if override_url is not None:
280 warning("Overriding the release repository url, using '{0}'".format(override_url))
281 url = override_url
282 else:
283 url = get_repo_uri(repository, distro)
284
279285 if repository not in _repositories.values():
280286 temp_dir = tempfile.mkdtemp()
281287 _repositories[repository] = get_vcs_client('git', temp_dir)
282 if override_url is not None:
283 warning("Overriding the release repository url, using '{0}'".format(override_url))
284 url = override_url
285288 info(fmt("@{gf}@!==> @|") +
286289 "Fetching '{0}' repository from '{1}'".format(repository, url))
287290 _repositories[repository].checkout(url, 'master')
675678 # Check if a fork already exists on the user's account
676679
677680 try:
678 repo_forks = gh.list_forks(base_info['org'], base_info['repo'])
679 user_forks = [r for r in repo_forks if r.get('owner', {}).get('login', '') == gh.username]
680 # github allows only 1 fork per org as far as I know. We just take the first one.
681 head_repo = user_forks[0] if user_forks else None
681 # There are a lot of forks of the ros/rosdistro repository so
682 # listing those forks takes a very long time.
683 # Let's try a little shortcut by checking if the repository of
684 # the same name owned by the current GitHub user, if that
685 # repository exists and is in the same fork network as the
686 # target repo let's take it.
687 # If it is not, we still fall back to listing forks.
688 target_repo = gh.get_repo(base_info['org'], base_info['repo'])
689 target_repo_source = target_repo['full_name']
690 if target_repo['fork']:
691 target_repo_source = target_repo['source']['full_name']
692 try:
693 user_repo = gh.get_repo(gh.username, base_info['repo'])
694 if user_repo['fork'] and user_repo['source']['full_name'] == target_repo_source:
695 head_repo = user_repo
696 except GithubException as exc:
697 debug("Received GithubException while checking for fork: {exc}".format(**locals()))
698 # 404 on finding an exact match repo.
699 # Proceed listing all forks.
700 pass
701 if head_repo is None:
702 repo_forks = gh.list_forks(base_info['org'], base_info['repo'])
703 user_forks = [r for r in repo_forks if r.get('owner', {}).get('login', '') == gh.username]
704 # github allows only 1 fork per org as far as I know. We just take the first one.
705 head_repo = user_forks[0] if user_forks else None
682706
683707 except GithubException as exc:
684708 debug("Received GithubException while checking for fork: {exc}".format(**locals()))
177177 msg += fmt(" @!['@{yf}" + sanitize(self.default) + "@|@!']@|: ")
178178 return msg
179179
180 ACTION_LIST_HISTORY = [
181 [
182 'bloom-export-upstream :{vcs_local_uri} :{vcs_type}'
183 ' --tag :{release_tag} --display-uri :{vcs_uri}'
184 ' --name :{name} --output-dir :{archive_dir_path}',
185 'git-bloom-import-upstream :{archive_path} :{patches}'
186 ' --release-version :{version} --replace',
187 'git-bloom-generate -y rosrelease :{ros_distro}'
188 ' --source upstream -i :{release_inc}',
189 'git-bloom-generate -y rosdebian --prefix release/:{ros_distro}'
190 ' :{ros_distro} -i :{release_inc}'
191 ],
192 [
193 'bloom-export-upstream :{vcs_local_uri} :{vcs_type}'
194 ' --tag :{release_tag} --display-uri :{vcs_uri}'
195 ' --name :{name} --output-dir :{archive_dir_path}',
196 'git-bloom-import-upstream :{archive_path} :{patches}'
197 ' --release-version :{version} --replace',
198 'git-bloom-generate -y rosrelease :{ros_distro}'
199 ' --source upstream -i :{release_inc}',
200 'git-bloom-generate -y rosdebian --prefix release/:{ros_distro}'
201 ' :{ros_distro} -i :{release_inc}',
202 'git-bloom-generate -y rosrpm --prefix release/:{ros_distro}'
203 ' :{ros_distro} -i :{release_inc}'
204 ],
205 [
206 'bloom-export-upstream :{vcs_local_uri} :{vcs_type}'
207 ' --tag :{release_tag} --display-uri :{vcs_uri}'
208 ' --name :{name} --output-dir :{archive_dir_path}',
209 'git-bloom-import-upstream :{archive_path} :{patches}'
210 ' --release-version :{version} --replace',
211 'git-bloom-generate -y rosrelease :{ros_distro}'
212 ' --source upstream -i :{release_inc}',
213 'git-bloom-generate -y rosdebian --prefix release/:{ros_distro}'
214 ' :{ros_distro} -i :{release_inc} --os-name ubuntu',
215 'git-bloom-generate -y rosdebian --prefix release/:{ros_distro}'
216 ' :{ros_distro} -i :{release_inc} --os-name debian --os-not-required',
217 'git-bloom-generate -y rosrpm --prefix release/:{ros_distro}'
218 ' :{ros_distro} -i :{release_inc}'
219 ],
220 [
221 'bloom-export-upstream :{vcs_local_uri} :{vcs_type}'
222 ' --tag :{release_tag} --display-uri :{vcs_uri}'
223 ' --name :{name} --output-dir :{archive_dir_path}',
224 'git-bloom-import-upstream :{archive_path} :{patches}'
225 ' --release-version :{version} --replace',
226 'git-bloom-generate -y rosrelease :{ros_distro}'
227 ' --source upstream -i :{release_inc}',
228 'git-bloom-generate -y rosdebian --prefix release/:{ros_distro}'
229 ' :{ros_distro} -i :{release_inc} --os-name ubuntu',
230 'git-bloom-generate -y rosdebian --prefix release/:{ros_distro}'
231 ' :{ros_distro} -i :{release_inc} --os-name debian --os-not-required',
232 'git-bloom-generate -y rosrpm --prefix release/:{ros_distro}'
233 ' :{ros_distro} -i :{release_inc} --os-name fedora',
234 'git-bloom-generate -y rosrpm --prefix release/:{ros_distro}'
235 ' :{ros_distro} -i :{release_inc} --os-name rhel',
236 ]
237 ]
238
180239 DEFAULT_TEMPLATE = {
181240 'name': PromptEntry('Repository Name', spec=config_spec['name'], default='upstream'),
182241 'vcs_uri': PromptEntry('Upstream Repository URI', spec=config_spec['vcs_uri']),
190249 'ros_distro': PromptEntry('ROS Distro', default='indigo', spec=config_spec['ros_distro']),
191250 'release_repo_url': PromptEntry('Release Repository Push URL', spec=config_spec['release_repo_url']),
192251 'release_inc': 0,
193 'actions': [
194 'bloom-export-upstream :{vcs_local_uri} :{vcs_type}'
195 ' --tag :{release_tag} --display-uri :{vcs_uri}'
196 ' --name :{name} --output-dir :{archive_dir_path}',
197 'git-bloom-import-upstream :{archive_path} :{patches}'
198 ' --release-version :{version} --replace',
199 'git-bloom-generate -y rosrelease :{ros_distro}'
200 ' --source upstream -i :{release_inc}',
201 'git-bloom-generate -y rosdebian --prefix release/:{ros_distro}'
202 ' :{ros_distro} -i :{release_inc} --os-name ubuntu',
203 'git-bloom-generate -y rosdebian --prefix release/:{ros_distro}'
204 ' :{ros_distro} -i :{release_inc} --os-name debian --os-not-required',
205 'git-bloom-generate -y rosrpm --prefix release/:{ros_distro}'
206 ' :{ros_distro} -i :{release_inc} --os-name fedora',
207 'git-bloom-generate -y rosrpm --prefix release/:{ros_distro}'
208 ' :{ros_distro} -i :{release_inc} --os-name rhel',
209 ]
252 'actions': ACTION_LIST_HISTORY[-1]
210253 }
211254
212255 CUSTOM_TEMPLATE = {
7474 add('--os-name', help='OS name, e.g. ubuntu, debian')
7575 add('--os-version', help='OS version or codename, e.g. precise, wheezy')
7676 add('--ros-distro', help="ROS distro, e.g. %s (used for rosdep)" % get_distro_list_prompt())
77 add('-i', '--debian-inc', help="debian increment number", default='0')
7778 add('--native', action='store_true', help="generate native package")
7879 return parser
7980
8081
81 def get_subs(pkg, os_name, os_version, ros_distro, native=False):
82 def get_subs(pkg, os_name, os_version, ros_distro, deb_inc=0, native=False):
8283 return generate_substitutions_from_package(
8384 pkg,
8485 os_name,
8586 os_version,
8687 ros_distro,
88 deb_inc=deb_inc,
8789 native=native
8890 )
8991
122124 for path, pkg in pkgs_dict.items():
123125 template_files = None
124126 try:
125 subs = get_subs_fn(pkg, os_name, os_version, ros_distro, args.native)
127 subs = get_subs_fn(pkg, os_name, os_version, ros_distro, args.debian_inc, args.native)
126128 if _place_template_files:
127129 # Place template files
128130 place_template_files(path, pkg.get_build_type())
1616 # Explicitly enable -DNDEBUG, see:
1717 # https://github.com/ros-infrastructure/bloom/issues/327
1818 export DEB_CXXFLAGS_MAINT_APPEND=-DNDEBUG
19
20 # Solve shlibdeps errors in REP136 packages that use GNUInstallDirs:
21 export DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
1922
2023 %:
2124 dh $@@ -v --buildsystem=cmake
4952 # in the install tree and source it. It will set things like
5053 # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
5154 if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \
52 dh_shlibdeps -l$(CURDIR)/debian/@(Package)/@(InstallationPrefix)/lib/
55 dh_shlibdeps -l$(CURDIR)/debian/@(Package)/@(InstallationPrefix)/lib/:$(CURDIR)/debian/@(Package)/@(InstallationPrefix)/lib/${DEB_HOST_MULTIARCH}
5356
5457 override_dh_auto_install:
5558 # In case we're installing to a non-standard location, look for a setup.sh
7070 info("Releasing for rosdistro: " + self.rosdistro)
7171 return ret
7272
73 def get_subs(self, package, debian_distro, releaser_history, native=False):
73 def get_subs(self, package, debian_distro, releaser_history, deb_inc=0, native=False):
7474 def fallback_resolver(key, peer_packages, rosdistro=self.rosdistro):
7575 if key in peer_packages:
7676 return [sanitize_package_name(rosify_package_name(key, rosdistro))]
8686 releaser_history=releaser_history,
8787 fallback_resolver=fallback_resolver
8888 )
89 subs['Rosdistro'] = self.rosdistro
8990 subs['Package'] = rosify_package_name(subs['Package'], self.rosdistro)
9091
9192 # ROS 2 specific bloom extensions.
106107 self.rosdistro not in ('r2b2', 'r2b3', 'ardent') and \
107108 'rosidl_interface_packages' in [p.name for p in package.member_of_groups]:
108109 ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES = [
109 'rosidl-typesupport-connext-c',
110 'rosidl-typesupport-connext-cpp',
111110 'rosidl-typesupport-fastrtps-c',
112111 'rosidl-typesupport-fastrtps-cpp',
113112 ]
113
114 # Connext was changed to a new rmw that doesn't require typesupport after Foxy
115 if self.rosdistro in ('bouncy', 'crystal', 'dashing', 'eloquent', 'foxy'):
116 ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES.extend([
117 'rosidl-typesupport-connext-c',
118 'rosidl-typesupport-connext-cpp',
119 ])
120
114121 # OpenSplice was dropped after Eloquent.
115122 # rmw implementations are required as dependencies up to Eloquent.
116 if self.rosdistro in ['bouncy', 'crystal', 'dashing', 'eloquent']:
123 if self.rosdistro in ('bouncy', 'crystal', 'dashing', 'eloquent'):
117124 ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES.extend([
118125 'rmw-connext-cpp',
119126 'rmw-fastrtps-cpp',
145152 return 'ros-{0}-{1}'.format(rosdistro, name)
146153
147154
148 def get_subs(pkg, os_name, os_version, ros_distro, native):
155 def get_subs(pkg, os_name, os_version, ros_distro, deb_inc, native):
149156 # No fallback_resolver provided because peer packages not considered.
150157 subs = generate_substitutions_from_package(
151158 pkg,
153160 os_version,
154161 ros_distro,
155162 RosDebianGenerator.default_install_prefix + ros_distro,
163 deb_inc=deb_inc,
156164 native=native
157165 )
158166 subs['Package'] = rosify_package_name(subs['Package'], ros_distro)
8787 fallback_resolver=fallback_resolver,
8888 skip_keys=self.skip_keys
8989 )
90 subs['Rosdistro'] = self.rosdistro
9091 subs['Package'] = rosify_package_name(subs['Package'], self.rosdistro)
9192
9293 # Virtual packages
120121 self.rosdistro not in ('r2b2', 'r2b3', 'ardent') and \
121122 'rosidl_interface_packages' in [p.name for p in package.member_of_groups]:
122123 ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES = [
123 'rosidl-typesupport-connext-c',
124 'rosidl-typesupport-connext-cpp',
125124 'rosidl-typesupport-fastrtps-c',
126125 'rosidl-typesupport-fastrtps-cpp',
127126 ]
129128 # rmw implementations are required as dependencies up to Eloquent.
130129 if self.rosdistro in ['bouncy', 'crystal', 'dashing', 'eloquent']:
131130 ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES.extend([
132 'rmw-connext-cpp',
133131 'rmw-fastrtps-cpp',
134132 'rmw-implementation',
135133 'rmw-opensplice-cpp',
2727 @(Description)
2828
2929 %prep
30 %autosetup
30 %autosetup -p1
3131
3232 %build
3333 # In case we're installing to a non-standard location, look for a setup.sh
4141 -USYSCONF_INSTALL_DIR \
4242 -USHARE_INSTALL_PREFIX \
4343 -ULIB_SUFFIX \
44 -DCMAKE_INSTALL_LIBDIR="lib" \
4544 -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \
45 -DAMENT_PREFIX_PATH="@(InstallationPrefix)" \
4646 -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \
4747 -DSETUPTOOLS_DEB_LAYOUT=OFF \
4848 ..
6565 # in the install tree and source it. It will set things like
6666 # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
6767 if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi
68 %make_build -C obj-%{_target_platform} $TEST_TARGET || echo "RPM TESTS FAILED"
68 CTEST_OUTPUT_ON_FAILURE=1 \
69 %make_build -C obj-%{_target_platform} $TEST_TARGET || echo "RPM TESTS FAILED"
6970 else echo "RPM TESTS SKIPPED"; fi
7071 %endif
7172
2727 @(Description)
2828
2929 %prep
30 %autosetup
30 %autosetup -p1
3131
3232 %build
3333 # In case we're installing to a non-standard location, look for a setup.sh
2626 @(Description)
2727
2828 %prep
29 %autosetup
29 %autosetup -p1
3030
3131 %build
3232 # In case we're installing to a non-standard location, look for a setup.sh
4040 -USYSCONF_INSTALL_DIR \
4141 -USHARE_INSTALL_PREFIX \
4242 -ULIB_SUFFIX \
43 -DCMAKE_INSTALL_LIBDIR="lib" \
4443 -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \
4544 -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \
4645 -DSETUPTOOLS_DEB_LAYOUT=OFF \
2727 @(Description)
2828
2929 %prep
30 %autosetup
30 %autosetup -p1
3131
3232 %build
3333 # In case we're installing to a non-standard location, look for a setup.sh
4141 -USYSCONF_INSTALL_DIR \
4242 -USHARE_INSTALL_PREFIX \
4343 -ULIB_SUFFIX \
44 -DCMAKE_INSTALL_LIBDIR="lib" \
4544 -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \
4645 -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \
4746 -DSETUPTOOLS_DEB_LAYOUT=OFF \
6564 # in the install tree and source it. It will set things like
6665 # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
6766 if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi
68 %make_build -C obj-%{_target_platform} $TEST_TARGET || echo "RPM TESTS FAILED"
67 CTEST_OUTPUT_ON_FAILURE=1 \
68 %make_build -C obj-%{_target_platform} $TEST_TARGET || echo "RPM TESTS FAILED"
6969 else echo "RPM TESTS SKIPPED"; fi
7070 %endif
7171
7575 auth_str = '{0}:{1}'.format(user, password)
7676 if sys.version_info >= (3, 0):
7777 auth_str = auth_str.encode()
78 return "Basic {0}".format(base64.b64encode(auth_str))
78 b64_encoded = base64.b64encode(auth_str)
79 if sys.version_info >= (3, 0):
80 b64_encoded = b64_encoded.decode()
81 return "Basic {0}".format(b64_encoded)
82
83
84 def auth_header_from_token(username, token):
85 # Handle new GitHub personal access tokens
86 # which are used with basic authentication.
87 if token.startswith('ghp_'):
88 return auth_header_from_basic_auth(username, token)
89 else:
90 return auth_header_from_oauth_token(token)
7991
8092
8193 def auth_header_from_oauth_token(token):
152164 self.auth = auth
153165 self.token = token
154166
155 def create_new_bloom_authorization(self, note=None, note_url=None, scopes=None, update_auth=False):
156 payload = {
157 "scopes": ['public_repo'] if scopes is None else scopes,
158 "note": note or "bloom-{0} for {1} created on {2}".format(
159 bloom.__version__,
160 socket.gethostname(),
161 datetime.datetime.now().isoformat()),
162 "note_url": 'http://bloom.readthedocs.org/' if note_url is None else note_url
163 }
164 resp = do_github_post_req('/authorizations', payload, self.auth)
167 def check_token_validity(self, username, token, update_auth=False):
168 resp = do_github_get_req('/user', self.auth)
165169 resp_data = json_loads(resp)
166 resp_code = '{0}'.format(resp.getcode())
167 if resp_code not in ['201', '202'] or 'token' not in resp_data:
168 raise GithubException("Failed to create a new oauth authorization", resp)
169 token = resp_data['token']
170 if resp.getcode() != 200 or 'login' not in resp_data:
171 raise GithubException('Token authorization unsuccessful', resp)
170172 if update_auth:
171 self.auth = auth_header_from_oauth_token(token)
173 self.username = username
172174 self.token = token
173 return token
174175
175176 def get_repo(self, owner, repo):
176177 resp = do_github_get_req('/repos/{owner}/{repo}'.format(**locals()), auth=self.auth)
298299 token = config.get('oauth_token', None)
299300 username = config.get('github_user', None)
300301 if token and username:
301 return Github(username, auth=auth_header_from_oauth_token(token), token=token)
302 return Github(username, auth=auth_header_from_token(username, token), token=token)
302303 if not os.path.isdir(os.path.dirname(oauth_config_path)):
303304 os.makedirs(os.path.dirname(oauth_config_path))
304305 if quiet:
306307 # Ok, now we have to ask for the user name and pass word
307308 info("")
308309 warning("Looks like bloom doesn't have an oauth token for you yet.")
309 warning("Therefore bloom will require your GitHub username and password just this once.")
310 warning("With your GitHub username and password bloom will create an oauth token on your behalf.")
311 warning("The token will be stored in `~/.config/bloom`.")
312 warning("You can delete the token from that file to have a new token generated.")
313 warning("Guard this token like a password, because it allows someone/something to act on your behalf.")
314 warning("If you need to unauthorize it, remove it from the 'Applications' menu in your GitHub account page.")
310 warning("You can create a token by visiting https://github.com/settings/tokens in your browser.")
311 warning("For bloom to work the token must have at least `public_repo` scope.")
312 warning("If you want bloom to be able to automatically update your fork of ros/rosdistro (recommended)")
313 warning("then you must also enable the workflow scope for the token.")
314 warning("If you need to unauthorize it, remove it from the 'Tokens' menu in your GitHub account settings.")
315315 info("")
316 if not maybe_continue('y', "Would you like to create an OAuth token now"):
316 if not maybe_continue('y', 'Would you like to enter an access token now'):
317317 return None
318318 token = None
319319 while token is None:
320320 try:
321321 username = getpass.getuser()
322322 username = safe_input("GitHub username [{0}]: ".format(username)) or username
323 password = getpass.getpass("GitHub password (never stored): ")
323 token = getpass.getpass("GitHub access token: ").strip()
324324 except (KeyboardInterrupt, EOFError):
325325 return None
326 if not password:
327 error("No password was given, aborting.")
326 if not token:
327 error("No token was given, aborting.")
328328 return None
329 gh = Github(username, auth=auth_header_from_basic_auth(username, password))
329 gh = Github(username, auth=auth_header_from_token(username, token))
330330 try:
331 token = gh.create_new_bloom_authorization(update_auth=True)
331 gh.check_token_validity(username, token, update_auth=True)
332332 with open(oauth_config_path, 'w') as f:
333333 config.update({'oauth_token': token, 'github_user': username})
334334 f.write(json.dumps(config))
8787 else:
8888 log("found '" + list(packages.values())[0].name + "'.",
8989 use_prefix=False)
90 version = verify_equal_package_versions(packages.values())
9190 ignored_packages = get_ignored_packages(release_directory=release_directory)
9291 for k, v in dict(packages).items():
9392 # Check for packages with upper case names
105104 if packages == {}:
106105 error("All packages that were found were also ignored, aborting.",
107106 exit=True)
107 version = verify_equal_package_versions(packages.values())
108108 return [p.name for p in packages.values()], version, packages
109109 # Otherwise we have a problem
110110 log("failed.", use_prefix=False)
2121
2222 setup(
2323 name='bloom',
24 version='0.10.0',
24 version='0.10.7',
2525 packages=find_packages(exclude=['test', 'test.*']),
2626 package_data={
2727 'bloom.generators.debian': [
3535 include_package_data=True,
3636 install_requires=install_requires,
3737 author='Tully Foote, William Woodall',
38 author_email='tfoote@willowgarage.com, william@osrfoundation.org',
38 author_email='tfoote@openrobotics.org, william@openrobotics.org',
3939 maintainer='William Woodall',
40 maintainer_email='william@osrfoundation.org',
40 maintainer_email='william@openrobotics.org',
4141 url='http://www.ros.org/wiki/bloom',
42 download_url='http://pr.willowgarage.com/downloads/bloom/',
4342 keywords=['ROS'],
4443 classifiers=['Programming Language :: Python',
4544 'License :: OSI Approved :: BSD License'],
1818 from ..utils.common import bloom_answer
1919 from ..utils.common import change_directory
2020 from ..utils.common import in_temporary_directory
21 from ..utils.common import set_up_fake_rosdep
2122 from ..utils.common import user
2223 from ..utils.package_version import change_upstream_version
2324
8788 return os.getcwd()
8889
8990
90 def _test_unary_package_repository(release_dir, version, directory=None):
91 def _test_unary_package_repository(release_dir, version, directory=None, env=None):
9192 print("Testing in {0} at version {1}".format(release_dir, version))
9293 with change_directory(release_dir):
9394 # First run everything
9798 cmd = cmd.format(' --quiet')
9899 else:
99100 cmd = cmd.format('')
100 user(cmd, silent=False)
101 user(cmd, silent=False, env=env)
101102 ###
102103 ### Import upstream
103104 ###
183184 Release a single package catkin (melodic) repository.
184185 """
185186 directory = directory if directory is not None else os.getcwd()
187 # Initialize rosdep
188 rosdep_dir = os.path.join(directory, 'foo_rosdep')
189 env = dict(os.environ)
190 fake_distros = {'melodic': {'ubuntu': ['bionic']}}
191 fake_rosdeps = {
192 'catkin': {'ubuntu': []},
193 'roscpp_core': {'ubuntu': []}
194 }
195 env.update(set_up_fake_rosdep(rosdep_dir, fake_distros, fake_rosdeps))
186196 # Setup
187197 upstream_dir = create_upstream_repository(['foo'], directory)
188198 upstream_url = 'file://' + upstream_dir
197207 versions = ['0.1.0', '0.1.1', '0.2.0']
198208 import bloom.commands.git.release
199209 for index in range(len(versions)):
200 _test_unary_package_repository(release_dir, versions[index], directory)
210 _test_unary_package_repository(release_dir, versions[index], directory, env=env)
201211 bloom.commands.git.release.upstream_repos = {}
202212 if index != len(versions) - 1:
203213 change_upstream_version(upstream_dir, versions[index + 1])
209219 Release a multi package catkin (melodic) repository.
210220 """
211221 directory = directory if directory is not None else os.getcwd()
222 # Initialize rosdep
223 rosdep_dir = os.path.join(directory, 'foo_rosdep')
224 env = dict(os.environ)
225 fake_distros = {
226 'melodic': {
227 'debian': ['stretch'],
228 'ubuntu': ['bionic']
229 }
230 }
231 fake_rosdeps = {
232 'catkin': {'debian': [], 'ubuntu': []},
233 'roscpp_core': {'debian': [], 'ubuntu': []}
234 }
235 env.update(set_up_fake_rosdep(rosdep_dir, fake_distros, fake_rosdeps))
212236 # Setup
213237 pkgs = ['foo', 'bar_ros', 'baz']
214238 upstream_dir = create_upstream_repository(pkgs, directory, format_versions=[1, 2, 3])
229253 cmd = cmd.format(' --quiet')
230254 else:
231255 cmd = cmd.format('')
232 user(cmd, silent=False)
256 user(cmd, silent=False, env=env)
233257 ###
234258 ### Import upstream
235259 ###
285309 ### Release generator, again
286310 ###
287311 with bloom_answer(bloom_answer.ASSERT_NO_QUESTION):
288 ret = user('git-bloom-generate -y rosrelease melodic -s upstream')
312 ret = user('git-bloom-generate -y rosrelease melodic -s upstream', env=env)
289313 # patch import should have reported OK
290314 assert ret == code.OK, "actually returned ({0})".format(ret)
291315 # Check the environment after the release generator
370394 can handle it.
371395 """
372396 directory = directory if directory is not None else os.getcwd()
397 # Initialize rosdep
398 rosdep_dir = os.path.join(directory, 'foo_rosdep')
399 env = dict(os.environ)
400 fake_distros = {'melodic': {'ubuntu': ['bionic']}}
401 fake_rosdeps = {
402 'catkin': {'ubuntu': []},
403 'roscpp_core': {'ubuntu': []}
404 }
405 env.update(set_up_fake_rosdep(rosdep_dir, fake_distros, fake_rosdeps))
373406 # Setup
374407 upstream_dir = create_upstream_repository(['foo'], directory)
375408 upstream_url = 'file://' + upstream_dir
386419 user('git tag upstream/0.0.0@baz')
387420
388421 import bloom.commands.git.release
389 _test_unary_package_repository(release_dir, '0.1.0', directory)
422 _test_unary_package_repository(release_dir, '0.1.0', directory, env=env)
1919 from io import StringIO
2020
2121 from subprocess import Popen, PIPE, CalledProcessError
22 import yaml
2223
2324
2425 def assert_raises(exception_classes, callable_obj=None, *args, **kwargs):
123124 os.chdir(self.original_cwd)
124125
125126
127 class change_environ(object):
128 def __init__(self, env=None):
129 self.original_env = os.environ
130 self.new_env = dict(env) if env is not None else dict(os.environ)
131
132 def __enter__(self):
133 self.original_env = os.environ
134 os.environ = dict(self.new_env)
135
136 def __exit__(self, exc_type, exc_value, traceback):
137 os.environ = self.original_env
138
139
126140 def in_temporary_directory(f):
127141 @functools.wraps(f)
128142 def decorated(*args, **kwds):
168182
169183
170184 def user_bloom(cmd, args=None, directory=None, auto_assert=True,
171 return_io=True, silent=False):
185 return_io=True, silent=False, env=None):
172186 """Runs the given bloom cmd ('git-bloom-{cmd}') with the given args"""
173187 assert type(cmd) == str, \
174188 "user_bloom cmd takes str only, got " + str(type(cmd))
190204 with redirected_stdio() as (out, err):
191205 func = load_entry_point('bloom==' + ver, 'console_scripts', cmd)
192206 try:
193 ret = func(args) or 0
207 with change_environ(env):
208 ret = func(args) or 0
194209 except SystemExit as e:
195210 ret = e.code
196211 if ret != 0 and auto_assert:
211226 Used in place of user('cd <new_directory>')
212227 """
213228 if type(cmd) is str:
214 assert cmd is not '', "no arguments passed to cd, not allowed"
229 assert cmd != '', "no arguments passed to cd, not allowed"
215230 cmd = cmd.split()
216231 new_directory = cmd[0]
217232 assert os.path.exists(new_directory), \
246261 Used in system tests to emulte a user creating a directory
247262 """
248263 if type(cmd) is str:
249 assert cmd is not '', "no arguments passed to mkdir, not allowed"
264 assert cmd != '', "no arguments passed to mkdir, not allowed"
250265 cmd = cmd.split()
251266 if len(cmd) == 2:
252267 assert '-p' in cmd, "two args to mkdir, neither is '-p', not allowed"
283298
284299
285300 def user(cmd, directory=None, auto_assert=True, return_io=False,
286 bash_only=False, silent=True):
301 bash_only=False, silent=True, env=None):
287302 """Used in system tests to emulate a user action"""
288303 if type(cmd) in [list, tuple]:
289304 cmd = ' '.join(cmd)
297312 directory=directory,
298313 auto_assert=auto_assert,
299314 return_io=return_io,
300 silent=silent
315 silent=silent,
316 env=env
301317 )
302318 ret = -1
303319 try:
304 p = Popen(cmd, shell=True, cwd=directory, stdout=PIPE, stderr=PIPE)
320 p = Popen(cmd, shell=True, cwd=directory, env=env, stdout=PIPE, stderr=PIPE)
305321 out, err = p.communicate()
306322 if out is not None and not isinstance(out, str):
307323 out = out.decode('utf-8')
319335 if return_io:
320336 return ret, out, err
321337 return ret
338
339
340 def set_up_fake_rosdep(staging_dir, distros={}, rules={}):
341 """
342 Used to create a 'fake' rosdep cache from a locally generated index.
343
344 Example invocation:
345 .. code-block:: python
346
347 env = dict(os.environ)
348 env.update(set_up_fake_rosdep(
349 '/tmp/fake_rosdep',
350 {
351 'melodic': {
352 'ubuntu': ['bionic']
353 }
354 },
355 {
356 'some_rosdep_key': {
357 'ubuntu': ['some-package-name']
358 }
359 }))
360
361 :param staging_dir: Scratch directory in which to make infrastructure files.
362 :param distros: Mapping of ROS distributions to populate the index with.
363 :param rules: rosdep rules to populate the rosdep database with.
364
365 :returns: Environment variables which cause Bloom will use the fake cache.
366 """
367 # Construct bare environment
368 rosdistro_dir = os.path.join(staging_dir, 'rosdistro')
369 rosdistro_index_path = os.path.join(rosdistro_dir, 'index.yaml')
370 sources_list_dir = os.path.join(staging_dir, 'sources.list.d')
371 ros_home_dir = os.path.join(staging_dir, 'ros_home')
372 os.makedirs(rosdistro_dir)
373 os.makedirs(sources_list_dir)
374 os.makedirs(ros_home_dir)
375 env = {
376 'BLOOM_SKIP_ROSDEP_UPDATE': '1',
377 'ROSDEP_SOURCE_PATH': os.path.realpath(sources_list_dir),
378 'ROSDISTRO_INDEX_URL': 'file://' + os.path.realpath(rosdistro_index_path),
379 'ROS_HOME': os.path.realpath(ros_home_dir)
380 }
381
382 # Create the specified distributions
383 for distro, platforms in distros.items():
384 distro_dir = os.path.join(rosdistro_dir, distro)
385 distro_yaml_path = os.path.join(distro_dir, 'distribution.yaml')
386 os.makedirs(distro_dir)
387 distro_yaml_data = {
388 'release_platforms': platforms,
389 'repositories': dict({}),
390 'type': 'distribution',
391 'version': 2
392 }
393 with open(distro_yaml_path, 'w') as f:
394 f.write(yaml.dump(distro_yaml_data))
395
396 # Index the specified distributions
397 rosdistro_index_data = {
398 'distributions': {
399 distro: {
400 'distribution': [os.path.join(distro, 'distribution.yaml')],
401 'distribution_cache': 'DOES-NOT-EXIST',
402 'distribution_status': 'active',
403 'distribution_type': 'ros1',
404 'python_version': 2
405 } for distro in distros.keys()
406 },
407 'type': 'index',
408 'version': 4
409 }
410 with open(rosdistro_index_path, 'w') as f:
411 f.write(yaml.dump(rosdistro_index_data))
412
413 # Create the rosdep database
414 rosdep_db_dir = os.path.join(rosdistro_dir, 'rosdep')
415 os.makedirs(rosdep_db_dir)
416 rosdep_db_path = os.path.join(rosdep_db_dir, 'rosdep.yaml')
417 with open(rosdep_db_path, 'w') as f:
418 f.write(yaml.dump(rules))
419
420 # Create the rosdep sources list
421 rosdistro_source_path = os.path.join(sources_list_dir, '50-rosdep.list')
422 with open(rosdistro_source_path, 'w') as f:
423 f.write('yaml file://' + os.path.realpath(rosdep_db_path))
424
425 # Perform the initial rosdep update
426 setup_env = dict(os.environ)
427 setup_env.update(env)
428 user('rosdep update', env=setup_env)
429
430 return env