11# Simple Makefile for use with a uv-based development environment
2+ # The at (@) prefix tells make to suppress output from the command
3+ # The hyphen (-) prefix tells make to ignore errors (e.g., if a directory doesn't exist)
4+
25.PHONY : install
36install : # # Install the virtual environment with dependencies
47 @echo " 🚀 Creating uv Python virtual environment"
@@ -48,11 +51,6 @@ build: clean-build ## Build wheel file
4851 @echo " 🚀 Creating wheel file"
4952 @uv build
5053
51- .PHONY : clean-build
52- clean-build : # # Clean build artifacts
53- @echo " 🚀 Removing build artifacts"
54- @uv run python -c " import shutil; import os; shutil.rmtree('dist') if os.path.exists('dist') else None"
55-
5654.PHONY : tag
5755tag : # # Add a Git tag and push it to origin with syntax: make tag TAG=tag_name
5856 @echo " 🚀 Creating git tag: ${TAG} "
@@ -63,7 +61,7 @@ tag: ## Add a Git tag and push it to origin with syntax: make tag TAG=tag_name
6361.PHONY : validate-tag
6462validate-tag : # # Check to make sure that a tag exists for the current HEAD and it looks like a valid version number
6563 @echo " 🚀 Validating version tag"
66- @uv run inv validatetag
64+ @uv run scripts/validate_tag.py
6765
6866.PHONY : publish-test
6967publish-test : validate-tag build # # Test publishing a release to PyPI, uses token from ~/.pypirc file.
@@ -75,6 +73,46 @@ publish: validate-tag build ## Publish a release to PyPI, uses token from ~/.pyp
7573 @echo " 🚀 Publishing."
7674 @uv run uv-publish
7775
76+ # Define variables for files/directories to clean
77+ BUILD_DIRS = build dist *.egg-info
78+ DOC_DIRS = build
79+ MYPY_DIRS = .mypy_cache dmypy.json dmypy.sock
80+ TEST_DIRS = .cache .coverage .pytest_cache htmlcov
81+
82+ .PHONY : clean-build
83+ clean-build : # # Clean build artifacts
84+ @echo " 🚀 Removing build artifacts"
85+ @uv run python -c " import shutil; import os; [shutil.rmtree(d, ignore_errors=True) for d in '$( BUILD_DIRS) '.split() if os.path.isdir(d)]"
86+
87+ .PHONY : clean-docs
88+ clean-docs : # # Clean documentation artifacts
89+ @echo " 🚀 Removing documentation artifacts"
90+ @uv run python -c " import shutil; import os; [shutil.rmtree(d, ignore_errors=True) for d in '$( DOC_DIRS) '.split() if os.path.isdir(d)]"
91+
92+ .PHONY : clean-mypy
93+ clean-mypy : # # Clean mypy artifacts
94+ @echo " 🚀 Removing mypy artifacts"
95+ @uv run python -c " import shutil; import os; [shutil.rmtree(d, ignore_errors=True) for d in '$( MYPY_DIRS) '.split() if os.path.isdir(d)]"
96+
97+ .PHONY : clean-pycache
98+ clean-pycache : # # Clean pycache artifacts
99+ @echo " 🚀 Removing pycache artifacts"
100+ @-find . -type d -name " __pycache__" -exec rm -r {} +
101+
102+ .PHONY : clean-ruff
103+ clean-ruff : # # Clean ruff artifacts
104+ @echo " 🚀 Removing ruff artifacts"
105+ @uv run ruff clean
106+
107+ .PHONY : clean-test
108+ clean-test : # # Clean test artifacts
109+ @echo " 🚀 Removing test artifacts"
110+ @uv run python -c " import shutil; import os; [shutil.rmtree(d, ignore_errors=True) for d in '$( TEST_DIRS) '.split() if os.path.isdir(d)]"
111+
112+ .PHONY : clean
113+ clean : clean-build clean-docs clean-mypy clean-pycache clean-ruff clean-test # # Clean all artifacts
114+ @echo " 🚀 Cleaned all artifacts"
115+
78116.PHONY : help
79117help :
80118 @uv run python -c " import re; \
0 commit comments