-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(manager/pip-compile): Support -r dependencies between files #28052
Conversation
Pip-compile supports including other requirements files via the -r flag. The pip_requirements manager already extracts those flags, but this adds logic to the pip-compile manager to make sure dependent files' lock files get updated when a package is updated in a file that is included via a -r directive.
Each lock file can only be associated with a single PackageFile at the point that the lockFileSources map is built
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.
otherwise LGTM
Co-authored-by: Michael Kriese <[email protected]>
Co-authored-by: Michael Kriese <[email protected]>
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.
new comments
🎉 This PR is included in version 37.276.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
); | ||
continue; | ||
} | ||
sourceFile.lockFiles!.push(...packageFile.lockFiles!); |
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.
What if a lock file is duplicated across package files before this operation?
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.
Hmm, I suppose that could cause a problem with something like this
graph LR
a.in --> b.in
a.in --> c.in
b.in --> d.in
c.in --> d.in
In that case a.in
's lockFiles
would be ["a.txt", "b.txt", "d.txt", "c.txt", "d.txt"]
and Renovate would end up running
pip-compile a.in
pip-compile b.in
pip-compile d.in
pip-compile c.in
pip-compile d.in
Where the first instance of pip-compile d.in
would likely fail since b.txt
and c.txt
could ask for different versions of a newly-updated package.
I'll look into fixing that on Monday.
…ovatebot#28052) Co-authored-by: Michael Kriese <[email protected]>
Changes
Pip-compile supports including other requirements files via the
-r
flag. The pip_requirements manager already extracts those flags, but this adds logic to the pip-compile manager to make sure dependent files' lock files get updated when a package is updated in a file that is included via a-r
directive.Note that this does not support including requirements files that aren't managed by pip-compile via
-r
directives. While doing so won't break anything, the lock files won't get updated when the pip_requirements manager updates a dependency. They will get updated later as part of the next lock file maintenance.Context
#28050
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: