-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (45 loc) · 1.77 KB
/
Makefile
File metadata and controls
60 lines (45 loc) · 1.77 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
.PHONY: default uv-sync check test-all test test-only docformat doctest doctest-only mypy mypy-only lint-only reset-baseline-schemas
default: test-all
install: uv-sync
uv-sync:
@uv sync --all-packages 2> /dev/null
check: uv-sync
@$(MAKE) -j test-only doctest-only lint-only mypy-only
test-all: uv-sync
@uv run pytest -W error packages/
test: uv-sync
@uv run pytest -W error packages/ -x
test-only:
@uv run pytest -W error packages/ -x
coverage: uv-sync
@uv run pytest packages/ --cov overture.schema --cov-report=term --cov-report=html && open htmlcov/index.html
docformat:
@find packages/*/src -name "*.py" -type f -not -name "__*" \
| xargs uv run pydocstyle --convention=numpy --add-ignore=D102,D105,D200,D205,D400
doctest: uv-sync doctest-only
doctest-only:
@# $$ escapes $ for make - sed needs literal $ for end-of-line anchor
@find packages/*/src -name "*.py" -type f \
| sed 's|^packages/[^/]*/src/||' \
| sed 's|/|.|g' \
| sed 's|\.py$$||' \
| sed 's|\.__init__$$||' \
| sed '/\.__.*__$$/d' \
| sort -u \
| xargs uv run python -c 'import doctest, importlib, sys; sys.exit(any(doctest.testmod(importlib.import_module(m)).failed for m in sys.argv[1:]))'
# mypy type checking with namespace package support
mypy: uv-sync mypy-only
mypy-only:
@# $$ escapes $ for make - sed needs literal $ for end-of-line anchor
@find packages -maxdepth 1 -type d -name "overture-schema*" \
| sort \
| sed 's|-theme$$||' \
| tr - . \
| sed 's|^packages/|-p |' \
| xargs uv run mypy --no-error-summary
@for d in packages/*/tests; do find "$$d" -name "*.py" | sort | xargs uv run mypy --no-error-summary || exit 1; done
lint-only:
@uv run ruff check -q packages/
@uv run ruff format --check packages/
reset-baseline-schemas:
@find . -name \*_baseline_schema.json -delete