/
Makefile
61 lines (46 loc) · 1.32 KB
/
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
61
PROJECT=sp
default: help
help:
@echo 'Usage: make [target] ...'
@echo
@echo 'Targets:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf "%-16s %s\n", $$1, $$2}'
.PHONY: *
#### DEV
_black:
black -l 100 $(PROJECT) test
_isort:
isort -l100 -m3 -tc -rc $(PROJECT) test
#----------- TEST --------------------------------------------------------------
test: ## Lint and unit test python code
@$(PRE_ACTIVATE) $(MAKE) -j8 --no-print-directory \
test-mypy \
test-black \
test-pylint \
test-unit \
test-isort
test-check: ## Lint and unit test python code
@$(PRE_ACTIVATE) $(MAKE) -j8 --no-print-directory \
test-pylint \
test-mypy \
test-black \
test-isort
test-black:
black -l 100 $(PROJECT) --check --exclude version.py
test-mypy:
mypy $(PROJECT)
test-pylint:
pylint -f parseable --rcfile=setup.cfg -j 4 $(PROJECT)
test-unit:
@rm -f var/.coverage var/.coverage.*
pytest $(EXTRA_JAR) test -rf -q --cov $(PROJECT) \
--cov-branch --cov-report term $(PYTESTFLAGS)
test-isort:
isort -l100 -m3 -tc -rc -c $(PROJECT)
build:
python3 -m build
upload-test:
python3 -m twine upload --skip-existing --repository testpypi dist/* -u __token__ -p "$(PYPI_TEST)"
upload:
python3 -m twine upload --skip-existing --repository pypi dist/* -u __token__ -p "$(PYPI)"