Skip to content

Conversation

Flamefire
Copy link
Contributor

It might be necessary to disable dependency resolution from the commandline.
E.g. when it is enabled in the configfile and we want to upload a single
file via --new-pr.
Add new cmdline action store_or_False to generically add support for
--disable-<name> for such cases.

Closes #4780

We set the `store_or` attribute a few lines above and verify it already.
It might be necessary to disable dependency resolution from the commandline.
E.g. when it is enabled in the configfile and we want to upload a single
file via `--new-pr`.
Add new cmdline action `store_or_False` to generically add support for
`--disable-<name>` for such cases.
There is no error raised for dry-run anymore so check the output.
This is due to a change in easybuilders#4704 that disables resolving dependencies
for --dry-run without --robot
@@ -232,7 +235,9 @@ def store_or(option, opt_str, value, parser, *args, **kwargs): # pylint: disabl
"""Callback for supporting options with optional values."""
# see http://stackoverflow.com/questions/1229146/parsing-empty-options-in-python
# ugly code, optparse is crap
if parser.rargs and not parser.rargs[0].startswith('-'):
if option.store_or == self.STORE_OR_FALSE and opt_str.startswith("--%s-" % self.DISABLE):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd part of this condition feels very hard-codey...

Is that also how we can for disabling of regular boolean options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is basically copied verbatim from

if opt.startswith("--%s-" % self.ENABLE):
# keep action
pass
elif opt.startswith("--%s-" % self.DISABLE):

@boegel boegel modified the milestones: 5.x, 5.x.x Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow disabling --robot
2 participants