pypa / pip-audit

Audits Python environments, requirements files and dependency trees for known security vulnerabilities, and can automatically fix them
https://pypi.org/project/pip-audit/
Apache License 2.0
940 stars 62 forks source link

Allow environment variables to set CLI defaults #755

Closed bittner closed 1 month ago

bittner commented 3 months ago

Adds a few environment variable getters that allow to override the default value of some CLI options.

Fixes #754

bittner commented 3 months ago

@woodruffw I've not yet covered documenting the environment variables. Not sure what the best way would be to do it. A multi-line explanation in argparse.ArgumentParser(description) could be one possibility doesn't work.

woodruffw commented 3 months ago

Thanks @bittner, this looks like a great initial set!

I've not yet covered documenting the environment variables. Not sure what the best way would be to do it.

Hmm, IMO it'd be fine to document it in the README alone, i.e. under the "Usage" section in a new sub-section above the "Exit codes" one: https://github.com/pypa/pip-audit?tab=readme-ov-file#exit-codes

(A short explainer that some flags honor the environment + a bullet list of each of them would be perfect.)