Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ff5fedf
attempt to fix macos CI (#730)
wjwwood Nov 20, 2019
5af1a66
split modules into separate Debian package (#731)
dirk-thomas Nov 20, 2019
fbeb43a
0.18.0
dirk-thomas Nov 20, 2019
edb89c4
Add Suite3 option with Ubuntu Focal (#734)
sloretz Dec 30, 2019
2977726
[update] Allow to process single ROS distro, fix 723 (#738)
mikaelarguedas Jan 24, 2020
d6e5f62
Fix CI and reduce CI time (#739)
mikaelarguedas Mar 12, 2020
73dd991
Strip Alpine's patch version from OS codename (#716)
markhedleyjones Mar 12, 2020
50ee23e
improve support for null entries (#726)
mikaelarguedas Mar 27, 2020
ac0d2eb
Use DNF installer on RHEL 8 and newer (#713)
cottsay Apr 2, 2020
5a90728
Updates to YUM and DNF (#640)
cottsay Apr 2, 2020
cfa21c8
tests: don't assume euid != 0 (#703)
kyrofa Apr 2, 2020
03d8d82
openSUSE package query and install enhancements (#729)
gleichdick Apr 2, 2020
c53c951
Fix conditional dependencies when one package uses manifest.xml (#737)
sloretz Apr 3, 2020
3889bff
Guard next(inter) (#701)
artivis Apr 3, 2020
d9a6f66
[Windows] Add console script entry point (#656)
seanyen Apr 3, 2020
c1c220e
Depend on modules packages only to allow co-installability. (#750)
nuclearsandwich Apr 6, 2020
2274c08
0.19.0
nuclearsandwich Apr 3, 2020
c721d6a
also install buildtool_export_depends (#753)
mikaelarguedas Apr 7, 2020
d1784da
Drop shebang from a non-executable file (#755)
cottsay Apr 14, 2020
2667916
add alias for Pop! OS (#757)
mikaelarguedas Aug 13, 2020
078d1cb
Selection of dependency types with cmd line option
nalt Oct 28, 2019
c8a2a3d
Remove global variable + fix errors detected by the tests
mateus-amarante Oct 4, 2020
9c47130
Consider build_export_depends separately
mateus-amarante Oct 4, 2020
65a5221
Test RosdepLookup dependency_types argument
mateus-amarante Oct 4, 2020
0b9f7d3
Add support to exec and doc depends
mateus-amarante Oct 4, 2020
099c46d
Test -t option for keys()
mateus-amarante Oct 4, 2020
3f9bc89
Minor update in help message
mateus-amarante Oct 4, 2020
9e2d8ad
Merge branch 'master' into update-dep-type-option
mateus-amarante Oct 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
language: python
matrix:
include:
- os: osx
language: generic
env: PYTHON_INSTALLER=pyenv TRAVIS_PYTHON_VERSION=2.7.14
- os: osx
language: generic
env: PYTHON_INSTALLER=pyenv TRAVIS_PYTHON_VERSION=3.6.4
- os: osx
language: generic
env:
- PYTHON_INSTALLER=brew
- PIP_USER_FLAG="--user"
- os: linux
python: 2.7
- os: linux
python: 3.4
python: 3.4 # When support for 3.4 is removed unpin the PyYAML version below.
- os: linux
python: 3.5
- os: linux
python: 3.6
- os: osx
language: generic
env: PYTHON_INSTALLER=brew
- os: osx
language: generic
env: PYTHON_INSTALLER=pyenv TRAVIS_PYTHON_VERSION=2.7.14
- os: osx
language: generic
env: PYTHON_INSTALLER=pyenv TRAVIS_PYTHON_VERSION=3.6.4
- os: linux
python: 3.7
- os: linux
python: 3.8

# command to install dependencies
install:
- source .travis/install.sh
- python --version
- 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
- if [ $TRAVIS_PYTHON_VERSION == "3.4" ]; then python -m 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
- python -m pip install $PIP_USER_FLAG PyYAML argparse rospkg vcstools catkin_pkg python-dateutil rosdistro
- python -m pip install $PIP_USER_FLAG -e .
- python -m pip install $PIP_USER_FLAG nose coverage flake8 mock codecov
# command to run tests
script:
- python -m nose --with-coverage --cover-package=rosdep2 --with-xunit test
Expand Down
1 change: 1 addition & 0 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ do_install()
set -e

if [[ $TRAVIS_OS_NAME == 'osx' && $PYTHON_INSTALLER == 'pyenv' ]]; then
brew update
brew install pyenv-virtualenv
pyenv versions
eval "$(pyenv init -)"
Expand Down
42 changes: 38 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
0.17.1 (2019-10-22)
-------------------
- Warn about ROS_PYTHON_VERSION only when it is needed
- https://github.com/ros-infrastructure/rosdep/issues/725
0.19.0 (2020-04-03)
-------------------
- Only release for Python3 into focal
- https://github.com/ros-infrastructure/rosdep/pull/734
- Added --rosdistro argument to rosdep-update to scope update to one rosdistro
- https://github.com/ros-infrastructure/rosdep/pull/738
- Fixes https://github.com/ros-infrastructure/rosdep/pull/723
- Fix CI for Python 3.4 and run slower CI jobs first
- https://github.com/ros-infrastructure/rosdep/pull/739
- Strip Alpine's patch version from OS codename
- https://github.com/ros-infrastructure/rosdep/pull/716
- Fixes https://github.com/ros-infrastructure/rosdep/issues/715
- Raise a clear and specific error message for null entries
- https://github.com/ros-infrastructure/rosdep/pull/726
- Use DNF as the default installer on RHEL 8 and newer
- https://github.com/ros-infrastructure/rosdep/pull/713
- Updates to YUM and DNF handling
- https://github.com/ros-infrastructure/rosdep/pull/640
- Fix tests so they don't assume euid != 0
- https://github.com/ros-infrastructure/rosdep/pull/703
- Update openSUSE package query function and enable pip installer
- https://github.com/ros-infrastructure/rosdep/pull/729
- Fix conditional dependencies when one package uses manifest.xml
- https://github.com/ros-infrastructure/rosdep/pull/737
- Handle StopIteration when querying in debian platform
- https://github.com/ros-infrastructure/rosdep/pull/701
- Use entry points rather than console scripts to enable usage on Windows
- https://github.com/ros-infrastructure/rosdep/pull/656
- Depend on modules packages only to allow modules packages to be co-installable.
- https://github.com/ros-infrastructure/rosdep/pull/750


0.18.0 (2019-11-20)
-------------------
- split -modules into separate Debian package
- https://github.com/ros-infrastructure/rosdep/pull/731
- fix macOS CI
- https://github.com/ros-infrastructure/rosdep/pull/730

0.17.0 (2019-10-18)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ testsetup:
echo "running rosdep tests"

test: testsetup
nosetests --with-coverage --cover-package=rosdep2 --with-xunit test
nosetests3 --with-coverage --cover-package=rosdep2 --with-xunit test
3 changes: 2 additions & 1 deletion doc/rosdep_yaml_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ OS name identifiers and supported package managers

* ``fedora``: Fedora Project

* ``yum`` (default)
* ``dnf`` (default)
* ``yum``
* ``source``

* ``freebsd``: FreeBSD
Expand Down
4 changes: 0 additions & 4 deletions scripts/rosdep

This file was deleted.

56 changes: 35 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
import os
from setuptools import setup

exec(open(os.path.join(os.path.dirname(__file__), 'src', 'rosdep2', '_version.py')).read())

setup(
name='rosdep',
version=__version__, # noqa:F821
packages=['rosdep2', 'rosdep2.ament_packages', 'rosdep2.platforms'],
package_dir={'': 'src'},
install_requires=['catkin_pkg >= 0.4.0', 'rospkg >= 1.1.10', 'rosdistro >= 0.7.5', 'PyYAML >= 3.1'],
test_suite='nose.collector',
test_requires=['mock', 'nose >= 1.0'],
scripts=['scripts/rosdep', 'scripts/rosdep-source'],
author='Tully Foote, Ken Conley',
author_email='tfoote@osrfoundation.org',
url='http://wiki.ros.org/rosdep',
keywords=['ROS'],
classifiers=[
kwargs = {
'name': 'rosdep',
# same version as in:
# - src/rosdep2/__init__.py
# - stdeb.cfg
'version': '0.19.0',
'packages': ['rosdep2', 'rosdep2.ament_packages', 'rosdep2.platforms'],
'package_dir': {'': 'src'},
'install_requires': ['catkin_pkg >= 0.4.0', 'rospkg >= 1.2.7', 'rosdistro >= 0.7.5', 'PyYAML >= 3.1'],
'test_suite': 'nose.collector',
'test_requires': ['mock', 'nose >= 1.0'],
'author': 'Tully Foote, Ken Conley',
'author_email': 'tfoote@osrfoundation.org',
'url': 'http://wiki.ros.org/rosdep',
'keywords': ['ROS'],
'entry_points': {
'console_scripts': [
'rosdep = rosdep2.main:rosdep_main',
'rosdep-source = rosdep2.install:install_main'
]
},
'classifiers': [
'Programming Language :: Python',
'License :: OSI Approved :: BSD License'],
description='rosdep package manager abstraction tool for ROS',
long_description='Command-line tool for installing system '
'dependencies on a variety of platforms.',
license='BSD'
)
'description': 'rosdep package manager abstraction tool for ROS',
'long_description': 'Command-line tool for installing system '
'dependencies on a variety of platforms.',
'license': 'BSD',
}
if 'SKIP_PYTHON_MODULES' in os.environ:
kwargs['packages'] = []
kwargs['package_dir'] = {}
if 'SKIP_PYTHON_SCRIPTS' in os.environ:
kwargs['name'] += '_modules'
kwargs['entry_points'] = {}

setup(**kwargs)
5 changes: 4 additions & 1 deletion src/rosdep2/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
__version__ = '0.17.1'
# same version as in:
# - setup.py
# - stdeb.cfg
__version__ = '0.19.0'
11 changes: 3 additions & 8 deletions scripts/rosdep-source → src/rosdep2/install.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
Expand Down Expand Up @@ -39,7 +38,7 @@
from rosdep2 import InstallFailed
from rosdep2.platforms import source

NAME='rosdep-source'
NAME = 'rosdep-source'


def install_main():
Expand All @@ -49,16 +48,12 @@ def install_main():
parser.error("please specify one and only one rdmanifest url")
if args[0] != 'install':
parser.error("currently only support the 'install' command")
rdmanifest_url= args[1]
rdmanifest_url = args[1]
try:
if os.path.isfile(rdmanifest_url):
source.install_from_file(rdmanifest_url)
else:
source.install_from_url(rdmanifest_url)
except InstallFailed as e:
print("ERROR: installation failed:\n%s"%e, file=sys.stderr)
print("ERROR: installation failed:\n%s" % e, file=sys.stderr)
sys.exit(1)


if __name__ == '__main__':
install_main()
5 changes: 4 additions & 1 deletion src/rosdep2/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ def get_rule_for_platform(self, os_name, os_version, installer_keys, default_ins
return_key = installer_key
break

# Check if the rule is null
if data is None:
raise ResolutionError(rosdep_key, self.data, os_name, os_version, '[%s] defined as "not available" for OS version [%s]' % (rosdep_key, os_version))
if type(data) not in (dict, list, type('str')):
raise InvalidData('rosdep OS definition for [%s:%s] must be a dictionary, string, or list: %s' % (self.rosdep_key, os_name, data), origin=self.origin)

Expand Down Expand Up @@ -171,7 +174,7 @@ def __str__(self):
\trosdep key : %s
\tOS name : %s
\tOS version : %s
\tData: %s""" % (self.args[0], self.rosdep_key, self.os_name, self.os_version, pretty_data)
\tData:\n%s""" % (self.args[0], self.rosdep_key, self.os_name, self.os_version, pretty_data.replace('\n', '\n\t\t'))


class RosdepView(object):
Expand Down
20 changes: 13 additions & 7 deletions src/rosdep2/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def setup_environment_variables(ros_distro):
"""
Set environment variables needed to find ROS packages and evaluate conditional dependencies.

:param rosdistro: The requested ROS distro passed on the CLI, or None
:param ros_distro: The requested ROS distro passed on the CLI, or None
"""
if ros_distro is not None:
if 'ROS_DISTRO' in os.environ and os.environ['ROS_DISTRO'] != ros_distro:
Expand Down Expand Up @@ -361,7 +361,9 @@ def _rosdep_main(args):
parser.add_option('--rosdistro', dest='ros_distro', default=None,
help='Explicitly sets the ROS distro to use, overriding '
'the normal method of detecting the ROS distro '
'using the ROS_DISTRO environment variable.')
'using the ROS_DISTRO environment variable. '
"When used with the 'update' verb, "
'only the specified distro will be updated.')
parser.add_option('--as-root', default=[], action='append',
metavar='INSTALLER_KEY:<bool>', help='Override '
'whether sudo is used for a specific installer, '
Expand All @@ -373,10 +375,10 @@ def _rosdep_main(args):
'If specified end-of-life distros are being '
'fetched too.')
parser.add_option('-t', '--dependency-types', dest='dependency_types',
type="choice", choices=("build", "buildtool", "run", "test"),
default=[], action='append',
help='Dependency types to install, can be given multiple times. '
'Chose from build, buildtool, run, test. Default: all.')
type="choice", choices=("build", "buildtool", "build_export", "exec", "run", "test", "doc"),
default=[], action='append',
help='Dependency types to install, can be given multiple times. '
'Chose from build, buildtool, build_export, exec, run, test, doc. Default: all except doc.')

options, args = parser.parse_args(args)
_global_options = options
Expand Down Expand Up @@ -655,14 +657,18 @@ def update_error_handler(data_source, exc):
pass
update_sources_list(success_handler=update_success_handler,
error_handler=update_error_handler,
skip_eol_distros=not options.include_eol_distros)
skip_eol_distros=not options.include_eol_distros,
ros_distro=options.ros_distro)
print('updated cache in %s' % (sources_cache_dir))
except InvalidData as e:
print('ERROR: invalid sources list file:\n\t%s' % (e), file=sys.stderr)
return 1
except IOError as e:
print('ERROR: error loading sources list:\n\t%s' % (e), file=sys.stderr)
return 1
except ValueError as e:
print('ERROR: invalid argument value provided:\n\t%s' % (e), file=sys.stderr)
return 1
if error_occured:
print('ERROR: Not all sources were able to be updated.\n[[[')
for e in error_occured:
Expand Down
1 change: 1 addition & 0 deletions src/rosdep2/platforms/alpine.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def register_platforms(context):
context.add_os_installer_key(OS_ALPINE, PIP_INSTALLER)
context.add_os_installer_key(OS_ALPINE, SOURCE_INSTALLER)
context.set_default_os_installer_key(OS_ALPINE, lambda self: APK_INSTALLER)
context.set_os_version_type(OS_ALPINE, lambda self: ".".join(self.get_version().split('.')[:2]))


def apk_detect(pkgs, exec_fn=read_stdout):
Expand Down
47 changes: 39 additions & 8 deletions src/rosdep2/platforms/debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@
import subprocess
import sys

from rospkg.os_detect import OS_DEBIAN, OS_LINARO, OS_UBUNTU, OS_ELEMENTARY, OS_MX, OsDetect, read_os_release

from rospkg.os_detect import (
OS_DEBIAN,
OS_LINARO,
OS_UBUNTU,
OS_ELEMENTARY,
OS_MX,
OS_POP,
OsDetect,
read_os_release
)
from .pip import PIP_INSTALLER
from .gem import GEM_INSTALLER
from .source import SOURCE_INSTALLER
Expand All @@ -55,6 +63,7 @@ def register_platforms(context):
register_elementary(context)
register_linaro(context)
register_mx(context)
register_pop(context)


def register_debian(context):
Expand Down Expand Up @@ -98,6 +107,16 @@ def register_mx(context):
context.set_os_override(OS_DEBIAN, version[version.find("(") + 1:version.find(")")])


def register_pop(context):
# Pop! OS is an alias for Ubuntu. If Pop! is detected and it's
# not set as an override force ubuntu.
(os_name, os_version) = context.get_os_name_and_version()
if os_name == OS_POP and not context.os_override:
print('rosdep detected OS: [%s] aliasing it to: [%s]' %
(OS_POP, OS_UBUNTU), file=sys.stderr)
context.set_os_override(OS_UBUNTU, context.os_detect.get_codename())


def register_ubuntu(context):
context.add_os_installer_key(OS_UBUNTU, APT_INSTALLER)
context.add_os_installer_key(OS_UBUNTU, PIP_INSTALLER)
Expand Down Expand Up @@ -140,20 +159,32 @@ def _read_apt_cache_showpkg(packages, exec_fn=None):

header = 'Package: %s' % p
# proceed to Package header
while next(lines) != header:
try:
while next(lines) != header:
pass
except StopIteration:
pass

# proceed to versions section
while next(lines) != 'Versions: ':
try:
while next(lines) != 'Versions: ':
pass
except StopIteration:
pass

# virtual packages don't have versions
if next(lines) != '':
yield p, False, None
continue
try:
if next(lines) != '':
yield p, False, None
continue
except StopIteration:
break

# proceed to reserve provides section
while next(lines) != 'Reverse Provides: ':
try:
while next(lines) != 'Reverse Provides: ':
pass
except StopIteration:
pass

pr = [line.split(' ', 2)[0] for line in lines]
Expand Down
Loading