-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
pdm export support env variables in credentials #1939
Comments
Fixes #1939 Signed-off-by: Frost Ming <me@frostming.com>
Hi @frostming I wonder what was the resolution of this issue, if I read the commit correctly, you consider it was actually a bug and from now on by default, we are going to have env vars in requirements. Am I correct? |
Yes, I think preserving the env vars make more sense. And the variable substitution is also supported by It may be a little breaking change but I think people writing variables in their source settings can expect it. |
Wouldn't it make sense to keep a runtime option to force the variable expansion? |
@frostming you said:
Can you point out this in any documentation? As far as I can tell, pypa/pip#4789 is still open... 🤔 |
@berislavlopac You are confusing two different requirements. pip has always supported using environment variables in requirementst.txt(since 10.0): https://pip.pypa.io/en/stable/reference/requirements-file-format/#using-environment-variables While the issue you linked to is asking for env expansion in |
Thank you @frostming. How about this question?
|
Is your feature request related to a problem? Please describe.
Pipelines sometimes work with generated requirements.txt as backward compatibility, if one uses a different index like this:
and PDM_USERNAME (example: john) / PDM_PASSWORD (example: password123) is set,
and runs pdm export like this:
the resulting requirements file will have a username and password in plaintext:
Describe the solution you'd like
PIP allows to use env variables that are expanded at runtime: https://pip.pypa.io/en/stable/reference/requirements-file-format/#using-environment-variables
My proposal would be to add a switch
--no-env-expansion
(please suggest a better name) that will generate an export file but with an env notation that pip likes, example:The text was updated successfully, but these errors were encountered: