-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (47 loc) · 1.23 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
remote_server := phl
remote_wheel_dir=/shared/wheels
get_value = $(shell sed -n "s/\($1 \?= \?\"\)\(.*\)\(\"\)/\2/p" pyproject.toml)
pkg_name := $(call get_value,name)
version := $(call get_value,version)
vermin := 3.8
wheel := $(pkg_name)-$(version)-py3-none-any.whl
test_docs := pytest --cov=hledger_lots tests/ --cov-report=html:docs/test_coverage && \
mkdir -p docs/unit_tests && \
pytest --html=docs/unit_tests/index.html
.PHONY: local
local:
make build && \
pip3 uninstall -y $(pkg_name) && \
pip3 install dist/$(wheel)
.PHONY: build
build:
make fix && python -m build
.PHONY: fix
fix:
source venv/bin/activate && \
pyright $(pkg_name) && \
pycln $(pkg_name) && \
isort --profile black $(pkg_name) && \
black $(pkg_name) && \
vermin -t=$(vermin) \
--eval-annotations \
--backport dataclasses \
--backport typing \
--no-parse-comments "$(pkg_name)" # && \
# pytest
.PHONY: serve-docs
serve-docs:
source venv/bin/activate && \
# $(test_docs) && \
PYTHONPATH="$(CURDIR)" mkdocs serve
.PHONY: gh-deploy
gh-deploy:
source venv/bin/activate && \
$(test_docs) && \
PYTHONPATH="$(CURDIR)" mkdocs gh-deploy
.PHONY: publish
publish:
source venv/bin/activate && \
rm dist/* && \
make build && \
python3 -m twine upload dist/*