@@ -22,6 +22,59 @@ 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
37
+ runs-on :ubuntu-20.04
38
+ outputs :
39
+ SDIST_NAME :${{ steps.sdist.outputs.SDIST_NAME }}
40
+
41
+ steps :
42
+ -uses :actions/checkout@v3
43
+ with :
44
+ fetch-depth :0
45
+
46
+ -uses :actions/setup-python@v4
47
+ name :Install Python
48
+ with :
49
+ python-version :3.9
50
+
51
+ # Something changed somewhere that prevents the downloaded-at-build-time
52
+ # licenses from being included in built wheels, so pre-download them so
53
+ # that they exist before the build and are included.
54
+ -name :Pre-download bundled licenses
55
+ run :>
56
+ curl -Lo LICENSE/LICENSE_QHULL
57
+ https://github.com/qhull/qhull/raw/2020.2/COPYING.txt
58
+
59
+ -name :Install dependencies
60
+ run :python -m pip install build twine
61
+
62
+ -name :Build sdist
63
+ id :sdist
64
+ run :|
65
+ python -m build --sdist
66
+ python ci/export_sdist_name.py
67
+
68
+ -name :Check README rendering for PyPI
69
+ run :twine check dist/*
70
+
71
+ -name :Upload sdist result
72
+ uses :actions/upload-artifact@v3
73
+ with :
74
+ name :sdist
75
+ path :dist/*.tar.gz
76
+ if-no-files-found :error
77
+
25
78
build_wheels :
26
79
if :|
27
80
github.event_name == 'push' ||
@@ -30,21 +83,31 @@ jobs:
30
83
github.event.action == 'labeled' &&
31
84
github.event.label.name == 'CI: Run cibuildwheel'
32
85
) ||
33
- contains(github.event.pull_request.labels.*.name, 'CI: Run cibuildwheel')
86
+ contains(github.event.pull_request.labels.*.name,
87
+ 'CI: Run cibuildwheel')
34
88
)
89
+ needs :build_sdist
35
90
name :Build wheels on ${{ matrix.os }}
36
91
runs-on :${{ matrix.os }}
37
92
env :
38
93
CIBW_BEFORE_BUILD :>-
39
94
pip install certifi oldest-supported-numpy &&
40
- git clean -fxd build
95
+ rm -rf {package}/ build
41
96
CIBW_BEFORE_BUILD_WINDOWS :>-
42
97
pip install certifi delvewheel oldest-supported-numpy &&
43
- git clean -fxd build
98
+ rm -rf {package}/ build
44
99
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS :>-
45
100
delvewheel repair -w {dest_dir} {wheel}
101
+ CIBW_AFTER_BUILD :>-
102
+ twine check {wheel} &&
103
+ python {package}/ci/check_wheel_licenses.py {wheel}
46
104
CIBW_MANYLINUX_X86_64_IMAGE :manylinux2014
47
105
CIBW_SKIP :" *-musllinux*"
106
+ CIBW_TEST_COMMAND :>-
107
+ python {package}/ci/check_version_number.py
108
+ # Apple Silicon machines are not available for testing, so silence the
109
+ # warning from cibuildwheel. Remove the skip when they're available.
110
+ CIBW_TEST_SKIP :" *-macosx_arm64 *-macosx_universal2:arm64"
48
111
MACOSX_DEPLOYMENT_TARGET :" 10.12"
49
112
MPL_DISABLE_FH4 :" yes"
50
113
strategy :
@@ -66,47 +129,45 @@ jobs:
66
129
with :
67
130
platforms :arm64
68
131
69
- -uses :actions/checkout@v3
132
+ -name :Download sdist
133
+ uses :actions/download-artifact@v3
70
134
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
135
+ name :sdist
136
+ path :dist/
80
137
81
138
-name :Build wheels for CPython 3.11
82
139
uses :pypa/cibuildwheel@v2.13.0
140
+ with :
141
+ package-dir :dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
83
142
env :
84
143
CIBW_BUILD :" cp311-*"
85
144
CIBW_ARCHS :${{ matrix.cibw_archs }}
86
145
87
146
-name :Build wheels for CPython 3.10
88
147
uses :pypa/cibuildwheel@v2.13.0
148
+ with :
149
+ package-dir :dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
89
150
env :
90
151
CIBW_BUILD :" cp310-*"
91
152
CIBW_ARCHS :${{ matrix.cibw_archs }}
92
153
93
154
-name :Build wheels for CPython 3.9
94
155
uses :pypa/cibuildwheel@v2.13.0
156
+ with :
157
+ package-dir :dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
95
158
env :
96
159
CIBW_BUILD :" cp39-*"
97
160
CIBW_ARCHS :${{ matrix.cibw_archs }}
98
161
99
162
-name :Build wheels for PyPy
100
163
uses :pypa/cibuildwheel@v2.13.0
164
+ with :
165
+ package-dir :dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
101
166
env :
102
167
CIBW_BUILD :" pp39-*"
103
168
CIBW_ARCHS :${{ matrix.cibw_archs }}
104
169
if :matrix.cibw_archs != 'aarch64'
105
170
106
- -name :Validate that LICENSE files are included in wheels
107
- run :|
108
- python3 ./ci/check_wheel_licenses.py
109
-
110
171
-uses :actions/upload-artifact@v3
111
172
with :
112
173
name :wheels