-
Notifications
You must be signed in to change notification settings - Fork 993
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
Allow passing patterns to --update
argument
#15652
Conversation
conan/cli/args.py
Outdated
parser.add_argument("-u", "--update", action='store_true', default=False, | ||
help=update_help) | ||
|
||
parser.add_argument("-u", "--update", action="append", nargs="?", help=update_help, const=True) |
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.
const=True
does not mean that the value is const, rather, when no argument is supplied, it will append True
in this case to the list
conan/cli/args.py
Outdated
add_profiles_args(parser) | ||
|
||
|
||
def protect_update(args): |
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.
Used to check in the tests that no leftover if update:
is left, will remove before merging
--update
argument--update
argument
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 this could be useful, maybe we could add some test cases like:
conan install .. --update=zlib --update=openssl
conan install .. --update=!zlib
parser.add_argument("-u", "--update", action='store_true', default=False, | ||
help=update_help) | ||
|
||
parser.add_argument("-u", "--update", action="append", nargs="?", help=update_help, const="*") |
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 we should also update the update_help
text?
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.
Oops good catch, will do right now
Changelog: Feature: Add ability to pass patterns to
--update
flag.Docs: conan-io/docs#3587
Got bitten because I wanted to update a specific package coming from a version range on a dependency graph, but thought that it was too wasteful to have the whole graph updated which I didnt care about.
The thing that took most of the time was checking the already present --update tests
Importantly, the old syntax still works and means "update all".
This helps to reduce processing time of graph computation when you want to update only specific references
Closes #2615