generated from tgrx/alpha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.targets.mk
94 lines (66 loc) · 1.63 KB
/
Makefile.targets.mk
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.PHONY: dist get-version clean clean-python clean-dist
.PHONY: format qa tests coverage code-typing code-format code-linters sh
.PHONY: venv-dir venv venv-dev venv-deploy venv-deploy-all upgrade-venv
get-version:
@python -c "import oyabun; print(oyabun.__version__)"
clean: clean-python clean-dist
$(call log, cleaning project)
clean-python:
$(call log, cleaning python caches)
rm -rf "$(DIR_ARTIFACTS)/coverage"
rm -rf "$(DIR_ARTIFACTS)/mypy"
rm -rf "$(DIR_ARTIFACTS)/pytest"
clean-dist:
$(call log, cleaning distribution)
rm -rf *.egg-info
rm -rf build/
rm -rf dist/
dist: clean-dist
$(call log, building distribution)
poetry build --no-interaction
format:
$(call log, reorganizing imports & formatting code)
isort --virtual-env="$(DIR_VENV)" \
"$(DIR_OYABUN)" \
"$(DIR_SAMURAI)" \
"$(DIR_TESTS)" \
|| exit 1
black \
"$(DIR_OYABUN)" \
"$(DIR_SAMURAI)" \
"$(DIR_TESTS)" \
|| exit 1
qa: tests coverage code-typing code-format code-linters
$(call log, QA checks)
tests: clean-python
$(call log, running tests)
pytest
coverage:
$(call log, calculating coverage)
coverage html
coverage xml
code-typing:
$(call log, checking code typing)
mypy
code-format:
$(call log, checking code format)
isort --virtual-env="$(DIR_VENV)" --check-only \
"$(DIR_OYABUN)" \
"$(DIR_SAMURAI)" \
"$(DIR_TESTS)" \
|| exit 1
black --check \
"$(DIR_OYABUN)" \
"$(DIR_SAMURAI)" \
"$(DIR_TESTS)" \
|| exit 1
code-linters:
$(call log, linting)
flake8
sh:
$(call log, starting Python shell)
ipython
venv:
$(call log, installing packages)
poetry env use "$(shell cat .python-version)"
poetry install --no-root