94
94
os : [macos-latest]
95
95
cibw_python : [ "cp38-*", "cp39-*", "cp310-*" , "cp311-*" ]
96
96
cibw_arch : [ "x86_64", "arm64"]
97
- env :
98
- MACOSX_DEPLOYMENT_TARGET : " 10.13"
99
97
steps :
100
98
- uses : actions/checkout@v3
101
99
with :
@@ -109,20 +107,25 @@ jobs:
109
107
- name : Install cibuildwheel
110
108
run : |
111
109
python -m pip install cibuildwheel
110
+
112
111
- name : Build wheels for CPython (MacOS)
113
112
run : |
113
+ # We need to set both MACOS_DEPLOYMENT_TARGET and MACOSX_DEPLOYMENT_TARGET
114
+ # until there is a new release with this commit:
115
+ # https://github.com/mesonbuild/meson-python/pull/309 (should be in 0.13.0)
116
+ if [[ "$CIBW_ARCHS_MACOS" == arm64 ]]; then
117
+ export MACOSX_DEPLOYMENT_TARGET=11.0
118
+ export MACOS_DEPLOYMENT_TARGET=11.0
119
+ else
120
+ export MACOSX_DEPLOYMENT_TARGET=10.13
121
+ export MACOS_DEPLOYMENT_TARGET=10.13
122
+ fi
123
+ echo MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
124
+
114
125
python -m cibuildwheel --output-dir dist
115
126
env :
116
127
CIBW_BUILD : ${{ matrix.cibw_python }}
117
128
CIBW_ARCHS_MACOS : ${{ matrix.cibw_arch }}
118
- CIBW_MANYLINUX_X86_64_IMAGE : manylinux1
119
- CIBW_MANYLINUX_I686_IMAGE : manylinux1
120
- CC : /usr/bin/clang
121
- CXX : /usr/bin/clang++
122
- # CPPFLAGS: "-Xpreprocessor -fopenmp"
123
- # CFLAGS: "-Wno-implicit-function-declaration -I/usr/local/opt/libomp/include"
124
- # CXXFLAGS: "-I/usr/local/opt/libomp/include"
125
- # LDFLAGS: "-Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"
126
129
127
130
- uses : actions/upload-artifact@v3
128
131
with :
@@ -138,10 +141,6 @@ jobs:
138
141
os : [windows-latest]
139
142
cibw_arch : ["AMD64", "x86"]
140
143
cibw_python : ["cp38-*", "cp39-*", "cp310-*", "cp311-*"]
141
- # exclude:
142
- # - os: windows-latest
143
- # cibw_python: "cp310-*"
144
- # cibw_arch: x86
145
144
steps :
146
145
- uses : actions/checkout@v3
147
146
with :
@@ -155,14 +154,51 @@ jobs:
155
154
- name : Install cibuildwheel
156
155
run : |
157
156
python -m pip install cibuildwheel
158
- - name : Build Windows wheels for CPython
157
+
158
+ - name : Build x86-64 (64-bit) Windows wheels for CPython
159
+ if : matrix.cibw_arch == 'AMD64'
160
+ # From https://github.com/actions/virtual-environments/issues/294#issuecomment-588090582,
161
+ # with additional -arch=amd64 flag to vsdevcmd.bat. Fix synced from scikit-image.
159
162
run : |
163
+ function Invoke-VSDevEnvironment {
164
+ $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
165
+ $installationPath = & $vswhere -prerelease -legacy -latest -property installationPath
166
+ $Command = Join-Path $installationPath "Common7\Tools\vsdevcmd.bat"
167
+ & "${env:COMSPEC}" /s /c "`"$Command`" -arch=amd64 -no_logo && set" | Foreach-Object {
168
+ if ($_ -match '^([^=]+)=(.*)') {
169
+ [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2])
170
+ }
171
+ }
172
+ }
173
+ Invoke-VSDevEnvironment
174
+ Get-Command rc.exe | Format-Table -AutoSize
175
+
176
+ python -m cibuildwheel --output-dir dist
177
+ env :
178
+ CIBW_BUILD : ${{ matrix.cibw_python }}
179
+ CIBW_ARCHS_WINDOWS : ${{ matrix.cibw_arch }}
180
+
181
+ - name : Build x86 (32-bit) Windows wheels for CPython
182
+ if : matrix.cibw_arch == 'x86'
183
+ # Same as above, but without `-arch=amd64` target arch selection argument
184
+ run : |
185
+ function Invoke-VSDevEnvironment {
186
+ $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
187
+ $installationPath = & $vswhere -prerelease -legacy -latest -property installationPath
188
+ $Command = Join-Path $installationPath "Common7\Tools\vsdevcmd.bat"
189
+ & "${env:COMSPEC}" /s /c "`"$Command`" -no_logo && set" | Foreach-Object {
190
+ if ($_ -match '^([^=]+)=(.*)') {
191
+ [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2])
192
+ }
193
+ }
194
+ }
195
+ Invoke-VSDevEnvironment
196
+ Get-Command rc.exe | Format-Table -AutoSize
197
+
160
198
python -m cibuildwheel --output-dir dist
161
199
env :
162
200
CIBW_BUILD : ${{ matrix.cibw_python }}
163
201
CIBW_ARCHS_WINDOWS : ${{ matrix.cibw_arch }}
164
- CIBW_MANYLINUX_X86_64_IMAGE : manylinux1
165
- CIBW_MANYLINUX_I686_IMAGE : manylinux1
166
202
167
203
- uses : actions/upload-artifact@v3
168
204
with :
@@ -198,12 +234,12 @@ jobs:
198
234
- name : Publish the source distribution on PyPI
199
235
run : |
200
236
PYWT_VERSION=$(git describe --tags)
201
- python setup.py sdist
237
+ python -m build -- sdist
202
238
ls -la ${{ github.workspace }}/dist
203
239
# We prefer to release wheels before source because otherwise there is a
204
240
# small window during which users who pip install pywt will require compilation.
205
241
twine upload ${{ github.workspace }}/dist/*.whl
206
- twine upload ${{ github.workspace }}/dist/PyWavelets -${PYWT_VERSION:1}.tar.gz
242
+ twine upload ${{ github.workspace }}/dist/pywavelets -${PYWT_VERSION:1}.tar.gz
207
243
env :
208
244
TWINE_USERNAME : __token__
209
245
TWINE_PASSWORD : ${{ secrets.TWINE_TOKEN }}
0 commit comments