-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 1.32 KB
/
Makefile
File metadata and controls
48 lines (36 loc) · 1.32 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
SHELL := /bin/sh
UV ?= uv
UV_CACHE_DIR ?= .uv-cache
PYTHON ?=
DJANGO_CONSTRAINT ?=
UV_ENV = UV_CACHE_DIR=$(UV_CACHE_DIR)
.PHONY: help sync lock test test-django lint build check ci
help:
@printf '%s\n' \
'make sync - sync the development environment from uv.lock' \
'make lock - refresh uv.lock after dependency changes' \
'make test - run the unit test suite with the locked environment' \
'make test-django - run tests against a specific Django constraint' \
' example: make test-django DJANGO_CONSTRAINT="django>=5.1,<5.2" PYTHON=3.13' \
'make lint - run Ruff checks' \
'make build - build wheel and sdist artifacts' \
'make check - run lint and tests' \
'make ci - run lint, tests, and build locally'
sync:
$(UV_ENV) $(UV) sync --locked
lock:
$(UV_ENV) $(UV) lock
test:
$(UV_ENV) $(UV) run --locked pytest
test-django:
@if [ -z "$(DJANGO_CONSTRAINT)" ]; then \
printf '%s\n' 'DJANGO_CONSTRAINT is required. Example: make test-django DJANGO_CONSTRAINT="django>=5.1,<5.2" [PYTHON=3.13]'; \
exit 2; \
fi
$(UV_ENV) $(UV) run --locked --isolated $(if $(PYTHON),--python $(PYTHON),) --with "$(DJANGO_CONSTRAINT)" pytest
lint:
$(UV_ENV) $(UV) run --locked ruff check .
build:
$(UV_ENV) $(UV) build
check: sync lint test
ci: sync lint test build