1
1
.DEFAULT_GOAL := all
2
2
3
- .PHONY : .uv # Check that uv is installed
4
- .uv :
3
+ .PHONY : .uv
4
+ .uv : # # Check that uv is installed
5
5
@uv --version || echo ' Please install uv: https://docs.astral.sh/uv/getting-started/installation/'
6
6
7
- .PHONY : .pre-commit # Check that pre-commit is installed
8
- .pre-commit :
7
+ .PHONY : .pre-commit
8
+ .pre-commit : # # Check that pre-commit is installed
9
9
@pre-commit -V || echo ' Please install pre-commit: https://pre-commit.com/'
10
10
11
- .PHONY : install # Install the package, dependencies, and pre-commit for local development
12
- install : .uv .pre-commit
11
+ .PHONY : install
12
+ install : .uv .pre-commit # # Install the package, dependencies, and pre-commit for local development
13
13
uv sync --frozen --all-extras --all-packages --group lint --group docs
14
14
pre-commit install --install-hooks
15
15
16
- .PHONY : sync # Update local packages and uv.lock
17
- sync : .uv
16
+ .PHONY : sync
17
+ sync : .uv # # Update local packages and uv.lock
18
18
uv sync --all-extras --all-packages --group lint --group docs
19
19
20
- .PHONY : format # Format the code
21
- format :
20
+ .PHONY : format
21
+ format : # # Format the code
22
22
uv run ruff format
23
23
uv run ruff check --fix --fix-only
24
24
25
- .PHONY : lint # Lint the code
26
- lint :
25
+ .PHONY : lint
26
+ lint : # # Lint the code
27
27
uv run ruff format --check
28
28
uv run ruff check
29
29
@@ -36,19 +36,19 @@ typecheck-pyright:
36
36
typecheck-mypy :
37
37
uv run mypy --strict tests/typed_agent.py
38
38
39
- .PHONY : typecheck # Run static type checking
40
- typecheck : typecheck-pyright
39
+ .PHONY : typecheck
40
+ typecheck : typecheck-pyright # # Run static type checking
41
41
42
- .PHONY : typecheck-both # Run static type checking with both Pyright and Mypy
42
+ .PHONY : typecheck-both # # Run static type checking with both Pyright and Mypy
43
43
typecheck-both : typecheck-pyright typecheck-mypy
44
44
45
- .PHONY : test # Run tests and collect coverage data
46
- test :
45
+ .PHONY : test
46
+ test : # # Run tests and collect coverage data
47
47
uv run coverage run -m pytest
48
48
@uv run coverage report
49
49
50
- .PHONY : test-all-python # Run tests on Python 3.9 to 3.13
51
- test-all-python :
50
+ .PHONY : test-all-python
51
+ test-all-python : # # Run tests on Python 3.9 to 3.13
52
52
UV_PROJECT_ENVIRONMENT=.venv39 uv run --python 3.9 --all-extras coverage run -p -m pytest
53
53
UV_PROJECT_ENVIRONMENT=.venv310 uv run --python 3.10 --all-extras coverage run -p -m pytest
54
54
UV_PROJECT_ENVIRONMENT=.venv311 uv run --python 3.11 --all-extras coverage run -p -m pytest
@@ -57,27 +57,27 @@ test-all-python:
57
57
@uv run coverage combine
58
58
@uv run coverage report
59
59
60
- .PHONY : testcov # Run tests and generate a coverage report
61
- testcov : test
60
+ .PHONY : testcov
61
+ testcov : test # # Run tests and generate a coverage report
62
62
@echo " building coverage html"
63
63
@uv run coverage html
64
64
65
- .PHONY : update-examples # update documentation examples
66
- update-examples :
65
+ .PHONY : update-examples
66
+ update-examples : # # Update documentation examples
67
67
uv run -m pytest --update-examples
68
68
69
69
# `--no-strict` so you can build the docs without insiders packages
70
- .PHONY : docs # Build the documentation
71
- docs :
70
+ .PHONY : docs
71
+ docs : # # Build the documentation
72
72
uv run mkdocs build --no-strict
73
73
74
74
# `--no-strict` so you can build the docs without insiders packages
75
- .PHONY : docs-serve # Build and serve the documentation
76
- docs-serve :
75
+ .PHONY : docs-serve
76
+ docs-serve : # # Build and serve the documentation
77
77
uv run mkdocs serve --no-strict
78
78
79
- .PHONY : .docs-insiders-install # install insiders packages for docs if necessary
80
- .docs-insiders-install :
79
+ .PHONY : .docs-insiders-install
80
+ .docs-insiders-install : # # Install insiders packages for docs if necessary
81
81
ifeq ($(shell uv pip show mkdocs-material | grep -q insiders && echo 'installed') , installed)
82
82
@echo 'insiders packages already installed'
83
83
else ifeq ($(PPPR_TOKEN),)
90
90
mkdocs-material mkdocstrings-python
91
91
endif
92
92
93
- .PHONY : docs-insiders # Build the documentation using insiders packages
94
- docs-insiders : .docs-insiders-install
93
+ .PHONY : docs-insiders
94
+ docs-insiders : .docs-insiders-install # # Build the documentation using insiders packages
95
95
uv run --no-sync mkdocs build -f mkdocs.insiders.yml
96
96
97
- .PHONY : docs-serve-insiders # Build and serve the documentation using insiders packages
98
- docs-serve-insiders : .docs-insiders-install
97
+ .PHONY : docs-serve-insiders
98
+ docs-serve-insiders : .docs-insiders-install # # Build and serve the documentation using insiders packages
99
99
uv run --no-sync mkdocs serve -f mkdocs.insiders.yml
100
100
101
- .PHONY : cf-pages-build # Install uv, install dependencies and build the docs, used on CloudFlare Pages
102
- cf-pages-build :
101
+ .PHONY : cf-pages-build
102
+ cf-pages-build : # # Install uv, install dependencies and build the docs, used on CloudFlare Pages
103
103
curl -LsSf https://astral.sh/uv/install.sh | sh
104
104
uv python install 3.12
105
105
uv sync --python 3.12 --frozen --group docs
@@ -110,4 +110,17 @@ cf-pages-build:
110
110
uv run --no-sync mkdocs build -f mkdocs.insiders.yml
111
111
112
112
.PHONY : all
113
- all : format lint typecheck testcov
113
+ all : format lint typecheck testcov # # Run code formatting, linting, static type checks, and tests with coverage report generation
114
+
115
+ .PHONY : help
116
+ help : # # Show this help (usage: make help)
117
+ @echo " Usage: make [target]"
118
+ @echo " Targets:"
119
+ @awk ' /^[a-zA-Z0-9_-]+:.*?##/ { \
120
+ helpMessage = match($$ 0, /# # (.*)/); \
121
+ if (helpMessage) { \
122
+ target = $$ 1; \
123
+ sub(/:/, " " , target); \
124
+ printf " \033[36m%-20s\033[0m %s\n" , target, substr($$ 0, RSTART + 3, RLENGTH); \
125
+ } \
126
+ }' $(MAKEFILE_LIST)
0 commit comments