feat: add support for environment variable PIP_AUDIT_IGNORE_VULN to override the command-line option of the same name#951
Conversation
I'm okay with plural -- we don't need perfect correspondence with the flag when doing so would be confusing to users (like here with plurals) 🙂 |
|
One thing that's worth checking here is to see how the environment behaves when the user also passes options as flags: I would expect the flags to take precedence (and for the environment to be ignored), but we should confirm that argparse does that instead of something weird in |
f1d0603 to
33c2634
Compare
|
I updated the PR.
Alas, that’s not how |
…o override the command-line option of the same name
33c2634 to
96c07c5
Compare
|
I’ve opened #1007 implementing the precedence behavior discussed here. It keeps the change small and focused: Happy to adjust if a different precedence is preferred 🙂 |
Closes #948
Leaving this as a draft for now: I’ll need to add tests and documentation, but this one-liner might suffice? The value for the new environment variable would be a space separated list of vulnerabilities.
I’m a bit torn about the name: the command-line argument can be repeated so
--ignore-vuln(singular) makes sense. In contrast, the environment variable takes one or more IDs so it should bePIP_AUDIT_IGNORE_VULNS— but that would conflict with the command-line arg’s name. Thoughts?