-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
103 lines (89 loc) · 2.23 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
.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:latest \
./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: install
install:
pipx install --force '.[conda]'
.PHONY: lint
lint:
pre-commit run --all-files
yamllint \
--strict \
-d '{extends: default, rules: {braces: {max-spaces-inside: 1}, truthy: {check-keys: false}, line-length: {max: 120}}}' \
.
.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 \
test-data-macos-conda-tarbz2-packages \
test-data-conda-dot-conda-packages
# NOTE: .bz2 packages were created with conda-build 3.27.0
.PHONY: test-data-conda-packages
test-data-macos-conda-tarbz2-packages:
bin/create-test-data-conda.sh 'osx-64'
.PHONY: test-data-conda-dot-conda-packages
test-data-conda-dot-conda-packages:
cph transmute \
--out-folder ./tests/data \
'./tests/data/*-0.tar.bz2' \
'.conda'
.PHONY: test
test:
pytest \
--cov pydistcheck \
./tests
.PHONY: test-local
test-local:
PYTHONPATH=src \
pytest \
--cov=src/pydistcheck \
--cov-report="term" \
--cov-report="html:htmlcov" \
./tests