-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (66 loc) · 2.03 KB
/
Copy pathMakefile
File metadata and controls
82 lines (66 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
77
78
79
80
81
82
.DEFAULT_GOAL := help
.PHONY: help ## Display this message
help:
@grep -E \
'^.PHONY: .*?## .*$$' $(MAKEFILE_LIST) | \
sort | \
awk 'BEGIN {FS = ".PHONY: |## "}; {printf "\033[36m%-19s\033[0m %s\n", $$2, $$3}'
.PHONY: .uv
.uv:
@uv --version || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/'
.PHONY: .pre-commit
.pre-commit:
@pre-commit -V || echo 'Please install pre-commit: https://pre-commit.com/'
.PHONY: install ## Install the package, dependencies, and pre-commit for local development
install: .uv .pre-commit
uv sync --group dev
pre-commit install --install-hooks
.PHONY: clean ## Clear local caches and build artifacts
clean:
rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]'`
rm -f `find . -type f -name '*~'`
rm -rf .pytest_cache
rm -rf .ruff_cache
rm -rf .mypy_cache
rm -rf htmlcov
rm -f .coverage
rm -f .coverage.*
rm -f coverage.*
rm -f report.xml
rm -rf dist
.PHONY: fmt ## Auto-format python source files
fmt:
uv run ruff format src tests
uv run ruff check --fix src tests
.PHONY: lint ## Lint python source files
lint:
uv run ruff check src tests
uv run ruff format --check src tests
.PHONY: mypy ## Perform type-checking
mypy:
uv run mypy src tests
.PHONY: test ## Run tests and generate a coverage report
test:
uv run pytest -v --cov=src --cov-report=term-missing
.PHONY: test-integration ## Run integration tests
test-integration:
uv run pytest -v -m integration tests/integration
.PHONY: test-integration-ci ## Run integration tests in CI mode (replay only)
test-integration-ci:
uv run pytest -v -m integration --record-mode=none
.PHONY: htmlcov ## Generate html coverage report
htmlcov:
uv run pytest -v --cov=src --cov-report=html
.PHONY: all ## Run the standard set of checks performed in CI
all: lint mypy test
.PHONY: lock ## Update lockfile
lock:
uv lock
.PHONY: update ## Update dependencies
update:
uv lock --upgrade
uv sync --group dev
.PHONY: pre ## Run pre-commit on all the files in the repo
pre:
pre-commit run --all-files