Selection of dependency types with cmd line option#727
Selection of dependency types with cmd line option#727nalt wants to merge 10 commits intoros-infrastructure:masterfrom
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. |
mateus-amarante
left a comment
There was a problem hiding this comment.
There are some problems with the last merge. The following suggestions might fix most of the problems.
|
|
||
| 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.
| 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.
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.
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.
|
|
||
| def _rosdep_main(args): | ||
| # sources cache dir is our local database. | ||
| global _global_options |
There was a problem hiding this comment.
| global _global_options |
This is not needed
| '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.
| _global_options = options |
Not needed
| :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.
| 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.
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.
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.
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.
I think it is better to keep this
| def _get_default_RosdepLookup(options=None): | |
| def _get_default_RosdepLookup(options): |
|
|
||
|
|
||
| def _get_default_RosdepLookup(options): | ||
| _global_options = None |
There was a problem hiding this comment.
| _global_options = None | |
| _global_options = None |
This is not needed
nuclearsandwich
left a comment
There was a problem hiding this comment.
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 <nalt@users.noreply.github.com> Co-authored-by: Steven! Ragnarök <steven@nuclearsandwich.com>
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.