Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (50 loc) · 1.5 KB
/
Copy pathMakefile
File metadata and controls
62 lines (50 loc) · 1.5 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
.PHONY: install install-dev test test-cov lint format run-dev update-postcodes clean help
# Install dependencies (normal packages only)
install:
uv sync
# Install dependencies (including dev packages)
install-dev:
uv sync --dev
# Run tests
test:
uv run pytest tests/
# Run tests with coverage
test-cov:
uv run coverage run -m pytest tests/
uv run coverage report
uv run coverage xml -o coverage.xml
# Lint code
lint:
uv run ruff check .
uv run ruff format --check .
# Format code
format:
uv run ruff check --fix .
uv run ruff format .
# Run development server
run-dev:
uv run fastapi dev app/main.py --port 8000
# Update postcode data files
update-postcodes:
uv run python scripts/update_postcodes.py
# Clean up cache files
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name ".coverage" -delete
rm -rf .pytest_cache
rm -rf .ruff_cache
rm -f coverage.xml
# Help
help:
@echo "Available commands:"
@echo " install - Install dependencies (normal packages only)"
@echo " install-dev - Install dependencies (including dev packages)"
@echo " test - Run tests"
@echo " test-cov - Run tests with coverage"
@echo " lint - Lint code"
@echo " format - Format code"
@echo " run-dev - Run development server"
@echo " update-postcodes - Download and process latest postcode data"
@echo " clean - Clean up cache files"