-
Notifications
You must be signed in to change notification settings - Fork 154
/
Copy pathMakefile
78 lines (64 loc) · 1.73 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
DEFAULT_TEST_PY_VER = 3.10
PY_VERSIONS = 3.7 3.8 3.9 3.10 3.11 3.12 3.13
.PHONY: help test attach
help:
@printf "Usage: make [OPTION]\n"
@printf "\n"
@printf "test-all\n"
@printf "test [version: 3.7|3.8|3.9|3.10|...]\n"
@printf "attach [version: 3.7|3.8|3.9|3.10|...]\n"
@printf "run-example-django\n"
@printf "build-dist\n"
@printf "upload-dist\n"
@printf "upload-dist-for-test\n"
@printf "install {ENV: PASSPHRASE=}\n"
@printf "testpypi-install {ENV: VERSION= PASSPHRASE=}\n"
clean:
find . -type f -name "*.pyc" -exec rm -f {} \;
test:
VER="$(filter-out $@,$(MAKECMDGOALS))"; \
if [ -z "$$VER" ]; then \
VER="$(DEFAULT_TEST_PY_VER)"; \
fi; \
\
PY_VER=$$VER ./bin/run-test.sh
test-all :
for ver in $(PY_VERSIONS); do \
PY_VER=$$ver ./bin/run-test.sh || exit 1; \
done
attach:
VER="$(filter-out $@,$(MAKECMDGOALS))"; \
if [ -z "$$VER" ]; then \
VER="$(DEFAULT_TEST_PY_VER)"; \
fi; \
\
PY_VER=$$VER ./bin/run-test.sh attach
run-example-django:
./bin/run-example-django.sh
install:
python3 -m pip install \
--no-cache-dir \
-v \
. \
-Csetup-args="-Dpassphrase=$(PASSPHRASE)"
build-dist:
rm -rf dist/
if [ -z "$$(git status --porcelain --untracked-files=no)" ]; then \
python -m build --sdist -Csetup-args="-Dpassphrase=__DUMMY__" ; \
else \
echo "Please stash your local modification before build dist ..."; \
fi;
upload-dist:
twine upload dist/*
upload-dist-for-test:
twine upload -r testpypi dist/*
testpypi-install:
python3 -m pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
--no-cache-dir \
pyconcrete==$(VERSION) \
-Csetup-args="-Dpassphrase=$(PASSPHRASE)"
# prevent error when assign extra argument for target
%:
@: