Skip to content

Commit

Permalink
Merge branch 'master' into alpine-installer
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat committed Nov 15, 2018
2 parents 08cb415 + 74e473f commit 57f1e7b
Show file tree
Hide file tree
Showing 27 changed files with 70 additions and 56 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 0 additions & 11 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 0 additions & 6 deletions .travis/shim/pip

This file was deleted.

28 changes: 28 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions doc/rosdep_doc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
]


Expand Down
2 changes: 1 addition & 1 deletion src/rosdep2/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.12.2'
__version__ = '0.13.0'
Empty file modified src/rosdep2/catkin_support.py
100755 → 100644
Empty file.
5 changes: 2 additions & 3 deletions src/rosdep2/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
Expand Down Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion src/rosdep2/platforms/arch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
Expand Down
1 change: 0 additions & 1 deletion src/rosdep2/platforms/cygwin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
Expand Down
1 change: 0 additions & 1 deletion src/rosdep2/platforms/debian.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
Expand Down
1 change: 0 additions & 1 deletion src/rosdep2/platforms/freebsd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2010, Willow Garage, Inc.
# All rights reserved.
#
Expand Down
1 change: 0 additions & 1 deletion src/rosdep2/platforms/gem.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# Copyright (c) 2012, Intermodalics, BVBA.
# All rights reserved.
Expand Down
1 change: 0 additions & 1 deletion src/rosdep2/platforms/gentoo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
Expand Down
1 change: 0 additions & 1 deletion src/rosdep2/platforms/osx.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
Expand Down
1 change: 0 additions & 1 deletion src/rosdep2/platforms/pip.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
Expand Down
9 changes: 4 additions & 5 deletions src/rosdep2/platforms/redhat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
Expand Down Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion src/rosdep2/platforms/slackware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
Expand Down
2 changes: 1 addition & 1 deletion src/rosdep2/sources_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions stdeb.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file added test/fixtures/python2cache.pickle
Binary file not shown.
Binary file added test/fixtures/python3cache.pickle
Binary file not shown.
3 changes: 2 additions & 1 deletion test/test_flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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())
6 changes: 3 additions & 3 deletions test/test_rosdep_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ 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()
override = '%s:%s' % (osd.get_name(), osd.get_codename())
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'
Expand All @@ -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'
Expand Down
16 changes: 8 additions & 8 deletions test/test_rosdep_redhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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:
Expand Down
12 changes: 12 additions & 0 deletions test/test_rosdep_sources_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 57f1e7b

Please sign in to comment.