-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selection of dependency types with cmd line option #727
Changes from all commits
d674078
078d1cb
c8a2a3d
9c47130
65a5221
0b9f7d3
099c46d
3f9bc89
9e2d8ad
e2b6273
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -328,7 +328,7 @@ def get_resources_that_need(self, rosdep_name): | |||||
@staticmethod | ||||||
def create_from_rospkg(rospack=None, rosstack=None, | ||||||
sources_loader=None, | ||||||
verbose=False): | ||||||
verbose=False, dependency_types=[]): | ||||||
""" | ||||||
Create :class:`RosdepLookup` based on current ROS package | ||||||
environment. | ||||||
|
@@ -339,6 +339,8 @@ def create_from_rospkg(rospack=None, rosstack=None, | |||||
instance used to crawl ROS stacks. | ||||||
:param sources_loader: (optional) Override SourcesLoader used | ||||||
for managing sources.list data sources. | ||||||
:param dependency_types: (optional) List of dependency types. | ||||||
Allowed: "build", "buildtool", "run", "test" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
It also supports build_export, exec, and doc dependencies There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these docs also link to the specification for dependency types either in catkin_pkg or the ROS REPs defining the package.xml format? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. The |
||||||
""" | ||||||
# initialize the loader | ||||||
if rospack is None: | ||||||
|
@@ -358,7 +360,7 @@ def create_from_rospkg(rospack=None, rosstack=None, | |||||
|
||||||
# Create the rospkg loader on top of the underlay | ||||||
loader = RosPkgLoader(rospack=rospack, rosstack=rosstack, | ||||||
underlay_key=underlay_key) | ||||||
underlay_key=underlay_key, dependency_types=dependency_types) | ||||||
|
||||||
# create our actual instance | ||||||
lookup = RosdepLookup(rosdep_db, loader) | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -123,16 +123,21 @@ class UsageError(Exception): | |||||||
""" | ||||||||
|
||||||||
|
||||||||
def _get_default_RosdepLookup(options): | ||||||||
_global_options = None | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This is not needed |
||||||||
|
||||||||
def _get_default_RosdepLookup(options=None): | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is better to keep this
Suggested change
|
||||||||
""" | ||||||||
Helper routine for converting command-line options into | ||||||||
appropriate RosdepLookup instance. | ||||||||
""" | ||||||||
global _global_options | ||||||||
if options is None: | ||||||||
options = _global_options | ||||||||
Comment on lines
+133
to
+135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is no longer needed
Suggested change
|
||||||||
os_override = convert_os_override_option(options.os_override) | ||||||||
sources_loader = SourcesListLoader.create_default(sources_cache_dir=options.sources_cache_dir, | ||||||||
os_override=os_override, | ||||||||
verbose=options.verbose) | ||||||||
lookup = RosdepLookup.create_from_rospkg(sources_loader=sources_loader) | ||||||||
lookup = RosdepLookup.create_from_rospkg(sources_loader=sources_loader, dependency_types=options.dependency_types) | ||||||||
lookup.verbose = options.verbose | ||||||||
return lookup | ||||||||
|
||||||||
|
@@ -295,6 +300,7 @@ def setup_environment_variables(ros_distro): | |||||||
|
||||||||
def _rosdep_main(args): | ||||||||
# sources cache dir is our local database. | ||||||||
global _global_options | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This is not needed |
||||||||
default_sources_cache = get_sources_cache_dir() | ||||||||
|
||||||||
parser = OptionParser(usage=_usage, prog='rosdep') | ||||||||
|
@@ -368,8 +374,14 @@ def _rosdep_main(args): | |||||||
help="Affects the 'update' verb. " | ||||||||
'If specified end-of-life distros are being ' | ||||||||
'fetched too.') | ||||||||
parser.add_option('-t', '--dependency-types', dest='dependency_types', | ||||||||
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 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not needed |
||||||||
if options.print_version or options.print_all_versions: | ||||||||
# First print the rosdep version. | ||||||||
print('{}'.format(__version__)) | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<package format="2"> | ||
<name>multi_dep_type_catkin_package</name> | ||
<version>0.0.0</version> | ||
<description> | ||
This is a package with depencencies of multiple types | ||
</description> | ||
<maintainer email="[email protected]">Nobody</maintainer> | ||
<license>BSD</license> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
|
||
<depend>eigen</depend> | ||
<build_depend>testboost</build_depend> | ||
<build_export_depend>testtinyxml</build_export_depend> | ||
<exec_depend>testlibtool</exec_depend> | ||
<test_depend>curl</test_depend> | ||
<doc_depend>epydoc</doc_depend> | ||
|
||
</package> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was my bad. I accidentally committed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If changes to the test runners are proposed I'd prefer them in a separate PR for ease of review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally, the tests use
nosetests
(Python 2 version). I didn't intend to propose a test runner change. I changed it locally to try some stuff and committed it unintentionally. This suggestion reverts this change.