-
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
Feature/lock upgrade #17577
base: develop2
Are you sure you want to change the base?
Feature/lock upgrade #17577
Conversation
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.
Looking good
c.run(f"export libb --version=1.1") | ||
c.run(f"export libb --version=1.2") | ||
c.run(f"export libc --version=1.1") | ||
c.run("lock upgrade . --update-requires=liba/* --update-requires=libb/[*] --update-build-requires=libc/[*]") |
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.
It would be great to check that an --update-xxx
doesn't update if the provided version or version range is not in the lockfile, and as such is not removed/unlocked.
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.
Yes! This is already being covered in this test case
https://github.com/conan-io/conan/pull/17577/files#diff-1f71b92a9bc5411618c92c12f2976cd7722225a096b9b85a1766d5fe9df533f3R429
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.
Not that case. The case when:
- The recipe
requires()
contains a version range that would accept the new versions, likerequires("libb/[*]")
- The
conan lock upgrade --update-requires=libb/[>2.0]
will not upgrade the existinglibb/1.1
, even if it is in the recipe valid range.
Co-authored-by: Abril Rincón Blanco <rubenrb@jfrog.com>
eb29a17
to
36b7aa0
Compare
else: | ||
return node.ref.matches(ref, is_consumer=None) | ||
updatable_deps = defaultdict(list) | ||
for node in expand_graph().nodes: |
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 might be a bit overkill, I'd try to leverage the existing conan lock remove
functionality.
subparser.add_argument('--update-python-requires', action="append", help='Update python-requires from lockfile') | ||
subparser.add_argument('--update-config-requires', action="append", help='Update config-requires from lockfile') | ||
subparser.add_argument('--build-require', action='store_true', default=False, help='Whether the provided reference is a build-require') | ||
subparser.add_argument('--transitives', action='store_true', default=False, help='Upgrade also transitive 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.
I'd probably drop the --transitives
argument at the moment and focus on just 1 use case to start with, start more minimalistic.
from conan.internal.model.version import Version | ||
from conan.internal.model.version_range import VersionRange |
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.
We have learned these are problematic, and we are moving away of the cli
layer importing anything else besides cli
and api
layers. So the best would be to put the required functionality directly into the api layer
Changelog: Feature: New
lock upgrade
command to automatically upgrade desired dependencies resolving the graphDocs: TODO
develop
branch, documenting this one.Fix #16636
The objective of this subcommand is to provide an easy and direct CLI interface to upgrade a (single / multiple) reference(s) in a lockfile: