-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (63 loc) · 1.36 KB
/
Makefile
File metadata and controls
85 lines (63 loc) · 1.36 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
SHELL:=bash
PYTHON_MODULE=DataPlotly
-include .localconfig.mk
REQUIREMENTS_GROUPS= \
dev \
tests \
lint \
packaging \
$(NULL)
.PHONY: update-requirements
REQUIREMENTS=$(patsubst %, requirements/%.txt, $(REQUIREMENTS_GROUPS))
update-requirements: $(REQUIREMENTS)
requirements/%.txt: uv.lock
@echo "Updating requirements for '$*'"; \
uv export --format requirements.txt \
--no-annotate \
--no-editable \
--no-hashes \
--only-group $* \
-q -o $@
#
# Static analysis
#
LINT_TARGETS=$(PYTHON_MODULE) tests $(EXTRA_LINT_TARGETS)
lint::
@ruff check --preview --output-format=concise $(LINT_TARGETS)
lint:: typecheck
lint-fix:
@ruff check --preview --fix $(LINT_TARGETS)
format:
@ruff format $(LINT_TARGETS)
typecheck:
@mypy $(LINT_TARGETS)
#
# Tests
#
test:
@ rm -rf tests/__output__
@ $(UV_RUN) pytest -v tests
#
# Coverage
#
# Run tests coverage
covtest:
@ $(UV_RUN) coverage run -m pytest tests/
coverage: covtest
@echo "Building coverage report"
@ $(UV_RUN) coverage html
#
# Tests using docker image
#
QGIS_IMAGE_REPOSITORY ?=qgis/qgis
QGIS_IMAGE_TAG ?= $(QGIS_IMAGE_REPOSITORY):$(QGIS_VERSION)
export QGIS_VERSION
export QGIS_IMAGE_TAG
export UID=$(shell id -u)
export GID=$(shell id -g)
docker-test:
cd .docker && docker compose up \
--quiet-pull \
--abort-on-container-exit \
--exit-code-from qgis
cd .docker && docker compose down -v