From 69535f1b48c23ecb43c1dc50716baf14cf4dfe25 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Wed, 23 Jan 2019 14:17:25 -0800 Subject: [PATCH] evaluate conditions before collecting dependencies --- 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 0da73a07a2..976b44109b 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.4.0', 'PyYAML >= 3.1'], + install_requires=['catkin_pkg >= 0.4.0', 'rospkg >= 1.0.37', 'rosdistro >= 0.4.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 69e3e48006..5b415675d1 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 4ba2ce2871..be46d3f306 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.4.0) -Depends3: ca-certificates, python3-rospkg (>= 1.0.37), python3-yaml, python3-catkin-pkg, python3-rosdistro (>= 0.4.0) +Depends: ca-certificates, python-rospkg (>= 1.0.37), python-yaml, python-catkin-pkg (>= 0.4.0), python-rosdistro (>= 0.4.0) +Depends3: ca-certificates, python3-rospkg (>= 1.0.37), python3-yaml, python3-catkin-pkg (>= 0.4.0), python3-rosdistro (>= 0.4.0) Conflicts: python3-rosdep, python-rosdep2, python3-rosdep2 Conflicts3: python-rosdep, python-rosdep2, python3-rosdep2 Copyright-File: LICENSE