-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
317 lines (282 loc) · 18.7 KB
/
Makefile
File metadata and controls
317 lines (282 loc) · 18.7 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
F= tool/strip_python3.py
B= 2024
FOR=today
DAY=%u
# 'make version FOR=yesterday' or 'make version DAY=0'
PY39 = 3.9
PY3X = 3.11
-include Makefile_py3x.mk
GIT = git
DOCKER = docker
PYTHON39 = python$(PY39)
PYTHON3 = python3
PYTHON = python$(PY3X)
PYTHON_VERSION = $(PY3X)
QTOML_PY = tool/strip_qtoml_decoder.py
AST4_PY = tool/strip_ast_comments.py
UNITS_PY = tests/unittests1.py
TESTS_PY = tests/transformertests2.py
EXECS_PY = tests/exectests3.py
UNITS = $(UNITS_PY) $(UNITS_OPTIONS)
TESTS = $(TESTS_PY) $(TESTS_OPTIONS) --python=$(PYTHON)
EXECS = $(EXECS_PY) $(EXECS_OPTIONS) --python=$(PYTHON)
CONTAINER = strip-py
COVERAGE2 = --coverage --coverage
TODO=
V=-v
VV=-vv
.PHONY: tests tool src doc dist
all: help
help:
$(PYTHON) $F --help
check39: ; test ! -f /usr/bin/python3.9 || $(MAKE) test PYTHON=python3.9
check10: ; test ! -f /usr/bin/python3.10 || $(MAKE) test PYTHON=python3.10
check11: ; test ! -f /usr/bin/python3.11 || $(MAKE) test PYTHON=python3.11
check12: ; test ! -f /usr/bin/python3.12 || $(MAKE) test PYTHON=python3.12
check1: ; $(MAKE) check39 || $(MAKE) check10 || $(MAKE) check11 || $(MAKE) check12
check2: ; $(MAKE) tests11 || $(MAKE) tests27 || $(MAKE) tests36
check3: ; $(MAKE) test11 || $(MAKE) test27 || $(MAKE) test36
check5: ; $(MAKE) test_5*/3.11 || $(MAKE) test_5*/3.12
check: check39 check10 check11 check12
: " ready for $(MAKE) checks ? "
checks: ; $(MAKE) tests3.9 tests3.10 tests3.11 tests3.12
: " ready for $(MAKE) tests ? "
tests: ; $(MAKE) test3.9 test3.10 test3.11 test3.12
tests3.9: ; test ! -f /usr/bin/python$(subst tests,,$@) || python$(subst tests,,$@) $(TESTS_PY) $(TESTS_OPTIONS) --python=/usr/bin/python$(subst tests,,$@) $V $(TODO) --failfast
tests3.10: ; test ! -f /usr/bin/python$(subst tests,,$@) || python$(subst tests,,$@) $(TESTS_PY) $(TESTS_OPTIONS) --python=/usr/bin/python$(subst tests,,$@) $V $(TODO) --failfast
tests3.11: ; test ! -f /usr/bin/python$(subst tests,,$@) || python$(subst tests,,$@) $(TESTS_PY) $(TESTS_OPTIONS) --python=/usr/bin/python$(subst tests,,$@) $V $(TODO) --failfast
tests3.12: ; test ! -f /usr/bin/python$(subst tests,,$@) || python$(subst tests,,$@) $(TESTS_PY) $(TESTS_OPTIONS) --python=/usr/bin/python$(subst tests,,$@) $V $(TODO) --failfast
test3.9: ; test ! -f /usr/bin/python$(subst test,,$@) || python$(subst test,,$@) $(EXECS_PY) $(EXECS_OPTIONS) --python=/usr/bin/python$(subst test,,$@) $V $(TODO) --failfast
test3.10: ; test ! -f /usr/bin/python$(subst test,,$@) || python$(subst test,,$@) $(EXECS_PY) $(EXECS_OPTIONS) --python=/usr/bin/python$(subst test,,$@) $V $(TODO) --failfast
test3.11: ; test ! -f /usr/bin/python$(subst test,,$@) || python$(subst test,,$@) $(EXECS_PY) $(EXECS_OPTIONS) --python=/usr/bin/python$(subst test,,$@) $V $(TODO) --failfast
test3.12: ; test ! -f /usr/bin/python$(subst test,,$@) || python$(subst test,,$@) $(EXECS_PY) $(EXECS_OPTIONS) --python=/usr/bin/python$(subst test,,$@) $V $(TODO) --failfast
test_2%/3.9: ; test ! -f /usr/bin/python$(notdir $@) || python$(notdir $@) $(TESTS_PY) $(TESTS_OPTIONS) --python=/usr/bin/python$(notdir $@) $V $(TODO) --failfast $(dir $@)
test_2%/3.10: ; test ! -f /usr/bin/python$(notdir $@) || python$(notdir $@) $(TESTS_PY) $(TESTS_OPTIONS) --python=/usr/bin/python$(notdir $@) $V $(TODO) --failfast $(dir $@)
test_2%/3.11: ; test ! -f /usr/bin/python$(notdir $@) || python$(notdir $@) $(TESTS_PY) $(TESTS_OPTIONS) --python=/usr/bin/python$(notdir $@) $V $(TODO) --failfast $(dir $@)
test_2%/3.12: ; test ! -f /usr/bin/python$(notdir $@) || python$(notdir $@) $(TESTS_PY) $(TESTS_OPTIONS) --python=/usr/bin/python$(notdir $@) $V $(TODO) --failfast $(dir $@)
test_3%/3.9: ; test ! -f /usr/bin/python$(notdir $@) || python$(notdir $@) $(EXECS_PY) $(EXECS_OPTIONS) --python=/usr/bin/python$(notdir $@) $V $(TODO) --failfast $(dir $@)
test_3%/3.10: ; test ! -f /usr/bin/python$(notdir $@) || python$(notdir $@) $(EXECS_PY) $(EXECS_OPTIONS) --python=/usr/bin/python$(notdir $@) $V $(TODO) --failfast $(dir $@)
test_3%/3.11: ; test ! -f /usr/bin/python$(notdir $@) || python$(notdir $@) $(EXECS_PY) $(EXECS_OPTIONS) --python=/usr/bin/python$(notdir $@) $V $(TODO) --failfast $(dir $@)
test_3%/3.12: ; test ! -f /usr/bin/python$(notdir $@) || python$(notdir $@) $(EXECS_PY) $(EXECS_OPTIONS) --python=/usr/bin/python$(notdir $@) $V $(TODO) --failfast $(dir $@)
test_5%/3.11: ; $(PYTHON3) tests/setuptests5.py -C tests --python=/usr/bin/python$(notdir $@) $V $(TODO) --failfast $(dir $@)
test_5%/3.12: ; $(PYTHON3) tests/setuptests5.py -C tests --python=/usr/bin/python$(notdir $@) $V $(TODO) --failfast $(dir $@)
todos: ; $(MAKE) checks TODO=--todo
todo1: ; $(MAKE) check1 TODO=--todo
todo2: ; $(MAKE) check2 TODO=--todo
todo3: ; $(MAKE) check3 TODO=--todo
todo: ; $(MAKE) test TODO=--todo
test: ; $(PYTHON) $(UNITS) $V $@ $(TODO) && $(PYTHON) $(TESTS) $V $@ $(TODO)
test_1%: ; $(PYTHON) $(UNITS) $V $@ $(TODO) --failfast
test_2%: ; $(PYTHON) $(TESTS) $V $@ $(TODO) --failfast
st_2%: ; $(PYTHON) $(TESTS) $V te$@ $(TODO) $(COVERAGE2)
st_1%: ; $(PYTHON) $(TESTS) $V te$@ $(TODO) $(COVERAGE2)
test_3%: ; $(PYTHON) $(EXECS) $V $@ $(TODO)
st_3%: ; $(PYTHON) $(EXECS) $V te$@ $(TODO) $(COVERAGE2)
testcases: ; grep "def test" $(TESTS_PY) $(UNITS_PY) | wc -l | sed -e "s|^|$@: |"
coverage: ; $(PYTHON) $(TESTS) $V $(COVERAGE2) && $(MAKE) testcases
coverage1: ; $(PYTHON) $(TESTS) $V $(COVERAGE2) test_1
coverage2: ; $(PYTHON) $(TESTS) $V $(COVERAGE2) test_2
docker:
$(MAKE) dockertests VV=
$(MAKE) dockerchecks VV=
dockerchecks: test test27 test36 test39 test310 test311 test312 test11
dockertests: tests tests27 tests36 tests39 tests310 tests311 tests312 tests11
# EXECS in container
tests27: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$(subst tests,test,$@)`" || $(MAKE) test_3/$(subst tests,,$@)
tests36: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$(subst tests,test,$@)`" || $(MAKE) test_3/$(subst tests,,$@)
tests39: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$(subst tests,test,$@)`" || $(MAKE) test_3/$(subst tests,,$@)
tests310: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$(subst tests,test,$@)`" || $(MAKE) test_3/$(subst tests,,$@)
tests311: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$(subst tests,test,$@)`" || $(MAKE) test_3/$(subst tests,,$@)
tests312: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$(subst tests,test,$@)`" || $(MAKE) test_3/$(subst tests,,$@)
tests11: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$(subst tests,test,$@)`" || $(MAKE) test_3/$(subst tests,,$@)
# TESTS in container
test27: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$@`" || $(MAKE) test_2/$(subst test,,$@)
test36: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$@`" || $(MAKE) test_2/$(subst test,,$@)
test39: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$@`" || $(MAKE) test_2/$(subst test,,$@)
test310: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$@`" || $(MAKE) test_2/$(subst test,,$@)
test311: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$@`" || $(MAKE) test_2/$(subst test,,$@)
test312: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$@`" || $(MAKE) test_2/$(subst test,,$@)
test11: ; test -z "`$(DOCKER) images -q -f reference=$(CONTAINER)/$@`" || $(MAKE) test_2/$(subst test,,$@)
test%/27:
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@) ; : ========== python2 @ $@
$(DOCKER) run -d --name=$(CONTAINER)-python$(notdir $@) $(CONTAINER)/test$(notdir $@) sleep 9999
$(DOCKER) cp tests $(CONTAINER)-python$(notdir $@):/
$(DOCKER) cp tool $(CONTAINER)-python$(notdir $@):/
[[ "$@" != test_2* ]] || : ignored "$@"
[[ "$@" != test_3* ]] || $(DOCKER) exec $(CONTAINER)-python$(notdir $@) \
$(PYTHON39) $(EXECS_PY) $(VV) $(dir $@) --python=/usr/bin/python2 $(COVERAGE1) $V $(TODO)
- test -z "$(COVERAGE1)" || $(DOCKER) cp $(CONTAINER)-python$(notdir $@):/.coverage .coverage.cov$(notdir $@)
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@)
test%/36:
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@) ; : ========== python3 @ $@
$(DOCKER) run -d --name=$(CONTAINER)-python$(notdir $@) $(CONTAINER)/test$(notdir $@) sleep 9999
$(DOCKER) cp tests $(CONTAINER)-python$(notdir $@):/
$(DOCKER) cp tool $(CONTAINER)-python$(notdir $@):/
[[ "$@" != test_2* ]] || : ignored "$@"
[[ "$@" != test_3* ]] || $(DOCKER) exec $(CONTAINER)-python$(notdir $@) \
$(PYTHON39) $(EXECS_PY) $(VV) $(dir $@) --python=/usr/bin/python3 $(COVERAGE1) $V $(TODO)
- test -z "$(COVERAGE1)" || $(DOCKER) cp $(CONTAINER)-python$(notdir $@):/.coverage .coverage.cov$(notdir $@)
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@)
test%/39:
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@) ; : ========== python3.9 @ $@
$(DOCKER) run -d --name=$(CONTAINER)-python$(notdir $@) $(CONTAINER)/test$(notdir $@) sleep 9999
$(DOCKER) cp tests $(CONTAINER)-python$(notdir $@):/
$(DOCKER) cp tool $(CONTAINER)-python$(notdir $@):/
[[ "$@" != test_2* ]] || $(DOCKER) exec $(CONTAINER)-python$(notdir $@) \
python3.9 $(TESTS_PY) $(VV) $(dir $@) --python=/usr/bin/python3.9 $(COVERAGE1) $V $(TODO)
[[ "$@" != test_3* ]] || $(DOCKER) exec $(CONTAINER)-python$(notdir $@) \
python3.9 $(EXECS_PY) $(VV) $(dir $@) --python=/usr/bin/python3.9 $(COVERAGE1) $V $(TODO)
- test -z "$(COVERAGE1)" || $(DOCKER) cp $(CONTAINER)-python$(notdir $@):/.coverage .coverage.cov$(notdir $@)
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@)
test%/310:
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@) ; : ========== python3.10 @ $@
$(DOCKER) run -d --name=$(CONTAINER)-python$(notdir $@) $(CONTAINER)/test$(notdir $@) sleep 9999
$(DOCKER) cp tests $(CONTAINER)-python$(notdir $@):/
$(DOCKER) cp tool $(CONTAINER)-python$(notdir $@):/
[[ "$@" != test_2* ]] || $(DOCKER) exec $(CONTAINER)-python$(notdir $@) \
python3.10 $(TESTS_PY) $(VV) $(dir $@) --python=/usr/bin/python3.10 $(COVERAGE1) $V $(TODO)
[[ "$@" != test_3* ]] || $(DOCKER) exec $(CONTAINER)-python$(notdir $@) \
python3.10 $(EXECS_PY) $(VV) $(dir $@) --python=/usr/bin/python3.10 $(COVERAGE1) $V $(TODO) --python3=/usr/bin/python3.10
- test -z "$(COVERAGE1)" || $(DOCKER) cp $(CONTAINER)-python$(notdir $@):/.coverage .coverage.cov$(notdir $@)
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@)
test%/311:
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@) ; : ========== python3.11 @ $@
$(DOCKER) run -d --name=$(CONTAINER)-python$(notdir $@) $(CONTAINER)/test$(notdir $@) sleep 9999
$(DOCKER) cp tests $(CONTAINER)-python$(notdir $@):/
$(DOCKER) cp tool $(CONTAINER)-python$(notdir $@):/
[[ "$@" != test_2* ]] || $(DOCKER) exec $(CONTAINER)-python$(notdir $@) \
python3.11 $(TESTS_PY) $(VV) $(dir $@) --python=/usr/bin/python3.11 $(COVERAGE1) $V $(TODO)
[[ "$@" != test_3* ]] || $(DOCKER) exec $(CONTAINER)-python$(notdir $@) \
python3.11 $(EXECS_PY) $(VV) $(dir $@) --python=/usr/bin/python3.11 $(COVERAGE1) $V $(TODO) --python3=/usr/bin/python3.11
- test -z "$(COVERAGE1)" || $(DOCKER) cp $(CONTAINER)-python$(notdir $@):/.coverage .coverage.cov$(notdir $@)
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@)
test%/312:
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@) ; : ========== python3.12 @ $@
$(DOCKER) run -d --name=$(CONTAINER)-python$(notdir $@) $(CONTAINER)/test$(notdir $@) sleep 9999
$(DOCKER) cp tests $(CONTAINER)-python$(notdir $@):/
$(DOCKER) cp tool $(CONTAINER)-python$(notdir $@):/
$[[ "$@" != test_2* ]] || (DOCKER) exec $(CONTAINER)-python$(notdir $@) \
python3.12 $(TESTS_PY) $(VV) $(dir $@) --python=/usr/bin/python3.12 $(COVERAGE1) $V $(TODO)
$[[ "$@" != test_3* ]] || (DOCKER) exec $(CONTAINER)-python$(notdir $@) \
python3.12 $(EXECS_PY) $(VV) $(dir $@) --python=/usr/bin/python3.12 $(COVERAGE1) $V $(TODO) --python3=/usr/bin/python3.12
- test -z "$(COVERAGE1)" || $(DOCKER) cp $(CONTAINER)-python$(notdir $@):/.coverage .coverage.cov$(notdir $@)
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@)
test%/11:
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@) ; : =========== mypy-3.11 + python3.11 @ $@
$(DOCKER) run -d --name=$(CONTAINER)-python$(notdir $@) $(CONTAINER)/test$(notdir $@) sleep 9999
$(DOCKER) cp tests $(CONTAINER)-python$(notdir $@):/
$(DOCKER) cp tool $(CONTAINER)-python$(notdir $@):/
[[ "$@" != test_2* ]] || $(DOCKER) exec $(CONTAINER)-python$(notdir $@) \
python3.11 $(TESTS_PY) $(VV) $(dir $@) --python=/usr/bin/python3.11 $(COVERAGE1) $V $(TODO)
[[ "$@" != test_3* ]] || $(DOCKER) exec $(CONTAINER)-python$(notdir $@) \
python3.11 $(EXECS_PY) $(VV) $(dir $@) --python=/usr/bin/python3.11 $(COVERAGE1) $V $(TODO) --python3=/usr/bin/python3.11 --mypy=mypy-3.11
- test -z "$(COVERAGE1)" || $(DOCKER) cp $(CONTAINER)-python$(notdir $@):/.coverage .coverage.cov$(notdir $@)
$(DOCKER) rm -f $(CONTAINER)-python$(notdir $@)
VERFILES = $F tests/*.py *.toml
version:
@ grep -l __version__ $(VERFILES) | { while read f; do : \
; Y=`date +%Y -d "$(FOR)"` ; X=$$(expr $$Y - $B) \
; D=`date +%W$(DAY) -d "$(FOR)"` ; sed -i \
-e "/^ *version = /s/[.]-*[0123456789][0123456789][0123456789]*/.$$X$$D/" \
-e "/^ *__version__/s/[.]-*[0123456789][0123456789][0123456789]*\"/.$$X$$D\"/" \
-e "/^ *__version__/s/[.]\\([0123456789]\\)\"/.\\1.$$X$$D\"/" \
-e "/^ *__copyright__/s/(C) [0123456789]*-[0123456789]*/(C) $B-$$Y/" \
-e "/^ *__copyright__/s/(C) [0123456789]* /(C) $$Y /" \
$$f; done; }
@ grep "^version =" $(VERFILES)
@ grep ^__version__ $(VERFILES)
@ $(GIT) add $(VERFILES) || true
@ ver=`cat $F | sed -e '/__version__/!d' -e 's/.*= *"//' -e 's/".*//' -e q` \
; echo "# $(GIT) commit -m v$$ver"
PYTHON_PIP = $(PYTHON) -m pip
PYTHON_TWINE = $(PYTHON) -m twine
pkg package:
- rm -rf build dist *.egg-info
$(MAKE) tmp/README.MD
# $(PYTHON_PIP) install --root=~/local . -v --no-compile
$(PYTHON) -m build
$(MAKE) fix-metadata-version
$(PYTHON_TWINE) check dist/*
: $(PYTHON_TWINE) upload dist/* --verbose
tmp/README.MD: README.MD Makefile
@ test -d tmp || mkdir tmp
cat $(notdir $@) | sed -e "/\\/badge/d" > $@
ins install:
$(MAKE) tmp/README.MD
test ! -d build || rm -rf build
$(PYTHON_PIP) install --no-compile --user .
$(MAKE) show | sed -e "s|[.][.]/[.][.]/[.][.]/bin|$$HOME/.local/bin|"
uns uninstall:
test -d tmp || mkdir -v tmp
set -x; $(PYTHON_PIP) uninstall -y `sed -e '/^name *=/!d' -e 's/name *= *"//' -e 's/".*//' pyproject.toml`
show:
@ $(PYTHON_PIP) show --files `sed -e '/^name *=/!d' -e 's/name *= *"//' -e 's/".*//' pyproject.toml` \
| sed -e "s:[^ ]*/[.][.]/\\([a-z][a-z]*\\)/:~/.local/\\1/:"
$(PYTHON) -m strip_python3 --version
fix-metadata-version:
ls dist/*
rm -rf dist.tmp; mkdir dist.tmp
cd dist.tmp; for z in ../dist/*; do case "$$z" in *.whl) unzip $$z ;; *) tar xzvf $$z;; esac \
; ( find . -name PKG-INFO ; find . -name METADATA ) | while read f; do echo FOUND $$f; sed -i -e "s/Metadata-Version: 2.4/Metadata-Version: 2.2/" $$f; done \
; case "$$z" in *.whl) zip -r $$z * ;; *) tar czvf $$z *;; esac ; ls -l $$z; done
tag:
@ ver=`sed -e '/^version *=/!d' -e 's/version *= *"//' -e 's/".*//' pyproject.toml` \
; rev=`$(GIT) rev-parse --short HEAD` \
; if test -f tmp.changes.txt \
; then echo ": ${GIT} tag -F tmp.changes.txt v$$ver $$rev" \
; elif test -f tmp.releasenotes.md \
; then echo ": ${GIT} tag -F tmp.releasenotes.md v$$ver $$rev" \
; elif test -f RELEASENOTES.md \
; then echo ": ${GIT} tag -F RELEASENOTES.md v$$ver $$rev" \
; else echo ": ${GIT} tag v$$ver $$rev"; fi
# .....................
copy:
cp -v ../docker-mirror-packages-repo/docker_mirror.py tests/
cp -v ../docker-mirror-packages-repo/docker_mirror.pyi tests/
cp -v ../docker-mirror-packages-repo/docker_image.py tests/
LOCAL=--local
DOCKER_IMAGE_PY = ./tests/docker_image.py
DOCKER_IMAGE = $(PYTHON3) $(DOCKER_IMAGE_PY) $(LOCAL)
python27: $(CONTAINER)/test27
python36: $(CONTAINER)/test36
python39: $(CONTAINER)/test39
python310: $(CONTAINER)/test310
python311: $(CONTAINER)/test311
python312: $(CONTAINER)/test312
python11: $(CONTAINER)/test11
$(CONTAINER)/testt27: ; $(DOCKER_IMAGE) FROM ubuntu:22.04 INTO $@ INSTALL "python3 psmisc python2" TEST "python2 --version"
$(CONTAINER)/testt36: ; $(DOCKER_IMAGE) FROM ubuntu:18.04 INTO $@ INSTALL "python3 psmisc" TEST "python3 --version"
$(CONTAINER)/test310: ; $(DOCKER_IMAGE) FROM ubuntu:22.04 INTO $@ INSTALL "python3 psmisc" TEST "python3 --version"
$(CONTAINER)/test312: ; $(DOCKER_IMAGE) FROM ubuntu:24.04 INTO $@ INSTALL "python3 psmisc" TEST "python3 --version"
$(CONTAINER)/test27: ; $(DOCKER_IMAGE) FROM opensuse/leap:15.6 INTO $@ SEARCH "setuptools mypy toml" INSTALL "python39 procps psmisc python2" TEST "$(PYTHON39) --version" TEST "python2 --version"
$(CONTAINER)/test36: ; $(DOCKER_IMAGE) FROM opensuse/leap:15.6 INTO $@ SEARCH "setuptools mypy toml" INSTALL "python39 python3" TEST "$(PYTHON39) --version" TEST "python3 --version"
$(CONTAINER)/test39: ; $(DOCKER_IMAGE) FROM opensuse/leap:15.6 INTO $@ SEARCH "setuptools mypy toml" INSTALL "procps psmisc python39" SYMLINK /usr/bin/python3.9:python3 TEST "$(PYTHON39) --version" TEST "python3 --version"
$(CONTAINER)/test311: ; $(DOCKER_IMAGE) FROM opensuse/leap:15.6 INTO $@ SEARCH "setuptools mypy toml" INSTALL "procps psmisc python311" SYMLINK /usr/bin/python3.11:python3 SYMLINK /usr/bin/python3.11:$(PYTHON39) TEST "$(PYTHON39) --version" TEST "python3 --version"
$(CONTAINER)/test11: ; $(DOCKER_IMAGE) FROM opensuse/leap:15.6 INTO $@ SEARCH "setuptools mypy toml" INSTALL "procps psmisc python311 python311-mypy" SYMLINK /usr/bin/python3.11:python3 SYMLINK /usr/bin/python3.11:$(PYTHON39) TEST "$(PYTHON39) --version" TEST "python3 --version" TEST "mypy-3.11 --version"
mypython: $(CONTAINER)/test11
python: stop python27 python36 python39 python311 python11
stop:
$(DOCKER) ps -q -f status=exited | xargs --no-run-if-empty $(DOCKER) rm
$(DOCKER) ps -q -f name=test | xargs --no-run-if-empty $(DOCKER) rm -f
$(DOCKER) ps -q -f name=-repo- | xargs --no-run-if-empty $(DOCKER) rm -f
# .....................
MYPY = mypy-$(PY3X)
MYPY_EXCLUDES = --exclude /$(notdir $(AST4_PY)) --exclude /$(notdir $(QTOML_PY))
MYPY_WITH = --strict --show-error-codes --show-error-context
MYPY_OPTIONS = --no-warn-unused-ignores --implicit-reexport --python-version $(PYTHON_VERSION)
mypy:
zypper install -y mypy
zypper install -y python3-click python3-pathspec
type:
$(MYPY) $(MYPY_WITH) $(MYPY_OPTIONS) $(MYPY_EXCLUDES) $F
$(MYPY) $(MYPY_WITH) $(MYPY_OPTIONS) $(MYPY_EXCLUDES) tests/*test*.py
tests/%.py.type:
$(MYPY) $(MYPY_WITH) $(MYPY_OPTIONS) $(MYPY_EXCLUDES) $(@:.type=)
PYLINT = pylint
PYLINT_OPTIONS =
pylint:
zypper install -y python3-pylint
lint:
$(PYLINT) $(PYLINT_OPTIONS) $F
for py in tests/*test*.py; do echo "#" $(PYLINT) $(PYLINT_OPTIONS) $$py; $(PYLINT) $(PYLINT_OPTIONS) $$py || exit 1; done
-include Makefile.tmp