9494 os : [macos-latest]
9595 cibw_python : [ "cp38-*", "cp39-*", "cp310-*" , "cp311-*" ]
9696 cibw_arch : [ "x86_64", "arm64"]
97- env :
98- MACOSX_DEPLOYMENT_TARGET : " 10.13"
9997 steps :
10098 - uses : actions/checkout@v3
10199 with :
@@ -109,20 +107,25 @@ jobs:
109107 - name : Install cibuildwheel
110108 run : |
111109 python -m pip install cibuildwheel
110+
112111 - name : Build wheels for CPython (MacOS)
113112 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+
114125 python -m cibuildwheel --output-dir dist
115126 env :
116127 CIBW_BUILD : ${{ matrix.cibw_python }}
117128 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"
126129
127130 - uses : actions/upload-artifact@v3
128131 with :
@@ -138,10 +141,6 @@ jobs:
138141 os : [windows-latest]
139142 cibw_arch : ["AMD64", "x86"]
140143 cibw_python : ["cp38-*", "cp39-*", "cp310-*", "cp311-*"]
141- # exclude:
142- # - os: windows-latest
143- # cibw_python: "cp310-*"
144- # cibw_arch: x86
145144 steps :
146145 - uses : actions/checkout@v3
147146 with :
@@ -155,14 +154,51 @@ jobs:
155154 - name : Install cibuildwheel
156155 run : |
157156 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.
159162 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+
160198 python -m cibuildwheel --output-dir dist
161199 env :
162200 CIBW_BUILD : ${{ matrix.cibw_python }}
163201 CIBW_ARCHS_WINDOWS : ${{ matrix.cibw_arch }}
164- CIBW_MANYLINUX_X86_64_IMAGE : manylinux1
165- CIBW_MANYLINUX_I686_IMAGE : manylinux1
166202
167203 - uses : actions/upload-artifact@v3
168204 with :
@@ -198,12 +234,12 @@ jobs:
198234 - name : Publish the source distribution on PyPI
199235 run : |
200236 PYWT_VERSION=$(git describe --tags)
201- python setup.py sdist
237+ python -m build -- sdist
202238 ls -la ${{ github.workspace }}/dist
203239 # We prefer to release wheels before source because otherwise there is a
204240 # small window during which users who pip install pywt will require compilation.
205241 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
207243 env :
208244 TWINE_USERNAME : __token__
209245 TWINE_PASSWORD : ${{ secrets.TWINE_TOKEN }}
0 commit comments