From 30a631fabcafa7238fac34905f998e5f7bda918e Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Thu, 24 Jan 2019 08:03:34 -0800 Subject: [PATCH] evaluate conditions before collecting dependencies (#654) --- setup.py | 2 +- src/rosdep2/rospkg_loader.py | 5 ++++- stdeb.cfg | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 89fd9108a..5257b5041 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ version=__version__, # noqa:F821 packages=['rosdep2', 'rosdep2.platforms'], package_dir={'': 'src'}, - install_requires=['catkin_pkg', 'rospkg >= 1.0.37', 'rosdistro >= 0.7.0', 'PyYAML >= 3.1'], + install_requires=['catkin_pkg >= 0.4.0', 'rospkg >= 1.0.37', 'rosdistro >= 0.7.0', 'PyYAML >= 3.1'], test_suite='nose.collector', test_requires=['mock', 'nose >= 1.0'], scripts=['scripts/rosdep', 'scripts/rosdep-source'], diff --git a/src/rosdep2/rospkg_loader.py b/src/rosdep2/rospkg_loader.py index 69e3e4800..5b415675d 100644 --- a/src/rosdep2/rospkg_loader.py +++ b/src/rosdep2/rospkg_loader.py @@ -34,6 +34,8 @@ from __future__ import print_function +import os + import catkin_pkg.package import rospkg @@ -137,8 +139,9 @@ def get_rosdeps(self, resource_name, implicit=True): if resource_name in self.get_catkin_paths(): pkg = catkin_pkg.package.parse_package(self.get_catkin_paths()[resource_name]) + pkg.evaluate_conditions(os.environ) deps = pkg.build_depends + pkg.buildtool_depends + pkg.run_depends + pkg.test_depends - return [d.name for d in deps] + return [d.name for d in deps if d.evaluated_condition] elif resource_name in self.get_loadable_resources(): return self._rospack.get_rosdeps(resource_name, implicit=implicit) elif resource_name in self._rosstack.list(): diff --git a/stdeb.cfg b/stdeb.cfg index 6cd42c6d3..f11a50afa 100644 --- a/stdeb.cfg +++ b/stdeb.cfg @@ -1,6 +1,6 @@ [DEFAULT] -Depends: ca-certificates, python-rospkg (>= 1.0.37), python-yaml, python-catkin-pkg, python-rosdistro (>= 0.7.0) -Depends3: ca-certificates, python3-rospkg (>= 1.0.37), python3-yaml, python3-catkin-pkg, python3-rosdistro (>= 0.7.0) +Depends: ca-certificates, python-rospkg (>= 1.0.37), python-yaml, python-catkin-pkg (>= 0.4.0), python-rosdistro (>= 0.7.0) +Depends3: ca-certificates, python3-rospkg (>= 1.0.37), python3-yaml, python3-catkin-pkg (>= 0.4.0), python3-rosdistro (>= 0.7.0) Conflicts: python3-rosdep, python-rosdep2, python3-rosdep2 Conflicts3: python-rosdep, python-rosdep2, python3-rosdep2 Copyright-File: LICENSE