-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathmakefile
More file actions
61 lines (47 loc) · 1.83 KB
/
makefile
File metadata and controls
61 lines (47 loc) · 1.83 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
all: clean lint fmt test coverage
# Prevent uv from modifying the lock file. UV_FROZEN skips resolution entirely,
# which is required because the lock file uses public PyPI URLs while the actual
# index may be an internal proxy. Use `make lock-dependencies` to update the lock file.
export UV_FROZEN := 1
# Ensure that hatchling is pinned when builds are needed.
export UV_BUILD_CONSTRAINT := .build-constraints.txt
UV_RUN := uv run --exact --all-extras
UV_TEST := $(UV_RUN) pytest -n 10 --timeout 600 --durations 20
clean:
rm -fr .venv clean htmlcov .mypy_cache .pytest_cache .ruff_cache .coverage coverage.xml
find . -name '__pycache__' -print0 | xargs -0 rm -fr
dev:
uv sync --all-extras
lint:
$(UV_RUN) black --check .
$(UV_RUN) ruff check .
$(UV_RUN) mypy .
$(UV_RUN) pylint --output-format=colorized -j 0 dbldatagen
fmt:
$(UV_RUN) black .
$(UV_RUN) ruff check . --fix
$(UV_RUN) mypy .
$(UV_RUN) pylint --output-format=colorized -j 0 dbldatagen
test:
$(UV_TEST) --cov=dbldatagen --cov-report=xml tests/
coverage:
$(UV_TEST) --cov=dbldatagen --cov-report=html tests/
open htmlcov/index.html
build:
uv build --require-hashes --build-constraints=.build-constraints.txt
lock-dependencies: export UV_FROZEN := 0
lock-dependencies:
uv lock
$(UV_RUN) --group yq tomlq -r '.["build-system"].requires[]' pyproject.toml | \
uv pip compile --generate-hashes --universal --no-header - > build-constraints-new.txt
mv build-constraints-new.txt .build-constraints.txt
perl -pi -e 's|registry = "https://[^"]*"|registry = "https://pypi.org/simple"|g' uv.lock
docs-build:
$(UV_RUN) --group docs sphinx-build -M html docs/source docs/build
docs-clean:
rm -rf docs/build
docs-serve:
make docs-build
open docs/build/html/index.html
.DEFAULT: all
.PHONY: all clean dev lint fmt test coverage build lock-dependencies docs-build docs-clean docs-serve