@@ -22,6 +22,45 @@ permissions:
22
22
contents : read
23
23
24
24
jobs :
25
+ build_sdist :
26
+ if : |
27
+ github.event_name == 'push' ||
28
+ github.event_name == 'pull_request' && (
29
+ (
30
+ github.event.action == 'labeled' &&
31
+ github.event.label.name == 'CI: Run cibuildwheel'
32
+ ) ||
33
+ contains(github.event.pull_request.labels.*.name,
34
+ 'CI: Run cibuildwheel')
35
+ )
36
+ name : Build sdist and wheel on ${{ matrix.os }}
37
+ runs-on : ubuntu-20.04
38
+
39
+ steps :
40
+ - uses : actions/checkout@v3
41
+ with :
42
+ fetch-depth : 0
43
+
44
+ # Something changed somewhere that prevents the downloaded-at-build-time
45
+ # licenses from being included in built wheels, so pre-download them so
46
+ # that they exist before the build and are included.
47
+ - name : Pre-download bundled licenses
48
+ run : >
49
+ curl -Lo LICENSE/LICENSE_QHULL
50
+ https://github.com/qhull/qhull/raw/2020.2/COPYING.txt
51
+
52
+ - name : Build sdist
53
+ run : pipx run build --sdist
54
+
55
+ - name : Check README rendering for PyPI
56
+ run : pipx run twine check dist/*
57
+
58
+ - name : Upload sdist result
59
+ uses : actions/upload-artifact@v3
60
+ with :
61
+ name : sdist
62
+ path : dist/*.tar.gz
63
+
25
64
build_wheels :
26
65
if : |
27
66
github.event_name == 'push' ||
@@ -30,21 +69,28 @@ jobs:
30
69
github.event.action == 'labeled' &&
31
70
github.event.label.name == 'CI: Run cibuildwheel'
32
71
) ||
33
- contains(github.event.pull_request.labels.*.name, 'CI: Run cibuildwheel')
72
+ contains(github.event.pull_request.labels.*.name,
73
+ 'CI: Run cibuildwheel')
34
74
)
75
+ needs : build_sdist
35
76
name : Build wheels on ${{ matrix.os }}
36
77
runs-on : ${{ matrix.os }}
37
78
env :
38
79
CIBW_BEFORE_BUILD : >-
39
80
pip install certifi oldest-supported-numpy &&
40
- git clean -fxd build
81
+ rm -rf {package} build
41
82
CIBW_BEFORE_BUILD_WINDOWS : >-
42
83
pip install certifi delvewheel oldest-supported-numpy &&
43
- git clean -fxd build
84
+ rm -rf {package}/ build
44
85
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS : >-
45
86
delvewheel repair -w {dest_dir} {wheel}
87
+ CIBW_AFTER_BUILD : twine check {wheel}
46
88
CIBW_MANYLINUX_X86_64_IMAGE : manylinux2014
47
89
CIBW_SKIP : " *-musllinux*"
90
+ CIBW_TEST_REQUIRES : oldest-supported-numpy
91
+ CIBW_TEST_COMMAND : >-
92
+ python {package}/ci/check_version_number.py &&
93
+ python {package}/ci/check_wheel_licenses.py
48
94
MACOSX_DEPLOYMENT_TARGET : " 10.12"
49
95
MPL_DISABLE_FH4 : " yes"
50
96
strategy :
@@ -66,47 +112,44 @@ jobs:
66
112
with :
67
113
platforms : arm64
68
114
69
- - uses : actions/checkout@v3
115
+ - name : Download sdist
116
+ uses : actions/download-artifact@v3
70
117
with :
71
- fetch-depth : 0
72
-
73
- # Something changed somewhere that prevents the downloaded-at-build-time
74
- # licenses from being included in built wheels, so pre-download them so
75
- # that they exist before the build and are included.
76
- - name : Pre-download bundled licenses
77
- run : >
78
- curl -Lo LICENSE/LICENSE_QHULL
79
- https://github.com/qhull/qhull/raw/2020.2/COPYING.txt
118
+ name : sdist
80
119
81
120
- name : Build wheels for CPython 3.11
82
121
122
+ with :
123
+ package-dir : dist/*.tar.gz
83
124
env :
84
125
CIBW_BUILD : " cp311-*"
85
126
CIBW_ARCHS : ${{ matrix.cibw_archs }}
86
127
87
128
- name : Build wheels for CPython 3.10
88
129
130
+ with :
131
+ package-dir : dist/*.tar.gz
89
132
env :
90
133
CIBW_BUILD : " cp310-*"
91
134
CIBW_ARCHS : ${{ matrix.cibw_archs }}
92
135
93
136
- name : Build wheels for CPython 3.9
94
137
138
+ with :
139
+ package-dir : dist/*.tar.gz
95
140
env :
96
141
CIBW_BUILD : " cp39-*"
97
142
CIBW_ARCHS : ${{ matrix.cibw_archs }}
98
143
99
144
- name : Build wheels for PyPy
100
145
146
+ with :
147
+ package-dir : dist/*.tar.gz
101
148
env :
102
149
CIBW_BUILD : " pp39-*"
103
150
CIBW_ARCHS : ${{ matrix.cibw_archs }}
104
151
if : matrix.cibw_archs != 'aarch64'
105
152
106
- - name : Validate that LICENSE files are included in wheels
107
- run : |
108
- python3 ./ci/check_wheel_licenses.py
109
-
110
153
- uses : actions/upload-artifact@v3
111
154
with :
112
155
name : wheels
0 commit comments