Debian Codegraph @

Makefile

raw
1 # system python interpreter. used only to create virtual environment
2 PY = python3
3 VENV = venv
4 BIN=$(VENV)/bin
5
6 DOCS_OUT = site
7
8
9 ifeq ($(OS), Windows_NT)
10 BIN=$(VENV)/Scripts
11 PY=python
12 endif
13
14
15 .PHONY: all
16 all: lint mypy test test-release
17
18 $(VENV): requirements.txt requirements-dev.txt pyproject.toml
19 $(PY) -m venv $(VENV)
20 $(BIN)/pip install --upgrade -r requirements.txt
21 $(BIN)/pip install --upgrade -r requirements-dev.txt
22 $(BIN)/pip install -e .['dev']
23 touch $(VENV)
24
25 .PHONY: test
26 test: $(VENV)
27 $(BIN)/pytest
28
29 .PHONY: mypy
30 mypy: $(VENV)
31 $(BIN)/mypy
32
33 .PHONY: lint
34 lint: $(VENV)
35 $(BIN)/ruff check .
36
37 .PHONY: build
38 build: $(VENV)
39 rm -rf dist
40 $(BIN)/python3 -m build
41
42 .PHONY: test-release
43 test-release: $(VENV) build
44 $(BIN)/twine check dist/*
45
46 .PHONY: release
47 release: $(VENV) build
48 $(BIN)/twine upload dist/*
49
50 .PHONY: docs
51 docs: $(VENV)
52 $(BIN)/mkdocs build
53
54 .PHONY: clean
55 clean:
56 rm -rf build dist *.egg-info
57 rm -rf $(VENV)
58 rm -rf $(DOCS_OUT)
59 find . -type f -name *.pyc -delete
60 find . -type d -name __pycache__ -delete
61 # coverage
62 rm -rf htmlcov .coverage
63 rm -rf .mypy_cache