-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (49 loc) · 1.46 KB
/
Makefile
File metadata and controls
65 lines (49 loc) · 1.46 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
.PHONY: init venv deps dirs clean pytest coverage test release mypy pylint ruff check build
.DEFAULT_GOAL := check
FILES_CHECK_MYPY := domselect tests
FILES_CHECK_ALL := $(FILES_CHECK_MYPY)
COVERAGE_TARGET := domselect
PYTHON_VER := 3.13
init: venv deps dirs
venv:
if which python$(PYTHON_VER); then \
PYTHON_BINARY=python$(PYTHON_VER); \
else \
PYTHON_BINARY=var/bin/python$(PYTHON_VER); \
fi; \
virtualenv --python $$PYTHON_BINARY .venv
deps:
#curl -sS https://bootstrap.pypa.io/get-pip.py | .env/bin/python3 # a fix for manually built python
.venv/bin/pip install -U setuptools wheel
.venv/bin/pip install -r requirements_dev.txt
.venv/bin/pip install -e .
dirs:
if [ ! -e var/run ]; then mkdir -p var/run; fi
if [ ! -e var/log ]; then mkdir -p var/log; fi
if [ ! -e var/bin ]; then mkdir -p var/bin; fi
clean:
find -name '*.pyc' -delete
find -name '*.swp' -delete
find -name '__pycache__' -delete
pytest:
pytest -n30 -x --cov $(COVERAGE_TARGET) --cov-report term-missing
coverage:
pytest -n30 -x --cov $(COVERAGE_TARGET) --cov-report term-missing
test: check pytest
tox -e check-minver
release:
git push \
&& git push --tags \
&& make build \
&& twine upload dist/*
mypy:
mypy --strict $(FILES_CHECK_MYPY) --enable-error-code exhaustive-match --python-version 3.9
pylint:
pylint -j0 $(FILES_CHECK_ALL)
ruff:
ruff check --target-version=py39 $(FILES_CHECK_ALL)
check: ruff mypy pylint
build:
rm -rf *.egg-info
rm -rf dist/*
python -m build --sdist