From 861430f6b8268a96d78540ac1f10d61d598abaa5 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Mon, 7 Aug 2023 11:54:43 -0600 Subject: [PATCH] Remove all generated files when cleaning docs --- noxfile.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index 1044e77..5db560a 100644 --- a/noxfile.py +++ b/noxfile.py @@ -31,11 +31,11 @@ def build_docs(session: nox.Session) -> None: @nox.session(python=False, name="clean-docs") def clean_docs(session: nox.Session) -> None: """Clean up the docs folder.""" - build_dir = ROOT / "docs" / "build" + docs_dir = ROOT / "docs" - if (build_dir / "html").is_dir(): - with session.chdir(build_dir): - shutil.rmtree("html") + if (docs_dir / "build").is_dir(): + with session.chdir(docs_dir): + shutil.rmtree("build") if (ROOT / "build").is_dir(): session.chdir(ROOT / "build") @@ -47,3 +47,5 @@ def clean_docs(session: nox.Session) -> None: def nuke(session): """Run all clean sessions.""" clean_docs(session) + if (ROOT / "__pycache__").is_dir(): + shutil.rmtree("__pycache__")