1+ .PHONY : help install install-dev lint lint-fix format check test clean build upload upload-test
2+
3+ # Default target
4+ help :
5+ @echo " Available commands:"
6+ @echo " install - Install the package in editable mode"
7+ @echo " install-dev - Install the package with development dependencies"
8+ @echo " lint - Run ruff linter (check only)"
9+ @echo " lint-fix - Run ruff linter and fix errors automatically"
10+ @echo " format - Format code with ruff"
11+ @echo " check - Run all checks (lint + format check + tests)"
12+ @echo " test - Run tests with pytest"
13+ @echo " clean - Clean build artifacts and cache files"
14+ @echo " build - Build the package for distribution"
15+ @echo " upload-test - Upload package to TestPyPI"
16+ @echo " upload - Upload package to PyPI"
17+ @echo " info - Show package information"
18+
19+ # Install the package in editable mode
20+ install :
21+ uv pip install -e .
22+
23+ # Install the package with development dependencies
24+ install-dev :
25+ uv pip install -e " .[dev]"
26+
27+ # Run ruff linter (check only)
28+ lint :
29+ uv run ruff check .
30+
31+ # Run ruff linter and fix errors automatically
32+ lint-fix :
33+ uv run ruff check --fix .
34+
35+ # Format code with ruff
36+ format :
37+ uv run ruff format .
38+
39+ # Check if code is properly formatted (without making changes)
40+ format-check :
41+ uv run ruff format --check .
42+
43+ # Run all checks (lint + format check + tests)
44+ check : lint format-check test
45+
46+ # Run tests with pytest
47+ test :
48+ uv run pytest
49+
50+ # Clean build artifacts and cache files
51+ clean :
52+ rm -rf build/
53+ rm -rf dist/
54+ rm -rf * .egg-info/
55+ find . -type d -name __pycache__ -exec rm -rf {} + 2> /dev/null || true
56+ find . -type f -name " *.pyc" -delete
57+ find . -type f -name " *.pyo" -delete
58+
59+ # Build the package for distribution
60+ build : clean
61+ uv build
62+
63+ # Upload package to TestPyPI (requires TWINE_USERNAME and TWINE_PASSWORD env vars)
64+ upload-test : build
65+ uv run twine upload --repository testpypi dist/*
66+
67+ # Upload package to PyPI (requires TWINE_USERNAME and TWINE_PASSWORD env vars)
68+ upload : build
69+ uv run twine upload dist/*
70+
71+ # Install twine for package uploading (run this once before upload commands)
72+ install-twine :
73+ uv add --dev twine
0 commit comments