-
Notifications
You must be signed in to change notification settings - Fork 101
/
Makefile
50 lines (38 loc) · 1.17 KB
/
Makefile
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
# Adapted from https://github.com/pydantic/logfire/blob/main/Makefile
.DEFAULT_GOAL := all
.PHONY: .uv # Check that uv is installed
.uv:
@uv --version || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/'
.PHONY: .pre-commit # Check that pre-commit is installed
.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 --frozen
pre-commit install --install-hooks
.PHONY: format # Format the code
format:
uv run ruff format
uv run ruff check --fix
.PHONY: lint # Lint the code
lint:
uv run ruff check
uv run ruff format --check --diff
.PHONY: typecheck # Typecheck the code
typecheck:
uv run mypy .
.PHONY: test # Run the tests
test:
uv run pytest -vv
.PHONY: testcov # Run tests and generate a coverage report
testcov: test
@echo "building coverage html"
uv run coverage html --show-contexts
.PHONY: docs # Build the documentation
docs:
uv run mkdocs build
.PHONY: docs-serve # Build and serve the documentation
docs-serve:
uv run mkdocs serve
.PHONY: all
all: format lint test