@@ -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/determine_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,27 @@ 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 : twine check {wheel}
46
102
CIBW_MANYLINUX_X86_64_IMAGE : manylinux2014
47
103
CIBW_SKIP : " *-musllinux*"
104
+ CIBW_TEST_COMMAND : >-
105
+ python {package}/ci/check_version_number.py &&
106
+ python {package}/ci/check_wheel_licenses.py
48
107
MACOSX_DEPLOYMENT_TARGET : " 10.12"
49
108
MPL_DISABLE_FH4 : " yes"
50
109
strategy :
@@ -66,47 +125,45 @@ jobs:
66
125
with :
67
126
platforms : arm64
68
127
69
- - uses : actions/checkout@v3
128
+ - name : Download sdist
129
+ uses : actions/download-artifact@v3
70
130
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
131
+ name : sdist
132
+ path : dist/
80
133
81
134
- name : Build wheels for CPython 3.11
82
135
uses : pypa/cibuildwheel@v2.12.1
136
+ with :
137
+ package-dir : dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
83
138
env :
84
139
CIBW_BUILD : " cp311-*"
85
140
CIBW_ARCHS : ${{ matrix.cibw_archs }}
86
141
87
142
- name : Build wheels for CPython 3.10
88
143
uses : pypa/cibuildwheel@v2.12.1
144
+ with :
145
+ package-dir : dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
89
146
env :
90
147
CIBW_BUILD : " cp310-*"
91
148
CIBW_ARCHS : ${{ matrix.cibw_archs }}
92
149
93
150
- name : Build wheels for CPython 3.9
94
151
uses : pypa/cibuildwheel@v2.12.1
152
+ with :
153
+ package-dir : dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
95
154
env :
96
155
CIBW_BUILD : " cp39-*"
97
156
CIBW_ARCHS : ${{ matrix.cibw_archs }}
98
157
99
158
- name : Build wheels for PyPy
100
159
uses : pypa/cibuildwheel@v2.12.1
160
+ with :
161
+ package-dir : dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
101
162
env :
102
163
CIBW_BUILD : " pp39-*"
103
164
CIBW_ARCHS : ${{ matrix.cibw_archs }}
104
165
if : matrix.cibw_archs != 'aarch64'
105
166
106
- - name : Validate that LICENSE files are included in wheels
107
- run : |
108
- python3 ./ci/check_wheel_licenses.py
109
-
110
167
- uses : actions/upload-artifact@v3
111
168
with :
112
169
name : wheels
0 commit comments