-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (55 loc) · 1.26 KB
/
Makefile
File metadata and controls
74 lines (55 loc) · 1.26 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
.PHONY: init test tests build docs lint upload bump
BIN = .venv/bin
PYTHON = $(BIN)/python
UV = $(BIN)/uv
SPHINXBUILD = $(shell pwd)/.venv/bin/sphinx-build
.venv: pyproject.toml uv.lock
which uv >/dev/null || python3 -m pip install -U uv
uv sync --extra dev
touch -f .venv
init: .venv
.PHONY: init
tests: .venv
$(BIN)/tox
.PHONY: tests
# Alias for old-style invocation
test: tests
.PHONY: test
coverage: .venv
$(BIN)/coverage run -m unittest discover -t . -s tests
$(BIN)/coverage xml
.PHONY: coverage
build:
$(UV) build
.PHONY: build
clean-docs:
cd docs; make clean
.PHONY: clean-docs
clean: clean-docs
rm -rf *.egg-info .mypy_cache coverage.xml .venv
find . -name "*.pyc" -type f -delete
find . -type d -empty -delete
# Legacy venv (remove eventually)
rm -rf env
.PHONY: clean-python
docs: .venv
cd docs; make html SPHINXBUILD=$(SPHINXBUILD); make man SPHINXBUILD=$(SPHINXBUILD); make doctest SPHINXBUILD=$(SPHINXBUILD)
lint: .venv
$(BIN)/ruff check hl7 tests
CHECK_ONLY=true $(MAKE) format
.PHONY: lint
CHECK_ONLY ?=
ifdef CHECK_ONLY
RUFF_FORMAT_ARGS=--check
endif
format: .venv
$(BIN)/ruff format $(RUFF_FORMAT_ARGS) hl7 tests
.PHONY: format
upload:
rm -rf dist
$(UV) build
$(UV) publish
.PHONY: upload
bump: .venv
$(BIN)/cz bump
.PHONY: bump