From 2eef8f06a9c8be39d244a2538ebd02ad4bd79430 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 12 Dec 2022 20:38:28 -0800 Subject: [PATCH] Add a "usage" session to nox (#2022) --- CHANGELOG.md | 5 +++-- noxfile.py | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a3ad2eb8b..0a1f9ea9b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,13 +17,14 @@ The types of changes are: ## [Unreleased](https://github.com/ethyca/fides/compare/2.2.2...main) - ## [2.2.2](https://github.com/ethyca/fides/compare/2.2.1...2.2.2) ### Docs + * Updated the readme to use new new [docs site](http://docs.ethyca.com) [#2020](https://github.com/ethyca/fides/pull/2020) ### Deprecated + * The documentation site hosted in the `/docs` directory has been deprecated. All documentation updates will be hosted at the new [docs site](http://docs.ethyca.com) [#2020](https://github.com/ethyca/fides/pull/2020) ### Fixed @@ -32,12 +33,12 @@ The types of changes are: * Update connection test endpoint to be effectively non-blocking [#2000](https://github.com/ethyca/fides/pull/2000) * Update Fides connector to better handle children with no access results [#2012](https://github.com/ethyca/fides/pull/2012) - ## [2.2.1](https://github.com/ethyca/fides/compare/2.2.0...2.2.1) ### Added * Add health check indicator for data flow scanning option [#1973](https://github.com/ethyca/fides/pull/1973) +* Add a `usage` session to Nox to print full session docstrings. [#2022](https://github.com/ethyca/fides/pull/2022) ### Changed diff --git a/noxfile.py b/noxfile.py index 609296d4e7..c535aafe28 100644 --- a/noxfile.py +++ b/noxfile.py @@ -27,6 +27,23 @@ nox.options.reuse_existing_virtualenvs = True +@nox.session() +def usage(session: nox.Session) -> None: + """Prints the documentation for a nox session provided: `nox -s usage -- `.""" + + if not session.posargs: + session.error("Please provide a session name, such as `clean`") + + command = session.posargs[0] + + if not command in globals(): + session.error( + "Sorry, this isn't a valid nox session.\nExamples: `clean`, `build`, `pytest_ctl`" + ) + + session.log(globals()[command].__doc__) + + def check_for_env_file() -> None: """Create a .env file if none exists.""" env_file_example = "example.env"