Commit 9a95a75f authored by Jochen Sprickerhof's avatar Jochen Sprickerhof

New upstream version 0.13.0

parent 7767e78d
language: python
matrix:
include:
- os: linux
python: 2.6
- os: linux
python: 2.7
- os: linux
python: 3.4
- os: linux
python: 3.5
- os: linux
python: 3.6
- os: osx
language: generic
env: PYTHON_INSTALLER=brew
......@@ -21,13 +23,13 @@ matrix:
install:
- source .travis/install.sh
- python --version
- pip install PyYAML argparse rospkg vcstools catkin_pkg python-dateutil rosdistro
- pip install -e .
- pip install nose coverage flake8 mock codecov
- python -m pip install PyYAML argparse rospkg vcstools catkin_pkg python-dateutil rosdistro
- python -m pip install -e .
- python -m pip install nose coverage flake8 mock codecov
# command to run tests
script:
- nosetests --with-coverage --cover-package=rosdep2 --with-xunit test
- python -m nose --with-coverage --cover-package=rosdep2 --with-xunit test
after_script:
- codecov
- python -m codecov
notifications:
email: false
......@@ -12,17 +12,6 @@ do_install()
PYTHON_ENV_NAME=virtual-env-$TRAVIS_PYTHON_VERSION
pyenv virtualenv $TRAVIS_PYTHON_VERSION $PYTHON_ENV_NAME
pyenv activate $PYTHON_ENV_NAME
elif [[ $TRAVIS_OS_NAME == 'osx' && $PYTHON_INSTALLER == 'brew' ]]; then
# nose 1.3.7 creates /usr/local/man dir if it does not exist.
# The operation fails because current user does not own /usr/local. Create the dir manually instead.
sudo mkdir /usr/local/man
sudo chown -R $(whoami) $(brew --prefix)/*
export PATH=$(pwd)/.travis/shim:$PATH
mkdir -p ~/Library/Python/2.7/lib/python/site-packages
echo "$(brew --prefix)/lib/python2.7/site-packages" >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
fi
}
......
#!/bin/sh
# This wrapper allows installation to call pip and it actually be
# the pip2 that's part of brewed Python, rather than the missing
# system pip.
pip2 $@
exit $?
0.13.0 (2018-11-06)
-------------------
- Improve error message when a package.xml is malformed
- https://github.com/ros-infrastructure/rosdep/pull/608
- Enable rosdep db cache from python3 to be used from python2.
- https://github.com/ros-infrastructure/rosdep/pull/633
- Reported in https://github.com/ros-infrastructure/rosdep/issues/3791
- Fix DNF installer behavior to match yum and apt.
- https://github.com/ros-infrastructure/rosdep/pull/638
- Clean up executable permissions and #! lines.
- https://github.com/ros-infrastructure/rosdep/pull/630
- Fix quiet mode for Debian installer.
- https://github.com/ros-infrastructure/rosdep/pull/612
- Fix typos in documentation.
- https://github.com/ros-infrastructure/rosdep/pull/606
- https://github.com/ros-infrastructure/rosdep/pull/634
- Improve documentation output on Fedora.
- https://github.com/ros-infrastructure/rosdep/pull/628
- Update CI infrastructure.
- https://github.com/ros-infrastructure/rosdep/pull/602
- https://github.com/ros-infrastructure/rosdep/pull/609
- https://github.com/ros-infrastructure/rosdep/pull/629
- https://github.com/ros-infrastructure/rosdep/pull/636
- Fix RPM comand tests.
- https://github.com/ros-infrastructure/rosdep/pull/627
- Update package metadata.
- https://github.com/ros-infrastructure/rosdep/pull/605
0.12.2 (2018-03-21)
-------------------
- Fix bug introduced in https://github.com/ros-infrastructure/rosdep/pull/521, reported in https://github.com/ros-infrastructure/rosdep/issues/589
......
......@@ -46,7 +46,7 @@ install the system dependencies for.
Common installation workflow::
$ rosdep check ros_comm
All system dependencies have been satisified
All system dependencies have been satisfied
$ rosdep install geometry
If you're worried about ``rosdep install`` bringing in system
......
......@@ -35,14 +35,14 @@ class RosdepCLIDirective(Directive):
[py, '-c', "from rosdep2.main import rosdep_main;rosdep_main(['-h'])"]
)
return [
nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out))
nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out.decode()))
]
if 'install' in self.arguments:
out = subprocess.check_output(
[py, '-c', "from rosdep2.main import rosdep_main;rosdep_main(['install', '-h'])"]
)
return [
nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out))
nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out.decode()))
]
......
......@@ -15,7 +15,6 @@ setup(
author='Tully Foote, Ken Conley',
author_email='tfoote@osrfoundation.org',
url='http://wiki.ros.org/rosdep',
download_url='http://download.ros.org/downloads/rosdep/',
keywords=['ROS'],
classifiers=[
'Programming Language :: Python',
......
__version__ = '0.12.2'
__version__ = '0.13.0'
File mode changed from 100755 to 100644
......@@ -179,7 +179,7 @@ class RosdepView(object):
View of :class:`RosdepDatabase`. Unlike :class:`RosdepDatabase`,
which stores :class:`RosdepDatabaseEntry` data for all stacks, a
view merges entries for a particular stack. This view can then be
queries to lookup and resolve individual rosdep dependencies.
queried to lookup and resolve individual rosdep dependencies.
"""
def __init__(self, name):
......
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
......@@ -73,6 +72,7 @@ from .rosdistrohelper import PreRep137Warning
from .catkin_packages import find_catkin_packages_in
from .catkin_packages import set_workspace_packages
from .catkin_packages import get_workspace_packages
from catkin_pkg.package import InvalidPackage
class UsageError(Exception):
......@@ -175,6 +175,9 @@ ERROR: %s
except UnsupportedOs as e:
print('Unsupported OS: %s\nSupported OSes are [%s]' % (e.args[0], ', '.join(e.args[1])), file=sys.stderr)
sys.exit(1)
except InvalidPackage as e:
print(str(e))
sys.exit(1)
except Exception as e:
print("""
ERROR: Rosdep experienced an error: %s
......@@ -631,13 +634,13 @@ def command_check(lookup, packages, options):
# pretty print the result
if [v for k, v in uninstalled if v]:
print('System dependencies have not been satisified:')
print('System dependencies have not been satisfied:')
for installer_key, resolved in uninstalled:
if resolved:
for r in resolved:
print('%s\t%s' % (installer_key, r))
else:
print('All system dependencies have been satisified')
print('All system dependencies have been satisfied')
if errors:
for package_name, ex in errors.items():
if isinstance(ex, rospkg.ResourceNotFound):
......
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
......
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
......
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
......@@ -234,13 +233,10 @@ class AptInstaller(PackageManagerInstaller):
packages = self.get_packages_to_install(resolved, reinstall=reinstall)
if not packages:
return []
if not interactive and quiet:
base_cmd = ['apt-get', 'install', '-y', '-qq']
elif quiet:
base_cmd = ['apt-get', 'install', '-qq']
base_cmd = ['apt-get', 'install']
if not interactive:
base_cmd = ['apt-get', 'install', '-y']
else:
base_cmd = ['apt-get', 'install']
base_cmd.append('-y')
if quiet:
base_cmd.append('-qq')
return [self._get_install_commands_for_package(base_cmd, p) for p in _iterate_packages(packages, reinstall)]
#!/usr/bin/env python
# Copyright (c) 2010, Willow Garage, Inc.
# All rights reserved.
#
......
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# Copyright (c) 2012, Intermodalics, BVBA.
# All rights reserved.
......
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
......
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
......
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
......
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
......@@ -156,13 +155,13 @@ class DnfInstaller(PackageManagerInstaller):
if not packages:
return []
elif not interactive and quiet:
return [self.elevate_priv(['dnf', '--assumeyes', '--quiet', 'install']) + packages]
return [self.elevate_priv(['dnf', '--assumeyes', '--quiet', '--setopt=strict=0', 'install']) + packages]
elif quiet:
return [self.elevate_priv(['dnf', '--quiet', 'install']) + packages]
return [self.elevate_priv(['dnf', '--quiet', '--setopt=strict=0', 'install']) + packages]
elif not interactive:
return [self.elevate_priv(['dnf', '--assumeyes', 'install']) + packages]
return [self.elevate_priv(['dnf', '--assumeyes', '--setopt=strict=0', 'install']) + packages]
else:
return [self.elevate_priv(['dnf', 'install']) + packages]
return [self.elevate_priv(['dnf', '--setopt=strict=0', 'install']) + packages]
class YumInstaller(PackageManagerInstaller):
......
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
......
......@@ -557,7 +557,7 @@ def write_cache_file(source_cache_d, key_filenames, rosdep_data):
key_hash = compute_filename_hash(key_filenames)
filepath = os.path.join(source_cache_d, key_hash)
try:
write_atomic(filepath + PICKLE_CACHE_EXT, pickle.dumps(rosdep_data, -1), True)
write_atomic(filepath + PICKLE_CACHE_EXT, pickle.dumps(rosdep_data, 2), True)
except OSError as e:
raise CachePermissionError('Failed to write cache file: ' + str(e))
try:
......
......@@ -3,5 +3,6 @@ Depends: ca-certificates, python-rospkg (>= 1.0.37), python-yaml, python-catkin-
Depends3: ca-certificates, python3-rospkg (>= 1.0.37), python3-yaml, python3-catkin-pkg, python3-rosdistro (>= 0.4.0)
Conflicts: python3-rosdep, python-rosdep2, python3-rosdep2
Conflicts3: python-rosdep, python-rosdep2, python3-rosdep2
Copyright-File: LICENSE
Suite: oneiric precise quantal raring saucy trusty utopic vivid wily xenial yakkety zesty artful bionic wheezy jessie stretch buster
X-Python3-Version: >= 3.2
<?xml version="1.0"?>
<package>
<name>foo</name>
<version>:{version}</version>
<description>Package Foo</description>
<license>BSD</license>
<maintainer email="foo@bar.com">Foo Bar</maintainer>
</package>
......@@ -17,18 +17,10 @@ from __future__ import print_function
import os
import sys
# flake8 doesn't support Python < 2.7 anymore
if sys.version_info[0] > 2 or sys.version_info[1] >= 7:
from flake8.api.legacy import get_style_guide
else:
get_style_guide = None
from flake8.api.legacy import get_style_guide
def test_flake8():
if get_style_guide is None:
# skip test on Python 2.6 and older
return
style_guide = get_style_guide(
exclude=['conf.py'],
ignore=[
......@@ -41,6 +33,7 @@ def test_flake8():
'F841', # ignore presence of unused variables
'I', # ignore import order related warnings
'N802', # ignore presence of upper case in function names
'W504', # ignore line breaks after binary operator (new rule added in 2018)
],
max_line_length=200,
max_complexity=10,
......@@ -61,7 +54,7 @@ def test_flake8():
report._application.formatter.show_statistics(report._stats)
print(
'flake8 reported {report.total_errors} errors'
.format_map(locals()), file=sys.stderr)
.format(**locals()), file=sys.stderr)
assert not report.total_errors, \
'flake8 reported {report.total_errors} errors'.format_map(locals())
'flake8 reported {report.total_errors} errors'.format(**locals())
......@@ -124,7 +124,7 @@ class TestRosdepMain(unittest.TestCase):
assert False, 'system exit occurred: %s\n%s' % (b[0].getvalue(), b[1].getvalue())
stdout, stderr = b
assert stdout.getvalue().strip() == 'All system dependencies have been satisified', stdout.getvalue()
assert stdout.getvalue().strip() == 'All system dependencies have been satisfied', stdout.getvalue()
assert not stderr.getvalue(), stderr.getvalue()
try:
osd = rospkg.os_detect.OsDetect()
......@@ -132,7 +132,7 @@ class TestRosdepMain(unittest.TestCase):
with fakeout() as b:
rosdep_main(['check', 'python_dep', '--os', override] + cmd_extras)
stdout, stderr = b
assert stdout.getvalue().strip() == 'All system dependencies have been satisified'
assert stdout.getvalue().strip() == 'All system dependencies have been satisfied'
assert not stderr.getvalue(), stderr.getvalue()
except SystemExit:
assert False, 'system exit occurred'
......@@ -142,7 +142,7 @@ class TestRosdepMain(unittest.TestCase):
with fakeout() as b:
rosdep_main(['check', 'packageless'] + cmd_extras)
stdout, stderr = b
assert stdout.getvalue().strip() == 'All system dependencies have been satisified'
assert stdout.getvalue().strip() == 'All system dependencies have been satisfied'
assert not stderr.getvalue(), stderr.getvalue()
except SystemExit:
assert False, 'system exit occurred'
......@@ -275,3 +275,15 @@ class TestRosdepMain(unittest.TestCase):
with patch.dict('os.environ', {'https_proxy': 'somethings'}, clear=True):
setup_proxy_opener()
proxy.assert_called_with({'https': 'somethings'})
def test_invalid_package_message(self):
with fakeout() as b:
test_package_dir = os.path.abspath(os.path.join(get_test_dir(), 'main', 'invalid_package_version'))
with patch('rosdep2.main.sys.exit') as exit_mock:
rosdep_main(['install', '--from-path', test_package_dir])
exit_mock.assert_called_with(1)
stdout, stderr = b
output = stdout.getvalue().splitlines()
assert len(output) == 2
assert test_package_dir in output[0]
assert 'Package version ":{version}" does not follow version conventions' in output[1]
......@@ -37,20 +37,20 @@ def get_test_dir():
return os.path.abspath(os.path.join(os.path.dirname(__file__), 'redhat'))
def test_rpm_expand():
from rosdep2.platforms.redhat import rpm_expand
def test_rpm_expand_cmd():
from rosdep2.platforms.redhat import rpm_expand_cmd
m = Mock()
m.return_value = ''
# Non-macro test, should return the string unmodified
val = rpm_expand('test-string', exec_fn=m)
val = rpm_expand_cmd('test-string', exec_fn=m)
assert val == 'test-string', val
# Macro test, should return expanded rpm tag
with open(os.path.join(get_test_dir(), 'rpm-E-fedora'), 'r') as f:
m.return_value = f.read()
val = rpm_expand('%fedora', exec_fn=m)
val = rpm_expand_cmd('%fedora', exec_fn=m)
assert val == '27', val
......@@ -87,16 +87,16 @@ def test_DnfInstaller():
# no interactive option with YUM
mock_method.return_value = ['a', 'b']
expected = [['sudo', '-H', 'dnf', '--assumeyes', '--quiet', 'install', 'a', 'b']]
expected = [['sudo', '-H', 'dnf', '--assumeyes', '--quiet', '--setopt=strict=0', 'install', 'a', 'b']]
val = installer.get_install_command(['whatever'], interactive=False, quiet=True)
assert val == expected, val + expected
expected = [['sudo', '-H', 'dnf', '--quiet', 'install', 'a', 'b']]
expected = [['sudo', '-H', 'dnf', '--quiet', '--setopt=strict=0', 'install', 'a', 'b']]
val = installer.get_install_command(['whatever'], interactive=True, quiet=True)
assert val == expected, val + expected
expected = [['sudo', '-H', 'dnf', '--assumeyes', 'install', 'a', 'b']]
expected = [['sudo', '-H', 'dnf', '--assumeyes', '--setopt=strict=0', 'install', 'a', 'b']]
val = installer.get_install_command(['whatever'], interactive=False, quiet=False)
assert val == expected, val + expected
expected = [['sudo', '-H', 'dnf', 'install', 'a', 'b']]
expected = [['sudo', '-H', 'dnf', '--setopt=strict=0', 'install', 'a', 'b']]
val = installer.get_install_command(['whatever'], interactive=True, quiet=False)
assert val == expected, val + expected
try:
......
......@@ -484,3 +484,15 @@ def test_SourcesListLoader_create_default():
# - coverage, repeat loader, should noop
loader.load_view(GITHUB_URL, rosdep_db)
def test_unpickle_same_results():
try:
import cPickle as pickle
except ImportError:
import pickle
with open(os.path.join('test', 'fixtures', 'python2cache.pickle'), 'rb') as py2_cache:
py2_result = pickle.loads(py2_cache.read())
with open(os.path.join('test', 'fixtures', 'python3cache.pickle'), 'rb') as py3_cache:
py3_result = pickle.loads(py3_cache.read())
assert py2_result == py3_result
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment