-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
60 lines (46 loc) · 943 Bytes
/
Makefile
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
# system python interpreter. used only to create virtual environment
PY = python3
VENV = venv
BIN=$(VENV)/bin
DOCS_OUT = site
ifeq ($(OS), Windows_NT)
BIN=$(VENV)/Scripts
PY=python
endif
all: lint mypy test test-release
$(VENV): pyproject.toml
$(PY) -m venv $(VENV)
$(BIN)/pip install --upgrade -e .[dev]
touch $(VENV)
.PHONY: test
test: $(VENV)
$(BIN)/pytest
.PHONY: mypy
mypy: $(VENV)
$(BIN)/mypy
.PHONY: lint
lint: $(VENV)
$(BIN)/ruff check .
.PHONY: build
build: $(VENV)
rm -rf dist
$(BIN)/python3 -m build
.PHONY: test-release
test-release: $(VENV) build
$(BIN)/twine check dist/*
.PHONY: release
release: $(VENV) build
$(BIN)/twine upload dist/*
.PHONY: docs
docs: $(VENV)
$(BIN)/mkdocs build
.PHONY: clean
clean:
rm -rf dist *.egg-info
rm -rf $(VENV)
rm -rf $(DOCS_OUT)
find . -type f -name *.pyc -delete
find . -type d -name __pycache__ -delete
# coverage
rm -rf htmlcov .coverage
rm -rf .mypy_cache