Skip to content

Instantly share code, notes, and snippets.

@eddy-22
Created May 10, 2023 05:44
Show Gist options
  • Save eddy-22/6b82457cb67564c0b12963a2a54a5a6d to your computer and use it in GitHub Desktop.
Save eddy-22/6b82457cb67564c0b12963a2a54a5a6d to your computer and use it in GitHub Desktop.
Example Makefile or Justfile rules for cleaning Python projects
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment