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): support env var interpolation #6648
feat(pip): support env var interpolation #6648
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.
Need test fixes
As of Pip v10+, environment variables are supported in requirements.txt files and will be automatically interpolated. This changeset allows Renovate to parse registry URLs conforming to that syntax properly and follow the same approach, eg. by interpolating the environment variables in the same way as would pip. Note that interpolating env vars is hidden behind the trustLevel=high flag, as described in the Renovate docs: https://github.com/renovatebot/renovate/blob/d70b8c1f2fa999be9684a8ca5da3dda8cd2392ab/docs/usage/self-hosted-configuration.md#trustlevel Additionally, we unconditionally strip `"` characters from the same registryUrls as those are optional in the pip spec (with no behavioural impact) but cause lookup errors for Renovate.
@viceice sorry about that, should have opened this as a draft. Now ready for review! |
describe('lib/manager/pip_requirements/extract', () => { | ||
delete process.env.PIP_TEST_TOKEN; |
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.
Move that into before each please. We should also remove it after each test to be sure it would not interfere any other tests in future.
Same for trustLevel.
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.
Sure thing, done. FYI, I copied this construct from lib/datasource/npm/index.spec.ts, which you might want to update in the same way.
🎉 This PR is included in version 21.24.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
As of Pip v10+, environment variables are supported in requirements.txt
files and will be automatically interpolated. This changeset allows
Renovate to parse registry URLs conforming to that syntax properly and
follow the same approach, eg. by interpolating the environment variables
in the same way as would pip.
Note that interpolating env vars is hidden behind the trustLevel=high
flag, as described in the Renovate docs: https://github.com/renovatebot/renovate/blob/d70b8c1f2fa999be9684a8ca5da3dda8cd2392ab/docs/usage/self-hosted-configuration.md#trustlevel
Additionally, we unconditionally strip
"
characters from the sameregistryUrls as those are optional in the pip spec (with no behavioural
impact) but cause lookup errors for Renovate.