forked from prostomarkeloff/vkwave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
94 lines (73 loc) · 2.35 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
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
base_python := python3
py := poetry run
reports_dir := reports
# =================================================================================================
# Environment
# =================================================================================================
.PHONY: install
install:
$(base_python) -m pip install setuptools wheel -U
$(base_python) -m pip install -U poetry --user
poetry install
.PHONY: clean
clean:
rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]' `
rm -f `find . -type f -name '*~' `
rm -f `find . -type f -name '.*~' `
rm -rf `find . -name .pytest_cache`
rm -rf *.egg-info
rm -f .coverage
rm -f report.html
rm -f .coverage.*
rm -rf {build,dist,site,.cache,.mypy_cache,reports}
# =================================================================================================
# Code quality
# =================================================================================================
.PHONY: isort
isort:
$(py) isort -rc vkwave tests
.PHONY: black
black:
$(py) black vkwave tests
.PHONY: flake8
flake8:
$(py) flake8 vkwave test
.PHONY: flake8-report
flake8-report:
mkdir -p $(reports_dir)/flake8
$(py) flake8 --format=html --htmldir=$(reports_dir)/flake8 vkwave test
.PHONY: mypy
mypy:
$(py) mypy vkwave
.PHONY: mypy-report
mypy-report:
$(py) mypy vkwave --html-report $(reports_dir)/typechecking
.PHONY: lint
lint: isort black flake8 mypy
# =================================================================================================
# Tests
# =================================================================================================
.PHONY: test
test:
$(py) pytest
# =================================================================================================
# Docs
# =================================================================================================
.PHONY: docs
docs:
$(py) mkdocs build
.PHONY: docs-serve
docs-serve:
$(py) mkdocs serve
.PHONY: docs-copy-reports
docs-copy-reports:
mv $(reports_dir)/* site/reports
# =================================================================================================
# Project
# =================================================================================================
.PHONY: build
build: clean mypy-report docs docs-copy-reports
mkdir -p site/simple
poetry build
mv dist site/simple/vkwave