Skip to content

Commit

Permalink
evaluate conditions before collecting dependencies (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas authored and nuclearsandwich committed Jan 24, 2019
1 parent 3e3dadd commit 30a631f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
5 changes: 4 additions & 1 deletion src/rosdep2/rospkg_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

from __future__ import print_function

import os

import catkin_pkg.package
import rospkg

Expand Down Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions stdeb.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 30a631f

Please sign in to comment.