-
Notifications
You must be signed in to change notification settings - Fork 178
Add support for wildcard OS name #838
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -189,7 +189,7 @@ def test_RosdepDefinition(): | |
| except ResolutionError as e: | ||
| assert e.rosdep_key == 'trusty_only_key' | ||
| assert e.os_name == 'ubuntu' | ||
| assert e.os_version == '*' | ||
| assert e.os_version == 'lucid' | ||
|
Member
Author
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. Note that this is a change in the existing behavior, but this pattern doesn't appear anywhere in the rosdep database right now.
Contributor
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.
We don't have anything that fits this exactly but I think any situation where we use the combination of an os_version wildcard with specific Am I right in thinking that this behavior change is due to 91cf3a1 which preserved the originally requested os_name and os_version?
Member
Author
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.
Correct. However, if you follow the code, the foo:
debian:
'*': null
sid: [bar]This syntax is somewhat redundant, and causes rosdep's resolution error message to change, but not the exception type. When last I surveyed we had no occurrences of An OS-level EDIT: It looks like @clalancette requested the explicit So 91cf3a1 will then result in a change/improvement to the error message for the the latter two PRs. |
||
| # tripwire | ||
| str(e) | ||
| try: | ||
|
|
@@ -202,6 +202,41 @@ def test_RosdepDefinition(): | |
| # tripwire | ||
| str(e) | ||
|
|
||
| definition = RosdepDefinition('invalid_os_wildcard', {'*': ['pytest']}, 'os_wildcard.txt') | ||
| try: | ||
| val = definition.get_rule_for_platform('debian', 'sid', ['apt', 'source', 'pip'], 'apt') | ||
| assert False, 'should have raised: %s' % (str(val)) | ||
| except InvalidData: | ||
| pass | ||
|
|
||
| definition = RosdepDefinition('non_debian_key', {'debian': None, '*': {'pip': ['pytest']}}, 'os_wildcard.txt') | ||
| try: | ||
| val = definition.get_rule_for_platform('debian', 'sid', ['apt', 'source', 'pip'], 'apt') | ||
| assert False, 'should have raised: %s' % (str(val)) | ||
| except ResolutionError as e: | ||
| assert e.rosdep_key == 'non_debian_key' | ||
| assert e.os_name == 'debian' | ||
| assert e.os_version == 'sid' | ||
| # tripwire | ||
| str(e) | ||
|
|
||
| # package manager not supported | ||
| try: | ||
| val = definition.get_rule_for_platform('ubuntu', 'precise', ['apt', 'source'], 'apt') | ||
| assert False, 'should have raised: %s' % (str(val)) | ||
| except ResolutionError as e: | ||
| assert e.rosdep_key == 'non_debian_key' | ||
| assert e.os_name == 'ubuntu' | ||
| assert e.os_version == 'precise' | ||
| # tripwire | ||
| str(e) | ||
|
|
||
| val = definition.get_rule_for_platform('ubuntu', 'precise', ['apt', 'source', 'pip'], 'apt') | ||
| assert val == ('pip', ['pytest']), val | ||
|
|
||
| val = definition.get_rule_for_platform('fedora', '35', ['dnf', 'source', 'pip'], 'dnf') | ||
| assert val == ('pip', ['pytest']), val | ||
|
|
||
| # test reverse merging OS things (first is default) | ||
| definition = RosdepDefinition('test', {'debian': 'libtest-dev'}, 'fake-1.txt') | ||
| # rule should work as expected before reverse-merge | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.