forked from jameslamb/pydistcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
100 lines (87 loc) · 1.83 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
.PHONY: build
build:
rm -r ./dist || true
pipx run build --sdist --wheel
.PHONY: check-test-packages
check-test-packages:
docker run \
--rm \
-v "$${PWD}/tests/data":/opt/test-packages:ro \
-v "$${PWD}/bin":/ci-scripts \
--workdir /ci-scripts \
-it python:3.11 \
./check-test-packages.sh /opt/test-packages
.PHONY: check-wheels
check-dists:
gunzip -t dist/*.tar.gz
zip -T dist/*.whl
check-wheel-contents dist/*.whl
pyroma --min=10 dist/*.tar.gz
twine check --strict dist/*
.PHONY: clean
clean:
rm -rf ./tmp-dir
rm -rf ./tests/data/baseballmetrics/dist
rm -rf ./tests/data/baseballmetrics/baseballmetrics.egg-info
rm -rf ./tests/data/baseballmetrics/_skbuild
.PHONY: format
format:
isort .
black .
.PHONY: install
install:
pipx install --force .
.PHONY: lint
lint:
shellcheck \
--exclude=SC2002 \
bin/*.sh
black \
--check \
.
ruff check .
mypy ./src
mypy ./tests/data
.PHONY: linux-wheel
linux-wheel:
docker run \
--rm \
-v $$(pwd):/usr/local/src \
--workdir /usr/local/src \
--entrypoint="" \
-it quay.io/pypa/manylinux_2_28_x86_64 \
bin/create-test-data-bdist.sh
.PHONY: mac-wheel
mac-wheel:
bin/create-test-data-bdist.sh
.PHONY: smoke-tests
smoke-tests:
@bash ./bin/run-smoke-tests.sh
.PHONY: test-data-sdist
test-data-sdist:
docker run \
--rm \
-v $$(pwd):/usr/local/src \
--workdir /usr/local/src \
--entrypoint="" \
-it python:3.10 \
bash -c "apt-get update && apt-get install -y --no-install-recommends ca-certificates curl zip && bin/create-test-data-sdist.sh"
.PHONY: test-data-bdist
test-data-bdist: \
linux-wheel \
mac-wheel
.PHONY: test
test:
pytest \
--cov pydistcheck \
--cov-fail-under=99 \
./tests
.PHONY: test-local
test-local:
PYTHONPATH=src \
pytest \
--cov=src/pydistcheck \
--cov-fail-under=99 \
--cov-report="term" \
--cov-report="html:htmlcov" \
./tests