From b0f2615c8dbcf7a8ce6e0d1207889ea8795e597d Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 3 Dec 2021 12:28:17 -0500 Subject: [PATCH] Add a module entrypoint (#173) * pip_audit: add __main__.py * README: document entrypoints * CHANGELOG: record changes * __main__: mark entrypoint as `no cover` --- CHANGELOG.md | 5 +++++ README.md | 7 +++++++ pip_audit/__main__.py | 8 ++++++++ 3 files changed, 20 insertions(+) create mode 100644 pip_audit/__main__.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f93ecb0..b1b7bfc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,11 @@ All versions prior to 0.0.9 are untracked. when `pip-audit` is invoked in environment mode ([#148](https://github.com/trailofbits/pip-audit/pull/148)) +* CLI: The `pip-audit` CLI can now be accessed through `python -m pip_audit`. + All functionality is identical to the functionality provided by the + `pip-audit` entrypoint + ([#173](https://github.com/trailofbits/pip-audit/pull/173)) + ### Changed ### Fixed diff --git a/README.md b/README.md index df9207da..4a0a6128 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,13 @@ python -m pip install pip-audit ## Usage +You can run `pip-audit` as a standalone program, or via `python -m`: + +```bash +pip-audit --help +python -m pip_audit --help +``` + ``` usage: pip-audit [-h] [-V] [-l] [-r REQUIREMENTS] [-f FORMAT] [-s SERVICE] diff --git a/pip_audit/__main__.py b/pip_audit/__main__.py new file mode 100644 index 00000000..1feb0dad --- /dev/null +++ b/pip_audit/__main__.py @@ -0,0 +1,8 @@ +""" +The `python -m pip_audit` entrypoint. +""" + +if __name__ == "__main__": # pragma: no cover + from pip_audit._cli import audit + + audit()