-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (64 loc) · 2.03 KB
/
Makefile
File metadata and controls
76 lines (64 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Variables
UV := uv
SRC_DIR := src
TEST_DIR := tests
# Targets
.PHONY: install install-dev run test clean lint typecheck format check minver help
.SILENT: minver
# Install production dependencies
install:
$(UV) sync --no-dev
# Install with development dependencies
install-dev:
$(UV) sync --extra dev
# Run the main program
run:
$(UV) run python main.py
# Check minimum Python version requirements
minver:
$(UV) run vermin --backport dataclasses --backport typing --no-parse-comments --eval-annotations .
# Run tests with pytest
test:
$(UV) run pytest
# Run linting with ruff
lint:
$(UV) run ruff check .
# Format code with ruff
format:
$(UV) run ruff format .
# Run type checking with mypy
typecheck:
$(UV) run mypy $(SRC_DIR)
# Run all checks (lint, format check, typecheck, test)
check: lint typecheck test
@echo "All checks passed!"
# Clean up Python cache files and build artifacts
clean:
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} +
find . -type d -name ".ruff_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name "build" -exec rm -rf {} +
find . -type d -name "dist" -exec rm -rf {} +
# Show help
help:
@echo "Usage: make [target]"
@echo ""
@echo "Setup targets:"
@echo " install Install production dependencies"
@echo " install-dev Install with development dependencies"
@echo ""
@echo "Development targets:"
@echo " run Run the main program"
@echo " test Run tests with pytest"
@echo " lint Run linting with ruff"
@echo " format Format code with ruff"
@echo " typecheck Run type checking with mypy"
@echo " check Run all checks (lint, typecheck, test)"
@echo " minver Check minimum Python version requirements"
@echo ""
@echo "Utility targets:"
@echo " clean Clean up cache files and build artifacts"
@echo " help Show this help message"