-
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
Conversation
Question for other rosdep contributors and maintainer: An approach similar to this one was proposed in #646 (comment) with a slightly different interface. Does anyone have a preference between the two and if so for which one and why? |
@nuclearsandwich: you are essentially asking whether ppl would have a preference for:
or:
right? |
Side remark: On this question there is precedent for offering both options at the same time in rosdep: Lines 404 to 406 in c1c220e
|
IMO, inputs separated by spaces are bit friendlier to work with in scripts and pipes using the CLI. |
Btw this is also the only way supported by |
Just chiming in that I'm very excited about this feature. |
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-noetic-ninjemys-release/14262/9 |
This seems to have stalled a bit -- any particular reason, or can we revive it? |
Rebase + improvements for ros-infrastructure#727
Should this have been closed by that PR? Seems like this is probably still open until merged into upstream here |
Getting this merged would make using multi-stage Docker builds finally really scalable (no more manual runtime dependency management 🎉). What's the major blocker? |
At this point it's review time. I'll schedule it for next week and try my best to meet that appointment. |
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.
There are some problems with the last merge. The following suggestions might fix most of the problems.
@@ -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 |
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.
nosetests3 --with-coverage --cover-package=rosdep2 --with-xunit test | |
nosetests --with-coverage --cover-package=rosdep2 --with-xunit test |
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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
global _global_options |
This is not needed
|
||
options, args = parser.parse_args(args) | ||
_global_options = options |
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.
_global_options = options |
Not needed
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Allowed: "build", "buildtool", "run", "test" | |
Allowed: "build", "buildtool", "build_export", "run", "test", "exec", "doc" |
It also supports build_export, exec, and doc dependencies
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. The doc_depend
seems to be introduced only in format 2 ( REP127, schema files ), so maybe it is better not to consider it.
global _global_options | ||
if options is None: | ||
options = _global_options |
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.
This is no longer needed
global _global_options | |
if options is None: | |
options = _global_options |
def _get_default_RosdepLookup(options): | ||
_global_options = None | ||
|
||
def _get_default_RosdepLookup(options=None): |
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.
I think it is better to keep this
def _get_default_RosdepLookup(options=None): | |
def _get_default_RosdepLookup(options): |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
_global_options = None | |
_global_options = None |
This is not needed
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.
Overall these changes are looking promising. Thank you very much for adding tests along with this new feature.
I generally agree with the review suggestions from @mateus-amarante, would you have the opportunity to respond to that feedback before another round of review?
@nuclearsandwich, if you agree, I can create a new PR from my fork, so that I can finish the updates and you can do another review. I'm very interested in this feature, so I will be committed to fixing any problem pointed out. |
Please go ahead! |
@nuclearsandwich i think we can close this PR, #789 is looking good (and could use maintainer review :)) |
Replaced by #789 |
#789) Co-authored-by: Nicolas Alt <[email protected]> Co-authored-by: Steven! Ragnarök <[email protected]>
Select dependency types (build, buildtool, run, test) to install with --dependency-types. can be given multiple. Standard behaviour (all types) unchanged.
In rospack.py, a fake and empty options object was created for the call to _get_default_RosdepLookup. This was replaced by a similarly hacky global object for command line options.