Commit e60bd58b authored by Jochen Sprickerhof's avatar Jochen Sprickerhof

Update upstream source from tag 'upstream/0.8.0'

Update to upstream version '0.8.0'
with Debian dir 5f7251797715657c5b97106c003522ae67075a0c
parents 7ff07685 4de751a1
......@@ -13,8 +13,6 @@ install:
- cd -
- sudo `which rosdep` init
- rosdep update
- git config --global user.email "test@example.com"
- git config --global user.name "Test User"
# command to run tests
script:
- BLOOM_VERBOSE=1 python setup.py nosetests -s --tests test
......
0.8.0 (2019-04-12 13:45:00 -0800)
---------------------------------
- Start release increment at 1. `#528 <https://github.com/ros-infrastructure/bloom/pull/528>`_
- Evaluate conditions in package.xml before resolving dependencies. `#519 <https://github.com/ros-infrastructure/bloom/pull/519>`_
- Update to prevent overwriting template files that exist in source. `#516 <https://github.com/ros-infrastructure/bloom/pull/516>`_
- Update debian templates to add trailing newline. `#523 <https://github.com/ros-infrastructure/bloom/pull/523>`_
- Fix str/bytes issue in Python 3 auth. `#522 <https://github.com/ros-infrastructure/bloom/pull/522>`_
- Use distribution type from index v4 to set ROS 2-specific behavior. `#502 <https://github.com/ros-infrastructure/bloom/pull/502>`_
- Fix tests to allow them to run outside of a git context. `#515 <https://github.com/ros-infrastructure/bloom/pull/515>`_
- Fix tests to allow empty git environment. `#514 <https://github.com/ros-infrastructure/bloom/pull/514>`_
- Invoke scripts using the current python executable. `#513 <https://github.com/ros-infrastructure/bloom/pull/513>`_
- Drop support for older distributions. (Retroactive to 0.6.8) `#512 <https://github.com/ros-infrastructure/bloom/pull/512>`_
0.7.2 (2019-01-26 07:45:00 -0800)
---------------------------------
- Updated a test to support mixed rosdistro index. `#510 <https://github.com/ros-infrastructure/bloom/pull/510>`_
......
......@@ -227,7 +227,7 @@ def process_track_settings(track_dict, release_inc_override):
settings['ros_distro'] = track_dict['ros_distro']
# Release increment
if 'last_version' in track_dict and track_dict['last_version'] != version:
next_release_inc = str(0)
next_release_inc = str(1)
else:
next_release_inc = str(int(track_dict['release_inc']) + 1)
settings['release_inc'] = release_inc_override or next_release_inc
......
This diff is collapsed.
......@@ -190,7 +190,7 @@ DEFAULT_TEMPLATE = {
'patches': PromptEntry('Patches Directory', spec=config_spec['patches']),
'ros_distro': PromptEntry('ROS Distro', default='indigo', spec=config_spec['ros_distro']),
'release_repo_url': PromptEntry('Release Repository Push URL', spec=config_spec['release_repo_url']),
'release_inc': -1,
'release_inc': 0,
'actions': [
'bloom-export-upstream :{vcs_local_uri} :{vcs_type}'
' --tag :{release_tag} --display-uri :{vcs_uri}'
......
......@@ -40,6 +40,8 @@ from bloom.logging import debug
from bloom.logging import error
from bloom.logging import info
from bloom.rosdistro_api import get_distribution_type
from bloom.util import code
from bloom.util import maybe_continue
from bloom.util import print_exc
......@@ -117,6 +119,21 @@ def resolve_more_for_os(rosdep_key, view, installer, os_name, os_version):
return installer.resolve(rule), inst_key, default_os_installer
def package_conditional_context(ros_distro):
distribution_type = get_distribution_type(ros_distro)
if distribution_type == 'ros1':
ros_version = '1'
elif distribution_type == 'ros2':
ros_version = '2'
else:
error("Bloom cannot cope with distribution_type '{0}'".format(
distribution_type), exit=True)
return {
'ROS_VERSION': ros_version,
'ROS_DISTRO': ros_distro,
}
def resolve_rosdep_key(
key,
os_name,
......
......@@ -58,6 +58,7 @@ from bloom.generators import update_rosdep
from bloom.generators.common import default_fallback_resolver
from bloom.generators.common import invalidate_view_cache
from bloom.generators.common import package_conditional_context
from bloom.generators.common import resolve_rosdep_key
from bloom.git import inbranch
......@@ -147,16 +148,16 @@ def __place_template_folder(group, src, dst, gbp=False):
if not os.path.exists(dst):
os.makedirs(dst)
if os.path.exists(template_dst):
debug("Removing existing file '{0}'".format(template_dst))
os.remove(template_dst)
with io.open(template_dst, 'w', encoding='utf-8') as f:
if not isinstance(template, str):
template = template.decode('utf-8')
# Python 2 API needs a `unicode` not a utf-8 string.
elif sys.version_info.major == 2:
template = template.decode('utf-8')
f.write(template)
shutil.copystat(template_abs_path, template_dst)
debug("Not overwriting existing file '{0}'".format(template_dst))
else:
with io.open(template_dst, 'w', encoding='utf-8') as f:
if not isinstance(template, str):
template = template.decode('utf-8')
# Python 2 API needs a `unicode` not a utf-8 string.
elif sys.version_info.major == 2:
template = template.decode('utf-8')
f.write(template)
shutil.copystat(template_abs_path, template_dst)
def place_template_files(path, build_type, gbp=False):
......@@ -312,10 +313,17 @@ def generate_substitutions_from_package(
# Installation prefix
data['InstallationPrefix'] = installation_prefix
# Resolve dependencies
depends = package.run_depends + package.buildtool_export_depends
build_depends = package.build_depends + package.buildtool_depends + package.test_depends
unresolved_keys = depends + build_depends + package.replaces + package.conflicts
package.evaluate_conditions(package_conditional_context(ros_distro))
depends = [
dep for dep in (package.run_depends + package.buildtool_export_depends)
if dep.evaluated_condition]
build_depends = [
dep for dep in (package.build_depends + package.buildtool_depends + package.test_depends)
if dep.evaluated_condition]
unresolved_keys = [
dep for dep in (depends + build_depends + package.replaces + package.conflicts)
if dep.evaluated_condition]
# The installer key is not considered here, but it is checked when the keys are checked before this
resolved_deps = resolve_dependencies(unresolved_keys, os_name,
os_version, ros_distro,
......@@ -647,15 +655,24 @@ class DebianGenerator(BloomGenerator):
update_rosdep()
self.has_run_rosdep = True
def _check_all_keys_are_valid(self, peer_packages):
def _check_all_keys_are_valid(self, peer_packages, ros_distro):
keys_to_resolve = []
key_to_packages_which_depends_on = collections.defaultdict(list)
keys_to_ignore = set()
for package in self.packages.values():
depends = package.run_depends + package.buildtool_export_depends
build_depends = package.build_depends + package.buildtool_depends + package.test_depends
unresolved_keys = depends + build_depends + package.replaces + package.conflicts
keys_to_ignore = keys_to_ignore.union(package.replaces + package.conflicts)
package.evaluate_conditions(package_conditional_context(ros_distro))
depends = [
dep for dep in (package.run_depends + package.buildtool_export_depends)
if dep.evaluated_condition]
build_depends = [
dep for dep in (package.build_depends + package.buildtool_depends + package.test_depends)
if dep.evaluated_condition]
unresolved_keys = [
dep for dep in (depends + build_depends + package.replaces + package.conflicts)
if dep.evaluated_condition]
keys_to_ignore = {
dep for dep in keys_to_ignore.union(package.replaces + package.conflicts)
if dep.evaluated_condition}
keys = [d.name for d in unresolved_keys]
keys_to_resolve.extend(keys)
for key in keys:
......@@ -699,7 +716,7 @@ class DebianGenerator(BloomGenerator):
peer_packages = [p.name for p in self.packages.values()]
while not self._check_all_keys_are_valid(peer_packages):
while not self._check_all_keys_are_valid(peer_packages, self.rosdistro):
error("Some of the dependencies for packages in this repository could not be resolved by rosdep.")
error("You can try to address the issues which appear above and try again if you wish.")
try:
......@@ -838,7 +855,9 @@ class DebianGenerator(BloomGenerator):
place_template_files('.', build_type, gbp=True)
# Commit results
execute_command('git add ' + debian_dir)
execute_command('git commit -m "Placing debian template files"')
_, has_files, _ = execute_command('git diff --cached --name-only', return_io=True)
if has_files:
execute_command('git commit -m "Placing debian template files"')
def get_releaser_history(self):
# Assumes that this is called in the target branch
......
@(debhelper_version)
\ No newline at end of file
@(debhelper_version)
@(debhelper_version)
\ No newline at end of file
@(debhelper_version)
@(debhelper_version)
\ No newline at end of file
@(debhelper_version)
@(debhelper_version)
\ No newline at end of file
@(debhelper_version)
......@@ -44,6 +44,8 @@ from bloom.generators.debian.generate_cmd import prepare_arguments
from bloom.logging import info
from bloom.rosdistro_api import get_index
from bloom.util import get_distro_list_prompt
......@@ -88,9 +90,10 @@ class RosDebianGenerator(DebianGenerator):
subs['Package'] = rosify_package_name(subs['Package'], self.rosdistro)
# ROS 2 specific bloom extensions.
# TODO(nuclearsandwich) explore other ways to enable these extensions, reduce their necessity,
# or make them configurable rather than relying on distro names.
if self.rosdistro in ['r2b2', 'r2b3', 'ardent', 'bouncy', 'crystal']:
ros2_distros = [
name for name, values in get_index().distributions.items()
if values.get('distribution_type') == 'ros2']
if self.rosdistro in ros2_distros:
# Add ros-workspace package as a dependency to any package other
# than ros_workspace and its dependencies.
if package.name not in ['ament_cmake_core', 'ament_package', 'ros_workspace']:
......@@ -100,7 +103,8 @@ class RosDebianGenerator(DebianGenerator):
# Add packages necessary to build vendor typesupport for rosidl_interface_packages to their
# build dependencies.
if self.rosdistro in ['bouncy', 'crystal'] and \
if self.rosdistro in ros2_distros and \
self.rosdistro not in ('r2b2', 'r2b3', 'ardent') and \
'rosidl_interface_packages' in [p.name for p in package.member_of_groups]:
ROS2_VENDOR_TYPESUPPORT_DEPENDENCIES = [
'rmw-connext-cpp',
......
......@@ -60,6 +60,7 @@ from bloom.generators import update_rosdep
from bloom.generators.common import default_fallback_resolver
from bloom.generators.common import invalidate_view_cache
from bloom.generators.common import package_conditional_context
from bloom.generators.common import resolve_rosdep_key
from bloom.git import inbranch
......@@ -231,9 +232,16 @@ def generate_substitutions_from_package(
# Installation prefix
data['InstallationPrefix'] = installation_prefix
# Resolve dependencies
depends = package.run_depends + package.buildtool_export_depends
build_depends = package.build_depends + package.buildtool_depends + package.test_depends
unresolved_keys = depends + build_depends + package.replaces + package.conflicts
package.evaluate_conditions(package_conditional_context(ros_distro))
depends = [
dep for dep in (package.run_depends + package.buildtool_export_depends)
if dep.evaluated_condition]
build_depends = [
dep for dep in (package.build_depends + package.buildtool_depends + package.test_depends)
if dep.evaluated_condition]
unresolved_keys = [
dep for dep in (depends + build_depends + package.replaces + package.conflicts)
if dep.evaluated_condition]
# The installer key is not considered here, but it is checked when the keys are checked before this
resolved_deps = resolve_dependencies(unresolved_keys, os_name,
os_version, ros_distro,
......@@ -526,15 +534,24 @@ class RpmGenerator(BloomGenerator):
update_rosdep()
self.has_run_rosdep = True
def _check_all_keys_are_valid(self, peer_packages):
def _check_all_keys_are_valid(self, peer_packages, rosdistro):
keys_to_resolve = []
key_to_packages_which_depends_on = collections.defaultdict(list)
keys_to_ignore = set()
for package in self.packages.values():
depends = package.run_depends + package.buildtool_export_depends
build_depends = package.build_depends + package.buildtool_depends + package.test_depends
unresolved_keys = depends + build_depends + package.replaces + package.conflicts
keys_to_ignore = keys_to_ignore.union(package.replaces + package.conflicts)
package.evaluate_conditions(package_conditional_context(rosdistro))
depends = [
dep for dep in (package.run_depends + package.buildtool_export_depends)
if dep.evaluated_condition]
build_depends = [
dep for dep in (package.build_depends + package.buildtool_depends + package.test_depends)
if dep.evaluated_condition]
unresolved_keys = [
dep for dep in (depends + build_depends + package.replaces + package.conflicts)
if dep.evaluated_condition]
keys_to_ignore = {
dep for dep in keys_to_ignore.union(package.replaces + package.conflicts)
if dep.evaluated_condition}
keys = [d.name for d in unresolved_keys]
keys_to_resolve.extend(keys)
for key in keys:
......@@ -578,7 +595,7 @@ class RpmGenerator(BloomGenerator):
peer_packages = [p.name for p in self.packages.values()]
while not self._check_all_keys_are_valid(peer_packages):
while not self._check_all_keys_are_valid(peer_packages, self.rosdistro):
error("Some of the dependencies for packages in this repository could not be resolved by rosdep.")
error("You can try to address the issues which appear above and try again if you wish, "
"or continue without releasing into RPM-based distributions (e.g. Fedora 24).")
......
......@@ -39,10 +39,19 @@ from __future__ import print_function
import base64
import datetime
import getpass
import json
import os
import socket
import sys
from bloom.logging import error
from bloom.logging import info
from bloom.logging import warning
from bloom.util import maybe_continue
from bloom.util import safe_input
try:
# Python2
......@@ -50,11 +59,13 @@ try:
from urllib2 import HTTPError
from urllib2 import Request, urlopen
from urllib2 import URLError
from urlparse import urlparse
from urlparse import urlunsplit
except ImportError:
# Python3
from urllib.error import HTTPError
from urllib.error import URLError
from urllib.parse import urlparse
from urllib.parse import urlunsplit
from urllib.request import Request, urlopen
......@@ -62,7 +73,10 @@ import bloom
def auth_header_from_basic_auth(user, password):
return "Basic {0}".format(base64.b64encode('{0}:{1}'.format(user, password)))
auth_str = '{0}:{1}'.format(user, password)
if sys.version_info >= (3, 0):
auth_str = auth_str.encode()
return "Basic {0}".format(base64.b64encode(auth_str))
def auth_header_from_oauth_token(token):
......@@ -240,3 +254,97 @@ class Github(object):
raise GithubException("Failed to create pull request", resp)
resp_json = json_loads(resp)
return resp_json['html_url']
def get_gh_info(url):
o = urlparse(url)
if 'raw.github.com' not in o.netloc and 'raw.githubusercontent.com' not in o.netloc:
return None
url_paths = o.path.split('/')
if len(url_paths) < 5:
return None
return {'server': 'github.com',
'org': url_paths[1],
'repo': url_paths[2],
'branch': url_paths[3],
'path': '/'.join(url_paths[4:])}
_gh = None
def get_github_interface(quiet=False):
def mfa_prompt(oauth_config_path, username):
"""Explain how to create a token for users with Multi-Factor Authentication configured."""
warning("Receiving 401 when trying to create an oauth token can be caused by the user "
"having two-factor authentication enabled.")
warning("If 2FA is enabled, the user will have to create an oauth token manually.")
warning("A token can be created at https://github.com/settings/tokens")
warning("The resulting token can be placed in the '{oauth_config_path}' file as such:"
.format(**locals()))
info("")
warning('{{"github_user": "{username}", "oauth_token": "TOKEN_GOES_HERE"}}'
.format(**locals()))
info("")
global _gh
if _gh is not None:
return _gh
# First check to see if the oauth token is stored
oauth_config_path = os.path.join(os.path.expanduser('~'), '.config', 'bloom')
config = {}
if os.path.exists(oauth_config_path):
with open(oauth_config_path, 'r') as f:
config = json.loads(f.read())
token = config.get('oauth_token', None)
username = config.get('github_user', None)
if token and username:
return Github(username, auth=auth_header_from_oauth_token(token), token=token)
if not os.path.isdir(os.path.dirname(oauth_config_path)):
os.makedirs(os.path.dirname(oauth_config_path))
if quiet:
return None
# Ok, now we have to ask for the user name and pass word
info("")
warning("Looks like bloom doesn't have an oauth token for you yet.")
warning("Therefore bloom will require your GitHub username and password just this once.")
warning("With your GitHub username and password bloom will create an oauth token on your behalf.")
warning("The token will be stored in `~/.config/bloom`.")
warning("You can delete the token from that file to have a new token generated.")
warning("Guard this token like a password, because it allows someone/something to act on your behalf.")
warning("If you need to unauthorize it, remove it from the 'Applications' menu in your GitHub account page.")
info("")
if not maybe_continue('y', "Would you like to create an OAuth token now"):
return None
token = None
while token is None:
try:
username = getpass.getuser()
username = safe_input("GitHub username [{0}]: ".format(username)) or username
password = getpass.getpass("GitHub password (never stored): ")
except (KeyboardInterrupt, EOFError):
return None
if not password:
error("No password was given, aborting.")
return None
gh = Github(username, auth=auth_header_from_basic_auth(username, password))
try:
token = gh.create_new_bloom_authorization(update_auth=True)
with open(oauth_config_path, 'w') as f:
config.update({'oauth_token': token, 'github_user': username})
f.write(json.dumps(config))
info("The token '{token}' was created and stored in the bloom config file: '{oauth_config_path}'"
.format(**locals()))
except GitHubAuthException as exc:
error("{0}".format(exc))
mfa_prompt(oauth_config_path, username)
except GithubException as exc:
error("{0}".format(exc))
info("")
if hasattr(exc, 'resp') and '{0}'.format(exc.resp.status) in ['401']:
mfa_prompt(oauth_config_path, username)
warning("This sometimes fails when the username or password are incorrect, try again?")
if not maybe_continue():
return None
_gh = gh
return gh
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Open Source Robotics Foundation, Inc.
# Copyright (c) 2013, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import traceback
from pkg_resources import parse_version
# python2/3 compatibility
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from bloom.github import Github
from bloom.github import GithubException
from bloom.github import get_gh_info
from bloom.github import get_github_interface
from bloom.logging import debug
from bloom.logging import error
from bloom.logging import info
try:
import rosdistro
if parse_version(rosdistro.__version__) < parse_version('0.7.0'):
error("rosdistro version 0.7.0 or greater is required, found '{0}' from '{1}'."
.format(rosdistro.__version__, os.path.dirname(rosdistro.__file__)),
exit=True)
except ImportError:
debug(traceback.format_exc())
error("rosdistro was not detected, please install it.", file=sys.stderr,
exit=True)
_rosdistro_index = None
_rosdistro_distribution_files = {}
_rosdistro_index_commit = None
_rosdistro_index_original_branch = None
def get_index_url():
global _rosdistro_index_commit, _rosdistro_index_original_branch
index_url = rosdistro.get_index_url()
pr = urlparse(index_url)
if pr.netloc in ['raw.github.com', 'raw.githubusercontent.com']:
# Try to determine what the commit hash was
tokens = [x for x in pr.path.split('/') if x]
if len(tokens) <= 3:
debug("Failed to get commit for rosdistro index file: index url")
debug(tokens)
return index_url
owner = tokens[0]
repo = tokens[1]
branch = tokens[2]
gh = get_github_interface(quiet=True)
if gh is None:
# Failed to get it with auth, try without auth (may fail)
gh = Github(username=None, auth=None)
try:
data = gh.get_branch(owner, repo, branch)
except GithubException:
debug(traceback.format_exc())
debug("Failed to get commit for rosdistro index file: api")
return index_url
_rosdistro_index_commit = data.get('commit', {}).get('sha', None)
if _rosdistro_index_commit is not None:
info("ROS Distro index file associate with commit '{0}'"
.format(_rosdistro_index_commit))
# Also mutate the index_url to use the commit (rather than the moving branch name)
base_info = get_gh_info(index_url)
base_branch = base_info['branch']
rosdistro_index_commit = _rosdistro_index_commit # Copy global into local for substitution
middle = "{org}/{repo}".format(**base_info)
index_url = index_url.replace("{pr.netloc}/{middle}/{base_branch}/".format(**locals()),
"{pr.netloc}/{middle}/{rosdistro_index_commit}/".format(**locals()))
info("New ROS Distro index url: '{0}'".format(index_url))
_rosdistro_index_original_branch = base_branch
else:
debug("Failed to get commit for rosdistro index file: json")
return index_url
def get_index():
global _rosdistro_index
if _rosdistro_index is None:
_rosdistro_index = rosdistro.get_index(get_index_url())
if _rosdistro_index.version == 1:
error("This version of bloom does not support rosdistro version "
"'{0}', please use an older version of bloom."
.format(_rosdistro_index.version), exit=True)
if _rosdistro_index.version > 4:
error("This version of bloom does not support rosdistro version "
"'{0}', please update bloom.".format(_rosdistro_index.version), exit=True)
return _rosdistro_index
def list_distributions():
return sorted(get_index().distributions.keys())
def get_distribution_type(distro):
return get_index().distributions[distro].get('distribution_type')
def get_most_recent(thing_name, repository, reference_distro):
reference_distro_type = get_distribution_type(reference_distro)
distros_with_entry = {}
get_things = {
'release': lambda r: None if r.release_repository is None else r.release_repository,
'doc': lambda r: None if r.doc_repository is None else r.doc_repository,
'source': lambda r: None if r.source_repository is None else r.source_repository,
}
get_thing = get_things[thing_name]
for distro in list_distributions():
# skip distros with a different type if the information is available
if reference_distro_type is not None:
if get_distribution_type(distro) != reference_distro_type:
continue
distro_file = get_distribution_file(distro)
if repository in distro_file.repositories:
thing = get_thing(distro_file.repositories[repository])
if thing is not None:
distros_with_entry[distro] = thing
# Choose the alphabetical last distro which contained a release of this repository
default_distro = (sorted(distros_with_entry.keys()) or [None])[-1]
default_thing = distros_with_entry.get(default_distro, None)
return default_distro, default_thing
def get_distribution_file(distro):
global _rosdistro_distribution_files
if distro not in _rosdistro_distribution_files:
# REP 143, get list of distribution files and take the last one
files = rosdistro.get_distribution_files(get_index(), distro)
if not files:
error("No distribution files listed for distribution '{0}'."
.format(distro), exit=True)
_rosdistro_distribution_files[distro] = files[-1]
return _rosdistro_distribution_files[distro]
def get_rosdistro_index_commit():
return _rosdistro_index_commit
def get_rosdistro_index_original_branch():
return _rosdistro_index_original_branch
......@@ -14,6 +14,7 @@
from __future__ import print_function
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
......@@ -61,7 +62,7 @@ version = '0.4'
# The full version, including alpha/beta/rc tags.
setup_py = os.path.join(os.path.dirname(__file__), '..', 'setup.py')
import subprocess
release = subprocess.check_output('/usr/bin/env python ' + setup_py + ' --version', shell=True).strip()
release = subprocess.check_output(sys.executable + ' ' + setup_py + ' --version', shell=True).strip().decode('utf-8')
print('Using release version: {0}'.format(release))
# The language for content autogenerated by Sphinx. Refer to documentation
......
......@@ -22,7 +22,7 @@ if sys.version_info[0] == 2 and sys.version_info[1] <= 6:
setup(
name='bloom',
version='0.7.2',
version='0.8.0',
packages=find_packages(exclude=['test', 'test.*']),
package_data={
'bloom.generators.debian': [
......
......@@ -4,5 +4,5 @@ Depends3: python3-yaml, python3-empy, python3-rosdep (>= 0.15.0), python3-rosdis
Conflicts: python3-bloom
Conflicts3: python-bloom
Copyright-File: LICENSE.txt
Suite: oneiric precise quantal raring saucy trusty utopic vivid wily xenial yakkety zesty artful bionic wheezy jessie stretch buster
X-Python3-Version: >= 3.2
Suite: trusty utopic vivid wily xenial yakkety zesty artful bionic jessie stretch buster
X-Python3-Version: >= 3.4
......@@ -5,3 +5,11 @@ if 'PATH' in os.environ:
scripts = os.path.join(os.path.dirname(__file__), '..', 'scripts')
scripts = os.path.abspath(scripts)
os.environ['PATH'] = scripts + ':' + os.environ['PATH']
user_email = 'test@example.com'
user_name = 'Test User'
os.environ.setdefault('GIT_AUTHOR_NAME', user_name)
os.environ.setdefault('GIT_AUTHOR_EMAIL', user_email)
os.environ.setdefault('GIT_COMMITTER_NAME', user_name)
os.environ.setdefault('GIT_COMMITTER_EMAIL', user_email)
......@@ -132,7 +132,7 @@ def _test_unary_package_repository(release_dir, version, directory=None):
"no patches/release/melodic/foo branch"
# was the release tag created?
ret, out, err = user('git tag', return_io=True)
expected = 'release/melodic/foo/' + version + '-0'
expected = 'release/melodic/foo/' + version + '-1'
assert out.count(expected) == 1, \
"no release tag created, expected: '{0}'".format(expected)
......@@ -266,7 +266,7 @@ def test_multi_package_repository(directory=None):
assert branch_exists('patches/release/melodic/' + pkg), \
"no patches/release/melodic/" + pkg + " branch"
# Did the release tag get created?
assert out.count('release/melodic/' + pkg + '/0.1.0-0') == 1, \
assert out.count('release/melodic/' + pkg + '/0.1.0-1') == 1, \
"no release tag created for " + pkg
# Is there a package.xml in the top level?
with inbranch('release/melodic/' + pkg):
......@@ -299,7 +299,7 @@ def test_multi_package_repository(directory=None):
assert branch_exists('patches/release/melodic/' + pkg), \
"no patches/release/melodic/" + pkg + " branch"
# Did the release tag get created?
assert out.count('release/melodic/' + pkg + '/0.1.0-0') == 1, \
assert out.count('release/melodic/' + pkg + '/0.1.0-1') == 1, \
"no release tag created for " + pkg
# Is there a package.xml in the top level?
with inbranch('release/melodic/' + pkg):
......@@ -329,7 +329,7 @@ def test_multi_package_repository(directory=None):
assert branch_exists(patches_branch), \
"no " + patches_branch + " branch"
# Did the debian tag get created?
tag = 'debian/ros-melodic-' + pkg_san + '_0.1.0-0_' + distro
tag = 'debian/ros-melodic-' + pkg_san + '_0.1.0-1_' + distro
assert out.count(tag) == 1, \
"no '" + tag + "'' tag created for '" + pkg + "': `\n" + \
out + "\n`"
......
import os
from ..utils.common import AssertRaisesContext
from ..utils.common import in_temporary_directory
from ..utils.common import redirected_stdio
from ..utils.common import user
from bloom.packages import get_package_data
test_data_dir = os.path.join(os.path.d