-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (54 loc) · 1.27 KB
/
Makefile
File metadata and controls
62 lines (54 loc) · 1.27 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
#!make
.DEFAULT_GOAL := format
# Makefile target args
args = $(filter-out $@,$(MAKECMDGOALS))
# Command shortcuts
mypy = MYPYPATH=src \
uv run --group lint mypy
pyright = uv run --group lint pyright
stubtest = MYPYPATH=src PYTHONPATH=src \
uv run --group lint stubtest
pytest = uv run --group tests pytest
ruff = uv run --group lint --group tests ruff
.PHONY: format
format:
$(ruff) format .
$(ruff) check --fix .
.PHONY: sync
sync:
uv sync --frozen --all-groups
.PHONY: test
postgres_version:=latest
test:
$(pytest) --postgres-version $(postgres_version)
.PHONY: lint
lint:
$(ruff) check . --preview
$(mypy) src tests
$(pyright)
$(MAKE) stubtest
.PHONY: stubtest
stubtest:
@modules=$$(find src/notora -name '*.pyi' -print \
| sed -e 's#^src/##' -e 's#/#.#g' -e 's#\.pyi$$##' -e 's#\.__init__$$##'); \
if [ -z "$$modules" ]; then \
echo "No .pyi modules found under src/notora"; \
exit 1; \
fi; \
$(stubtest) $$modules
.PHONY: clean
clean:
rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]' `
rm -f `find . -type f -name '*~' `
rm -f `find . -type f -name '.*~' `
rm -rf dist *.egg-info
rm -rf .cache
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf .ruff_cache
rm -rf htmlcov
rm -f .coverage
rm -f .coverage.*
rm -rf .venv
rm -rf .hypothesis