copier/devtasks.py
Nat Noordanus d949d51ad3 Replace makefile with poe tasks & update CONTRIBUTING.md
The new `[tool.poe.tasks]` section and new poetry based workflow are a complete
replacement for the makefile which has also been removed. #129

Also:
- add devtasks for python functions to be referenced as poe tasks
- update CONTRIBUTING.MD #154 to keep things coherent
  - remove reference to tox
- update ci to work with more expressive toml syntax (upgrade pip)
  - and use poe tasks in ci
2020-08-21 14:02:49 +01:00

31 lines
763 B
Python

import shutil
from pathlib import Path
def clean():
"""
Clean build, test or other process artefacrts from the project workspace
"""
build_artefacts = (
"build/",
"dist/",
"*.egg-info",
"pip-wheel-metadata",
)
python_artefacts = (
".pytest_cache",
"htmlcov",
".coverage",
"**/__pycache__",
"**/*.pyc",
"**/*.pyo",
)
project_dir = Path(".").resolve()
for pattern in build_artefacts + python_artefacts:
for matching_path in project_dir.glob(pattern):
print(f"Deleting {matching_path}")
if matching_path.is_dir():
shutil.rmtree(matching_path)
else:
matching_path.unlink()