forked from pydantic/logfire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (43 loc) · 1.35 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
51
52
53
54
.DEFAULT_GOAL := all
sources = pydantic tests docs/plugins
.PHONY: .rye # Check that Rye is installed
.rye:
@rye --version || echo 'Please install Rye: https://rye-up.com/guide/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: .rye .pre-commit
rye show
rye sync
pre-commit install --install-hooks
.PHONY: format # Format the code
format:
rye format
rye lint --fix
.PHONY: lint # Lint the code
lint:
rye lint
rye format --check
.PHONY: test # Run the tests
test:
rye run coverage run -m pytest
.PHONY: testcov # Run tests and generate a coverage report
testcov: test
@echo "building coverage html"
@rye run coverage html --show-contexts
.PHONY: docs # Build the documentation
docs:
rye run docs
.PHONY: docs-serve # Build and serve the documentation
docs-serve:
rye run docs-serve
.PHONY: all
all: format lint test
.PHONY: cf-pages-build # Build the docs for GitHub Pages
cf-pages-build:
python3 -V
python3 -m pip install uv
python3 -m uv pip install --system -r requirements.lock -r requirements-dev.lock
python3 -m uv pip install --system --extra-index-url $(PPPR_URL) -U mkdocs-material mkdocstrings-python
python3 -m mkdocs build