88 - published
99
1010jobs :
11+ build_sdist :
12+ name : Build source distribution
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v2
16+ with :
17+ submodules : ' true'
18+ - uses : actions/setup-python@v2
19+
20+ - name : Install dependencies
21+ run : |
22+ python -m pip install --upgrade pip
23+ pip install pytest hypothesis mypy Cython==3.0.0a11
24+
25+ # The cythonized files allow installation from the sdist without cython
26+ - name : Generate cython
27+ run : |
28+ chmod +x ./src/Levenshtein/generate.sh
29+ ./src/Levenshtein/generate.sh
30+
31+ - name : Build sdist
32+ run : |
33+ git apply ./tools/sdist.patch
34+ pip install build
35+ python -m build --sdist
36+ # test whether tarball contains all files required for compiling
37+ pip install dist/Levenshtein-*.tar.gz -v
38+
39+ - name : Test type stubs
40+ run : |
41+ python -m mypy.stubtest Levenshtein --ignore-missing-stub
42+
43+ - name : Test with pytest and backtrace in case of SegFault
44+ run : |
45+ tools/seg_wrapper.sh pytest tests
46+
47+ - uses : actions/upload-artifact@v2
48+ with :
49+ path : dist/*.tar.gz
50+
1151 build_wheels_windows :
1252 name : Build wheel on windows-latest/${{matrix.arch}}/${{matrix.python_tag}}
53+ needs : [build_sdist]
1354 runs-on : windows-latest
1455 strategy :
1556 fail-fast : false
2566 - arch : auto32
2667 python_tag : " pp39-*"
2768
28- # PyPy Windows is currently broken in scikit-build
29- - arch : auto64
30- python_tag : " pp37-*"
31- - arch : auto64
32- python_tag : " pp38-*"
33- - arch : auto64
34- python_tag : " pp39-*"
3569 env :
3670 CIBW_BUILD : ${{matrix.python_tag}}
3771 CIBW_ARCHS : ${{matrix.arch}}
@@ -40,15 +74,17 @@ jobs:
4074 CIBW_BUILD_VERBOSITY : 3
4175
4276 steps :
43- - uses : actions/checkout @v2
77+ - uses : actions/download-artifact @v2
4478 with :
45- submodules : ' true'
79+ name : artifact
80+ path : dist
4681
4782 - uses : actions/setup-python@v2
4883
4984 - name : Build wheels
50- uses : pypa/cibuildwheel@v2.9.0
85+ uses : pypa/cibuildwheel@v2.10.1
5186 with :
87+ package-dir : dist/*.tar.gz
5288 output-dir : wheelhouse
5389
5490 - name : Upload wheels
@@ -58,12 +94,13 @@ jobs:
5894
5995 build_wheels_macos :
6096 name : Build wheel on macos-latest/${{matrix.arch}}/${{matrix.python_tag}}
97+ needs : [build_sdist]
6198 runs-on : macos-latest
6299 strategy :
63100 fail-fast : false
64101 matrix :
65102 arch : [x86_64, arm64, universal2]
66- python_tag : ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"]
103+ python_tag : ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "pp37-*", "pp38-*", "pp39-*" ]
67104 exclude :
68105 # MacOS Arm only supported since Python 3.8
69106 - arch : arm64
@@ -74,6 +111,20 @@ jobs:
74111 python_tag : " cp36-*"
75112 - arch : universal2
76113 python_tag : " cp37-*"
114+
115+ # PyPy not supported on MacOS Arm
116+ - arch : arm64
117+ python_tag : " pp37-*"
118+ - arch : arm64
119+ python_tag : " pp38-*"
120+ - arch : arm64
121+ python_tag : " pp39-*"
122+ - arch : universal2
123+ python_tag : " pp37-*"
124+ - arch : universal2
125+ python_tag : " pp38-*"
126+ - arch : universal2
127+ python_tag : " pp39-*"
77128 env :
78129 CIBW_BUILD : ${{matrix.python_tag}}
79130 CIBW_ARCHS : ${{matrix.arch}}
@@ -83,15 +134,17 @@ jobs:
83134 CIBW_BUILD_VERBOSITY : 3
84135
85136 steps :
86- - uses : actions/checkout @v2
137+ - uses : actions/download-artifact @v2
87138 with :
88- submodules : ' true'
139+ name : artifact
140+ path : dist
89141
90142 - uses : actions/setup-python@v2
91143
92144 - name : Build wheels
93- uses : pypa/cibuildwheel@v2.9.0
145+ uses : pypa/cibuildwheel@v2.10.1
94146 with :
147+ package-dir : dist/*.tar.gz
95148 output-dir : wheelhouse
96149
97150 - name : Upload wheels
@@ -101,6 +154,7 @@ jobs:
101154
102155 build_wheels_linux :
103156 name : Build wheels on ubuntu-latest/${{matrix.arch}}/${{matrix.python_tag}}
157+ needs : [build_sdist]
104158 runs-on : ubuntu-latest
105159 strategy :
106160 fail-fast : false
@@ -130,65 +184,27 @@ jobs:
130184 CIBW_BUILD_VERBOSITY : 3
131185
132186 steps :
133- - uses : actions/checkout @v2
187+ - uses : actions/download-artifact @v2
134188 with :
135- submodules : ' true'
189+ name : artifact
190+ path : dist
136191
137192 - uses : actions/setup-python@v2
138193
139194 - uses : docker/setup-qemu-action@v1
140195 name : Set up QEMU
141196
142197 - name : Build wheel
143- uses : pypa/cibuildwheel@v2.9.0
198+ uses : pypa/cibuildwheel@v2.10.1
144199 with :
200+ package-dir : dist/*.tar.gz
145201 output-dir : wheelhouse
146202
147203 - name : Upload wheels
148204 uses : actions/upload-artifact@v2
149205 with :
150206 path : ./wheelhouse/*.whl
151207
152- build_sdist :
153- name : Build source distribution
154- runs-on : ubuntu-latest
155- steps :
156- - uses : actions/checkout@v2
157- with :
158- submodules : ' true'
159- - uses : actions/setup-python@v2
160-
161- - name : Install dependencies
162- run : |
163- python -m pip install --upgrade pip
164- pip install pytest hypothesis mypy Cython==3.0.0a10
165-
166- # The cythonized files allow installation from the sdist without cython
167- - name : Generate cython
168- run : |
169- chmod +x ./src/Levenshtein/generate.sh
170- ./src/Levenshtein/generate.sh
171-
172- - name : Build sdist
173- run : |
174- git apply ./tools/sdist.patch
175- pip install build
176- python -m build --sdist
177- # test whether tarball contains all files required for compiling
178- pip install dist/Levenshtein-*.tar.gz
179-
180- - name : Test type stubs
181- run : |
182- python -m mypy.stubtest Levenshtein --ignore-missing-stub
183-
184- - name : Test with pytest and backtrace in case of SegFault
185- run : |
186- tools/seg_wrapper.sh pytest tests
187-
188- - uses : actions/upload-artifact@v2
189- with :
190- path : dist/*.tar.gz
191-
192208 deploy-wheels :
193209 if : github.event_name == 'release' && github.event.action == 'published'
194210 needs : [build_wheels_windows, build_wheels_macos, build_wheels_linux, build_sdist]
@@ -201,7 +217,7 @@ jobs:
201217 name : artifact
202218 path : dist
203219
204- - uses : pypa/gh-action-pypi-publish@master
220+ - uses : pypa/gh-action-pypi-publish@release/v1
205221 with :
206222 user : __token__
207223 password : ${{ secrets.pypi_password }}
0 commit comments