mirror of
https://github.com/copier-org/copier.git
synced 2025-05-05 15:32:54 +00:00
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
31 lines
763 B
Python
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()
|