@@ -21,50 +21,35 @@ jobs:
21
21
runs-on : ubuntu-latest
22
22
steps :
23
23
- uses : actions/checkout@v3
24
- with :
25
- submodules : recursive
26
24
27
25
- name : Set up Python
28
26
uses : actions/setup-python@v4
29
27
with :
30
- python-version : " >=3.10.0"
31
-
32
- - name : Verify QuadBLAS submodule
33
- run : |
34
- ls -la quaddtype/numpy_quaddtype/QBLAS/
35
- ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/
28
+ python-version : " >=3.11.0"
36
29
37
30
- name : Install cibuildwheel
38
- run : pip install cibuildwheel==2.20.0
31
+ run : pip install cibuildwheel==3.1.4
39
32
40
33
- name : Build wheels
41
34
env :
42
- CIBW_BUILD : " cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64"
35
+ CIBW_BUILD : " cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp313t-manylinux_x86_64 cp314-manylinux_x86_64 cp314t-manylinux_x86_64"
36
+ CIBW_ENABLE : cpython-prerelease cpython-freethreading
43
37
CIBW_MANYLINUX_X86_64_IMAGE : manylinux_2_28
44
38
CIBW_BUILD_VERBOSITY : " 3"
45
39
CIBW_BEFORE_ALL : |
46
40
yum update -y
47
41
yum install -y cmake gcc gcc-c++ make git pkgconfig
48
- # Install SLEEF in container
49
- git clone --branch 3.8 https://github.com/shibatch/sleef.git
50
- cd sleef
51
- cmake -S . -B build \
52
- -DSLEEF_BUILD_QUAD:BOOL=ON \
53
- -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \
54
- -DCMAKE_POSITION_INDEPENDENT_CODE=ON
55
- cmake --build build/ --clean-first -j
56
- cmake --install build --prefix /usr/local
57
42
CIBW_ENVIRONMENT : >
58
- CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS"
59
- CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include -fext-numeric-literals $CXXFLAGS"
60
- LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib -fopenmp $LDFLAGS"
61
- LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH"
62
- PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
43
+ LDFLAGS="-fopenmp"
63
44
CIBW_REPAIR_WHEEL_COMMAND : |
64
45
auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel}
65
46
CIBW_TEST_COMMAND : |
66
47
pip install {package}[test]
67
- pytest -s {project}/tests
48
+ if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then
49
+ pytest --parallel-threads=10 --iterations=10 {project}/tests
50
+ else
51
+ pytest -s {project}/tests
52
+ fi
68
53
CIBW_TEST_EXTRAS : " test"
69
54
run : |
70
55
python -m cibuildwheel --output-dir wheelhouse
@@ -80,63 +65,49 @@ jobs:
80
65
runs-on : ${{ matrix.os }}
81
66
strategy :
82
67
matrix :
83
- os : [macos-13 , macos-14 ]
68
+ os : [macos-14 , macos-15 ]
84
69
85
70
steps :
86
71
- uses : actions/checkout@v3
87
- with :
88
- submodules : recursive
89
72
90
73
- name : Set up Python
91
74
uses : actions/setup-python@v4
92
75
with :
93
- python-version : " 3.10 "
76
+ python-version : " >=3.11.0 "
94
77
95
78
- name : Install dependencies
96
79
run : |
97
- brew install cmake libomp git
98
-
99
- - name : Install SLEEF
100
- env :
101
- MACOSX_DEPLOYMENT_TARGET : ${{ matrix.os == 'macos-13' && '13.0' || '14.0' }}
102
- run : |
103
- git clone --branch 3.8 https://github.com/shibatch/sleef.git
104
- cd sleef
105
- cmake -S . -B build \
106
- -DSLEEF_BUILD_QUAD:BOOL=ON \
107
- -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \
108
- -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
109
- -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.os == 'macos-13' && '13.0' || '14.0' }} \
110
- -DCMAKE_INSTALL_RPATH="@loader_path/../lib" \
111
- -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
112
- cmake --build build/ --clean-first -j
113
- sudo cmake --install build --prefix /usr/local
114
-
115
- - name : Verify QuadBLAS submodule
80
+ packages="cmake libomp git"
81
+ echo "Remove preinstalled dependencies"
82
+ for pkg in $packages; do
83
+ brew uninstall --ignore-dependencies $pkg 2>/dev/null || true
84
+ done
85
+ brew cleanup
86
+ brew install $packages
87
+
88
+ - name : Installing Python dependencies
116
89
run : |
117
- ls -la quaddtype/numpy_quaddtype/QBLAS/
118
- ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/
119
-
120
- - name : Install cibuildwheel
121
- run : pip install cibuildwheel==2.20.0
90
+ pip install -U pip
91
+ pip install cibuildwheel==3.1.4
92
+ pip install pytest-run-parallel
122
93
123
94
- name : Build wheels
124
95
env :
125
- CIBW_BUILD : " cp310-* cp311-* cp312-*"
126
- CIBW_ARCHS_MACOS : ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }}
96
+ CIBW_BUILD : " cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*"
97
+ CIBW_ENABLE : cpython-prerelease cpython-freethreading
98
+ # CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }}
127
99
CIBW_BUILD_VERBOSITY : " 3"
128
100
CIBW_ENVIRONMENT : >
129
- MACOSX_DEPLOYMENT_TARGET="${{ matrix.os == 'macos-13' && '13.0' || '14.0' }}"
130
- DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH"
131
- CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS"
132
- CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CXXFLAGS"
133
- LDFLAGS="-L/usr/local/lib $LDFLAGS"
134
- PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
101
+ MACOSX_DEPLOYMENT_TARGET="${{ matrix.os == 'macos-14' && '14.0' || '15.0' }}"
135
102
CIBW_REPAIR_WHEEL_COMMAND : >
136
103
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
137
104
CIBW_TEST_COMMAND : |
138
105
pip install {package}[test]
139
- pytest -s {project}/tests
106
+ if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then
107
+ pytest --parallel-threads=10 --iterations=10 {project}/tests
108
+ else
109
+ pytest -s {project}/tests
110
+ fi
140
111
CIBW_TEST_EXTRAS : " test"
141
112
run : |
142
113
python -m cibuildwheel --output-dir wheelhouse
@@ -157,67 +128,44 @@ jobs:
157
128
158
129
steps :
159
130
- uses : actions/checkout@v3
160
- with :
161
- submodules : recursive
162
131
163
132
- name : Setup MSVC
164
133
uses : ilammy/msvc-dev-cmd@v1
165
134
with :
166
135
arch : ${{ matrix.architecture }}
167
136
168
- - name : Set up Python 3.10
137
+ - name : Set up Python
169
138
uses : actions/setup-python@v4
170
139
with :
171
- python-version : " 3.10 "
140
+ python-version : " >=3.11.0 "
172
141
architecture : ${{ matrix.architecture }}
173
142
174
143
- name : Install CMake
175
144
uses : lukka/get-cmake@latest
176
145
177
- - name : Verify QuadBLAS submodule
178
- shell : pwsh
179
- run : |
180
- Get-ChildItem quaddtype/numpy_quaddtype/QBLAS/
181
- Get-ChildItem quaddtype/numpy_quaddtype/QBLAS/include/quadblas/
182
-
183
- - name : Clone and Build SLEEF
184
- shell : pwsh
185
- run : |
186
- git clone --branch 3.8 https://github.com/shibatch/sleef.git
187
- cd sleef
188
- cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture == 'x86' && 'Win32' || 'x64' }} -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
189
- cmake --build build --config Release
190
- cmake --install build --prefix "C:/sleef" --config Release
191
-
192
146
- name : Install build dependencies
193
147
shell : bash -l {0}
194
148
run : |
195
149
pip install -U pip
196
- pip install cibuildwheel==2.20.0 ninja meson meson-python numpy delvewheel pytest
150
+ pip install cibuildwheel==3.1.4 ninja meson meson-python numpy delvewheel pytest
197
151
198
152
- name : Build wheels
199
153
env :
200
- CIBW_BUILD : " cp310-* cp311-* cp312-*"
201
- CIBW_SKIP : " pp* cp36-* cp37-* cp38-* cp39-* cp313-*"
154
+ CIBW_BUILD : " cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*"
155
+ CIBW_ENABLE : cpython-prerelease cpython-freethreading
156
+ CIBW_SKIP : " pp* cp36-* cp37-* cp38-* cp39-*"
202
157
CIBW_ARCHS_WINDOWS : ${{ matrix.architecture == 'x86' && 'x86' || 'AMD64' }}
203
158
CIBW_BUILD_VERBOSITY : " 3"
204
159
DISTUTILS_USE_SDK : " 1"
205
160
MSSdk : " 1"
206
161
CIBW_BEFORE_BUILD : |
207
162
pip install meson meson-python ninja numpy
208
163
CIBW_ENVIRONMENT : >
209
- INCLUDE="C:/sleef/include;{project}/numpy_quaddtype/QBLAS/include;$INCLUDE"
210
- LIB="C:/sleef/lib;$LIB"
211
- PATH="C:/sleef/bin;$PATH"
212
- CFLAGS="/IC:/sleef/include /I{project}/numpy_quaddtype/QBLAS/include /DDISABLE_QUADBLAS $CFLAGS"
213
- CXXFLAGS="/IC:/sleef/include /I{project}/numpy_quaddtype/QBLAS/include /DDISABLE_QUADBLAS $CXXFLAGS"
214
- LDFLAGS="C:/sleef/lib/sleef.lib C:/sleef/lib/sleefquad.lib $LDFLAGS"
164
+ CFLAGS="/DDISABLE_QUADBLAS $CFLAGS"
165
+ CXXFLAGS="/DDISABLE_QUADBLAS $CXXFLAGS"
215
166
CIBW_REPAIR_WHEEL_COMMAND : ' delvewheel repair -w {dest_dir} {wheel} --add-path C:\sleef\bin'
216
- CIBW_TEST_COMMAND : |
217
- pip install {package}[test]
218
- pytest -s {project}/tests
167
+ CIBW_TEST_COMMAND_WINDOWS : pip install {package}[test] && pytest -s {project}/tests
219
168
CIBW_TEST_EXTRAS : test
220
- CIBW_TEST_FAIL_FAST : 1
221
169
shell : pwsh
222
170
run : |
223
171
python -m cibuildwheel --output-dir wheelhouse
@@ -229,9 +177,51 @@ jobs:
229
177
path : ./quaddtype/wheelhouse/*.whl
230
178
name : wheels-windows-${{ matrix.architecture }}
231
179
180
+ build_sdist :
181
+ name : Build SDist
182
+ runs-on : ubuntu-latest
183
+ steps :
184
+ - uses : actions/checkout@v3
185
+
186
+ - name : Set up Python
187
+ uses : actions/setup-python@v4
188
+ with :
189
+ python-version : " >=3.11.0"
190
+
191
+ - name : Install system dependencies
192
+ run : |
193
+ sudo apt-get update -y
194
+ sudo apt-get install -y cmake gcc g++ make git pkg-config
195
+
196
+ - name : Install build dependencies
197
+ run : |
198
+ python -m pip install --upgrade pip
199
+ python -m pip install build pytest
200
+
201
+ - name : Build SDist & test sdist
202
+ env :
203
+ LDFLAGS : " -fopenmp"
204
+ run : |
205
+ python -m build --sdist --outdir dist/
206
+ pip install dist/*.tar.gz -v
207
+ pytest -s tests
208
+ working-directory : ./quaddtype
209
+
210
+ - name : Upload SDist artifact
211
+ uses : actions/upload-artifact@v4
212
+ with :
213
+ name : sdist
214
+ path : ./quaddtype/dist/*.tar.gz
215
+
232
216
publish_to_pypi :
233
217
name : Publish to PyPI
234
- needs : [build_wheels_linux, build_wheels_macos, build_wheels_windows]
218
+ needs :
219
+ [
220
+ build_wheels_linux,
221
+ build_wheels_macos,
222
+ build_wheels_windows,
223
+ build_sdist,
224
+ ]
235
225
runs-on : ubuntu-latest
236
226
if : startsWith(github.ref, 'refs/tags/quaddtype-v')
237
227
@@ -246,9 +236,9 @@ jobs:
246
236
- name : Download all workflow run artifacts
247
237
uses : actions/download-artifact@v4
248
238
with :
239
+ pattern : " *"
249
240
path : dist
241
+ merge-multiple : true
250
242
251
243
- name : Publish to PyPI
252
244
uses : pypa/gh-action-pypi-publish@release/v1
253
- with :
254
- packages-dir : dist/*
0 commit comments