-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(pip_requirements): Extract flags from package files with no deps #28961
feat(pip_requirements): Extract flags from package files with no deps #28961
Conversation
The pip_requirements manager is used by the pip-compile manager for extracting info from requirements.in files. This change makes pip_requirements return any flags it extracted from its input file even if there are no dependencies in the file. This allows a user to provide a requirements.in file with nothing but `--extra-index-url` flags as a second input file when using pip-compile to compile dependencies in a setup.py file so that Renovate can look those index URLs up in its `hostRules` and pass appropriate credentials to pip-compile.
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 would prefer to extract a new function which always returns the results and leave this function as is.
all managers should return null when no deps are extracted.
There are cases where we return the package file even with no deps (e.g. when it's the root npm package in workspaces) |
If this only concerns pip-compile manager, maybe it should handle this edge-case? Also, maybe extract function can have an optional flag to always return a package file object. A flag only used by pip-compile extract function. But this changes the interface. |
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.
🤷♂️
🎉 This PR is included in version 37.358.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Changes
The pip_requirements manager is used by the pip-compile manager for extracting info from requirements.in files. This change makes pip_requirements return any flags it extracted from its input file even if there are no dependencies in the file. This allows a user to provide a requirements.in file with nothing but
--extra-index-url
flags as a second input file when using pip-compile to compile dependencies in a setup.py file so that Renovate can look those index URLs up in itshostRules
and pass appropriate credentials to pip-compile.Context
#28960
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: