-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
134 lines (113 loc) · 2.36 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
all: black-check flake8-check isort-check mypy-check bandit-check zizmor-check test
bandit-check:
@echo Running bandit...
@bandit\
--silent \
--recursive \
aiotus
black:
@echo Formatting code using black...
@black aiotus tests
black-check:
@echo Running black...
@black \
--check \
--diff \
aiotus tests
flake8-check:
@echo Running flake8...
@flake8 \
aiotus tests
isort-check:
@echo Running isort...
@isort \
--check-only \
--diff \
aiotus tests
mypy-check:
@echo Running mypy...
@mypy \
--strict \
aiotus
@mypy \
tests
zizmor-check:
@echo Running zizmor...
zizmor .github/workflows
test .coverage: tusd tests/nginx.key tests/selfsigned.crt
pytest --cov=aiotus tests
coverage_html/index.html: .coverage
@coverage html -d coverage_html
@echo Coverage report ready at $$(realpath $@)
pyupgrade:
@echo Running pyupgrade...
pyupgrade \
--py39-plus \
--keep-runtime-typing \
aiotus/*.py
doc:
make -C docs clean html
tox:
unset PYTHONPATH && \
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring && \
tox
coverage combine .coverage.*
venv:
python3 -m venv venv
. venv/bin/activate; \
pip3 install --upgrade pip; \
pip3 install -r requirements.txt; \
pip3 install -e .
TUSD_VERSION = v2.5.0
TUSD_ARCH = amd64
TUSD_ARCHIVE = tusd_linux_${TUSD_ARCH}.tar.gz
${TUSD_ARCHIVE}:
wget --quiet https://github.com/tus/tusd/releases/download/${TUSD_VERSION}/tusd_linux_${TUSD_ARCH}.tar.gz
tusd: ${TUSD_ARCHIVE}
tar -xf ${TUSD_ARCHIVE} --strip-components 1 tusd_linux_${TUSD_ARCH}/tusd
touch $@
tests/nginx.key tests/selfsigned.crt:
openssl req \
-new -x509 -nodes\
-days 3650 \
-subj '/' \
-addext 'subjectAltName = DNS:localhost' \
-keyout tests/nginx.key \
-out tests/selfsigned.crt
show-certificate: tests/selfsigned.crt
@openssl x509 \
-text \
-in $< \
-noout
clean:
@rm -f \
.coverage*
@rm -rf \
.mypy_cache \
.pytest_cache \
.tox \
.xprocess \
aiotus.egg-info \
build \
coverage_html \
dist \
docs/build
veryclean: clean
@rm -f \
tusd \
${TUSD_ARCHIVE} \
tests/nginx.key \
tests/selfsigned.crt
@rm -rf \
venv
.PHONY: \
black \
clean \
pyupgrade \
doc \
flake8-check \
isort-check \
mypy-check \
show-certificate \
test \
veryclean