-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (45 loc) · 1.39 KB
/
Copy pathMakefile
File metadata and controls
56 lines (45 loc) · 1.39 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
PYTHON := .venv/bin/python
PIP := .venv/bin/pip
PYTEST := .venv/bin/pytest
MYPY := .venv/bin/mypy
DOCTEST_MODULES := \
src/lib.py \
src/model.py \
src/parse.py \
src/process.py \
src/input.py \
src/output.py \
src/util.py \
src/error.py
.PHONY: help install-dev install-build test doctest typecheck check build clean
help:
@echo "Targets:"
@echo " install-dev Install dev tools (pytest, mypy) into .venv"
@echo " install-build Install build tools (nuitka, patchelf, zstandard) into .venv"
@echo " test Run end-to-end CLI tests (pytest)"
@echo " doctest Run doctests in all modules"
@echo " typecheck Run mypy"
@echo " check Run test + doctest + typecheck"
@echo " build Build standalone binary -> dist/scut"
@echo " clean Remove build artifacts and tool caches"
install-dev:
$(PIP) install -r requirements-dev.txt
install-build:
$(PIP) install -r requirements-build.txt
test:
$(PYTEST)
doctest:
@for m in $(DOCTEST_MODULES); do \
echo "doctest $$m"; \
PYTHONPATH=src $(PYTHON) -m doctest $$m || exit 1; \
done
typecheck:
$(MYPY)
check: test doctest typecheck
build:
PATH=".venv/bin:$$PATH" $(PYTHON) -m nuitka --onefile \
--output-dir=dist --output-filename=scut \
--assume-yes-for-downloads src/scut.py
clean:
rm -rf dist .mypy_cache .pytest_cache .ruff_cache
find . -type d -name __pycache__ -exec rm -rf {} +