MCPcopy Create free account
hub / github.com/mkdocstrings/griffe / clean

Function clean

scripts/make.py:241–259  ·  view source on GitHub ↗

Delete build artifacts and cache files. ```bash make clean ``` This command simply deletes build artifacts and cache files and folders such as `build/`, `.cache/`, etc.. The virtual environments (`.venv` and `.venvs/*`) are not removed by this command.

()

Source from the content-addressed store, hash-verified

239
240@_command("clean")
241def clean() -> None:
242 """Delete build artifacts and cache files.
243
244 ```bash
245 make clean
246 ```
247
248 This command simply deletes build artifacts and cache files and folders
249 such as `build/`, `.cache/`, etc.. The virtual environments (`.venv` and `.venvs/*`)
250 are not removed by this command.
251 """
252 paths_to_clean = ["build", "dist", "htmlcov", "site", ".coverage*", ".pdm-build"]
253 for path in paths_to_clean:
254 _shell(f"rm -rf {path}")
255
256 cache_dirs = {".cache", ".pytest_cache", ".ruff_cache", "__pycache__"}
257 for dirpath in Path().rglob("*/"):
258 if dirpath.parts[0] not in (".venv", ".venvs") and dirpath.name in cache_dirs:
259 shutil.rmtree(dirpath, ignore_errors=True)
260
261
262@_command("vscode")

Callers 1

mainFunction · 0.85

Calls 1

_shellFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…