Support -r flags in the pip-compile manager #28050
Replies: 4 comments 7 replies
-
I created #28052 to address scenarios (1) and (2). I'm not sure if scenario (3) is worth the effort of addressing right now. |
Beta Was this translation helpful? Give feedback.
-
I think I was thinking about this exact scenario. I believe that some cases are handled by Renovate simply detecting versions and grouping them in a PR. This is a happy accident. So I think case 2 is handled. A reproduction repository may be needed to prove that. I may be wrong, as I'm running a fork with this change. Also, this is a part of the extract function which detects if a detected input file is also matched as output/lock file. renovate/lib/modules/manager/pip-compile/extract.ts Lines 123 to 130 in e998c65 |
Beta Was this translation helpful? Give feedback.
-
I think I wrapped my head around it. I wouldn't call this idea support for This ordering of lock files is happening here: renovate/lib/modules/manager/pip-compile/utils.ts Lines 20 to 27 in e998c65 So if I have two suggestions outright:
|
Beta Was this translation helpful? Give feedback.
-
Regarding (3). For clarification. This is a case where a file falls outside scope of detected package files?
graph LR
managed.txt[[managed.txt]]
outside.in --> managed.in
managed.in --> managed.txt
|
Beta Was this translation helpful? Give feedback.
-
Tell us more.
With pip-compile it's possible to reference one requirements file from another using a
-r
flag.For example, you could have a "requirements-base.in" that looks like this:
And "requirements-extra.in" that looks like this:
When renovate updates
some-base-requirement
, the pip-compile manager needs to update both "requirements-base.txt" and "requirements-extra.txt" even though nothing change directly in "requirements-extra.in".I can see three scenarios that need to be supported:
Scenarios (1) and (2) should be easy enough to implement by simply adding the appropriate lock files to the
PackagFile.lockFiles
array for the file that got included. For the above example that would mean adding "requirements-extra.txt" to thelockFiles
array for "requirements-base.in". That way, whensome-base-requirement
gets updated in "requirements-base.in" the manager will know to update both "requirements-base.txt" and "requirements-extra.txt".Scenario (3) is a bit trickier. My first thought was to simply copy all of the dependencies from the un-managed requirements file into the
PackageFile.deps
array for the managed file, but that didn't work due to a couple of related issues:updateArtifacts
at all.Beta Was this translation helpful? Give feedback.
All reactions