Skip to content

Conversation

jenstroeger
Copy link

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 be PIP_AUDIT_IGNORE_VULNS — but that would conflict with the command-line arg’s name. Thoughts?

@woodruffw
Copy link
Member

In contrast, the environment variable takes one or more IDs so it should be PIP_AUDIT_IGNORE_VULNS — but that would conflict with the command-line arg’s name. Thoughts?

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) 🙂

@woodruffw
Copy link
Member

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 append mode.

@jenstroeger jenstroeger force-pushed the add-env-variable-for-ignore-vuln branch from f1d0603 to 33c2634 Compare October 4, 2025 05:20
@jenstroeger
Copy link
Author

jenstroeger commented Oct 4, 2025

I updated the PR.

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 append mode.

Alas, that’s not how append behaves: the command line args are appended to the default list provided by the environment variable (docs). If that’s ok then I think it ought to be documented properly, or else if we want to change that behavior then we’d add a custom Action to change append’s default behavior or expand the code itself a bit after the args have been parsed. What’s your desired command-line args behavior here?

…o override the command-line option of the same name
@jenstroeger jenstroeger force-pushed the add-env-variable-for-ignore-vuln branch from 33c2634 to 96c07c5 Compare October 15, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: new environment variable PIP_AUDIT_IGNORE_VULN

2 participants