diff --git a/.travis.yml b/.travis.yml index 9301a50f5..b5cf62067 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,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 diff --git a/.travis/install.sh b/.travis/install.sh index ff3da433d..fab5ac6a9 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -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 } diff --git a/.travis/shim/pip b/.travis/shim/pip deleted file mode 100755 index 7b89260f9..000000000 --- a/.travis/shim/pip +++ /dev/null @@ -1,6 +0,0 @@ -#!/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 $? diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 563a76690..cfcb3d868 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,31 @@ +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 diff --git a/doc/overview.rst b/doc/overview.rst index 672f8f38d..60d98e65b 100644 --- a/doc/overview.rst +++ b/doc/overview.rst @@ -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 diff --git a/doc/rosdep_doc_utils.py b/doc/rosdep_doc_utils.py index b94a71af2..6832a9b3a 100644 --- a/doc/rosdep_doc_utils.py +++ b/doc/rosdep_doc_utils.py @@ -35,14 +35,14 @@ def run(self): [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())) ] diff --git a/src/rosdep2/_version.py b/src/rosdep2/_version.py index 92a60bdf2..2d7893e3d 100644 --- a/src/rosdep2/_version.py +++ b/src/rosdep2/_version.py @@ -1 +1 @@ -__version__ = '0.12.2' +__version__ = '0.13.0' diff --git a/src/rosdep2/catkin_support.py b/src/rosdep2/catkin_support.py old mode 100755 new mode 100644 diff --git a/src/rosdep2/main.py b/src/rosdep2/main.py index 441565482..a8b2a2822 100644 --- a/src/rosdep2/main.py +++ b/src/rosdep2/main.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # @@ -635,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): diff --git a/src/rosdep2/platforms/arch.py b/src/rosdep2/platforms/arch.py index 332d1e3c5..c03e2f19f 100644 --- a/src/rosdep2/platforms/arch.py +++ b/src/rosdep2/platforms/arch.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # diff --git a/src/rosdep2/platforms/cygwin.py b/src/rosdep2/platforms/cygwin.py index 20e1aac22..2808f1dc3 100644 --- a/src/rosdep2/platforms/cygwin.py +++ b/src/rosdep2/platforms/cygwin.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # diff --git a/src/rosdep2/platforms/debian.py b/src/rosdep2/platforms/debian.py index 647f0540d..5cf359022 100644 --- a/src/rosdep2/platforms/debian.py +++ b/src/rosdep2/platforms/debian.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # diff --git a/src/rosdep2/platforms/freebsd.py b/src/rosdep2/platforms/freebsd.py index 2353e0723..ee0e57d10 100644 --- a/src/rosdep2/platforms/freebsd.py +++ b/src/rosdep2/platforms/freebsd.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2010, Willow Garage, Inc. # All rights reserved. # diff --git a/src/rosdep2/platforms/gem.py b/src/rosdep2/platforms/gem.py index 05e723f85..e6a2b957a 100644 --- a/src/rosdep2/platforms/gem.py +++ b/src/rosdep2/platforms/gem.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # Copyright (c) 2012, Intermodalics, BVBA. # All rights reserved. diff --git a/src/rosdep2/platforms/gentoo.py b/src/rosdep2/platforms/gentoo.py index 58cbd9c55..b0d0bee2d 100644 --- a/src/rosdep2/platforms/gentoo.py +++ b/src/rosdep2/platforms/gentoo.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # diff --git a/src/rosdep2/platforms/osx.py b/src/rosdep2/platforms/osx.py index 247fa677c..c17e811c0 100644 --- a/src/rosdep2/platforms/osx.py +++ b/src/rosdep2/platforms/osx.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # diff --git a/src/rosdep2/platforms/pip.py b/src/rosdep2/platforms/pip.py index 78a234b23..7ae8ffda4 100644 --- a/src/rosdep2/platforms/pip.py +++ b/src/rosdep2/platforms/pip.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # diff --git a/src/rosdep2/platforms/redhat.py b/src/rosdep2/platforms/redhat.py index 2beb4ab66..9d1c5e9a7 100644 --- a/src/rosdep2/platforms/redhat.py +++ b/src/rosdep2/platforms/redhat.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # @@ -156,13 +155,13 @@ def get_install_command(self, resolved, interactive=True, reinstall=False, quiet 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): diff --git a/src/rosdep2/platforms/slackware.py b/src/rosdep2/platforms/slackware.py index bc594cfd7..d6a199e26 100644 --- a/src/rosdep2/platforms/slackware.py +++ b/src/rosdep2/platforms/slackware.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # diff --git a/src/rosdep2/sources_list.py b/src/rosdep2/sources_list.py index 9d89a8204..11d30dc5f 100644 --- a/src/rosdep2/sources_list.py +++ b/src/rosdep2/sources_list.py @@ -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: diff --git a/stdeb.cfg b/stdeb.cfg index 5c81888dc..4ba2ce287 100644 --- a/stdeb.cfg +++ b/stdeb.cfg @@ -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 diff --git a/test/fixtures/python2cache.pickle b/test/fixtures/python2cache.pickle new file mode 100644 index 000000000..7904d3d8d Binary files /dev/null and b/test/fixtures/python2cache.pickle differ diff --git a/test/fixtures/python3cache.pickle b/test/fixtures/python3cache.pickle new file mode 100644 index 000000000..1fa239674 Binary files /dev/null and b/test/fixtures/python3cache.pickle differ diff --git a/test/test_flake8.py b/test/test_flake8.py index 6c8cb496d..440ca386c 100644 --- a/test/test_flake8.py +++ b/test/test_flake8.py @@ -33,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, @@ -53,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(**locals()) diff --git a/test/test_rosdep_main.py b/test/test_rosdep_main.py index bb0988e09..8c6a59578 100644 --- a/test/test_rosdep_main.py +++ b/test/test_rosdep_main.py @@ -124,7 +124,7 @@ def test_check(self): 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 @@ def test_check(self): 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 @@ def test_check(self): 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' diff --git a/test/test_rosdep_redhat.py b/test/test_rosdep_redhat.py index 512b4672b..581910355 100644 --- a/test/test_rosdep_redhat.py +++ b/test/test_rosdep_redhat.py @@ -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(mock_method): # 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: diff --git a/test/test_rosdep_sources_list.py b/test/test_rosdep_sources_list.py index 175d409a1..e1d2a68a5 100644 --- a/test/test_rosdep_sources_list.py +++ b/test/test_rosdep_sources_list.py @@ -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