66 upload :
77 description : ' Upload to PyPI'
88 type : boolean
9+ required : false
910 default : false
1011
1112 python-version :
12- description : ' Python version to run against'
13- required : true
13+ description : ' Python version to run on'
1414 type : string
15- default : " 1.13"
15+ required : true
16+ default : " 3.13"
1617
1718 target :
18- type : string
1919 description : " target os to build for: linux,macos,windows"
20- default : " linux,macos,windows"
21-
22- cibw-skip :
2320 type : string
24- description : ' CIBUILDWHEEL builds pattern to skip, goes to CIBW_SKIP env'
2521 required : false
26- default : ' cp36* cp37* pp*i686 *musllinux*'
27-
28- env :
29- CIBW_TEST_COMMAND_LINUX : >
30- pytest {project}/tests/unit &&
31- EVENT_LOOP_MANAGER=gevent pytest {project}/tests/unit/io/test_geventreactor.py
32-
33- CIBW_TEST_COMMAND_MACOS : " pytest {project}/tests/unit -k 'not (test_multi_timer_validation or test_empty_connections or test_timer_cancellation)' "
34- CIBW_TEST_COMMAND_WINDOWS : " pytest {project}/tests/unit -k \" not (test_deserialize_date_range_year or test_datetype or test_libevreactor)\" "
35- CIBW_BEFORE_TEST : " pip install -r {project}/test-requirements.txt"
36- CIBW_BEFORE_BUILD_LINUX : " rm -rf ~/.pyxbld && rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux && yum install -y libffi-devel libev libev-devel openssl openssl-devel"
37- CIBW_ENVIRONMENT : " CASS_DRIVER_BUILD_CONCURRENCY=2 CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST=yes CFLAGS='-g0 -O3'"
38- CIBW_SKIP : cp36* cp37* pp*i686 *musllinux*
39- CIBW_MANYLINUX_X86_64_IMAGE : manylinux_2_28
40- CIBW_MANYLINUX_PYPY_X86_64_IMAGE : manylinux_2_28
41- CIBW_MANYLINUX_AARCH64_IMAGE : manylinux_2_28
42- CIBW_MANYLINUX_PYPY_AARCH64_IMAGE : manylinux_2_28
22+ default : " linux,macos-x86,macos-arm,windows,linux-aarch64"
4323
4424jobs :
4525 prepare-matrix :
@@ -53,19 +33,27 @@ jobs:
5333 run : |
5434 echo -n "[" > /tmp/matrix.json
5535 was_added=""
56- for os in $(echo "${{ inputs.target }}" | tr -d " " | tr "," "\n")
36+ for target in $(echo "${{ inputs.target }}" | tr -d " " | tr "," "\n")
5737 do
58- if [[ "${os}" == "linux" ]]; then
38+ if [[ "${target}" == "linux" ]]; then
39+ [ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
40+ echo -n '{"os":"ubuntu-20.04", "target": "linux"}' >> /tmp/matrix.json
41+ was_added=1
42+ elif [[ "${target}" == "linux-aarch64" ]]; then
5943 [ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
60- echo -n '{"os":"ubuntu-20.04","platform":"x86_64"},{"os":"ubuntu-20.04","platform":"PyPy "}' >> /tmp/matrix.json
44+ echo -n '{"os":"ubuntu-20.04", "target": "linux-aarch64 "}' >> /tmp/matrix.json
6145 was_added=1
62- elif [[ "${os }" == "windows" ]]; then
46+ elif [[ "${target }" == "windows" ]]; then
6347 [ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
64- echo -n '{"os":"windows-latest","platform":"win64"},{"os":" windows-latest","platform":"PyPy "}' >> /tmp/matrix.json
48+ echo -n '{"os":"windows-2022", "target": " windows"}' >> /tmp/matrix.json
6549 was_added=1
66- elif [[ "${os }" == "macos" ]]; then
50+ elif [[ "${target }" == "macos-x86 " ]]; then
6751 [ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
68- echo -n '{"os":"macos-latest","platform":"all"},{"os":"macos-13","platform":"all"},{"os":"macos-latest","platform":"PyPy"}' >> /tmp/matrix.json
52+ echo -n '{"os":"macos-13", "target": "macos-x86"}' >> /tmp/matrix.json
53+ was_added=1
54+ elif [[ "${target}" == "macos-arm" ]]; then
55+ [ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
56+ echo -n '{"os":"macos-14", "target": "macos-arm"}' >> /tmp/matrix.json
6957 was_added=1
7058 fi
7159 done
@@ -74,32 +62,13 @@ jobs:
7462 echo "matrix=$(cat /tmp/matrix.json)" >> $GITHUB_OUTPUT
7563
7664 build-wheels :
77- name : Build wheels ${{ matrix.os }} ( ${{ matrix.platform }})
65+ name : Build wheels for ${{ matrix.target }} on ${{ matrix.os }}
7866 runs-on : ${{ matrix.os }}
67+ needs : prepare-matrix
7968 strategy :
8069 fail-fast : false
8170 matrix :
82- include :
83- - os : ubuntu-24.04
84- platform : x86_64
85-
86- - os : ubuntu-24.04
87- platform : PyPy
88-
89- - os : windows-2022
90- platform : win64
91-
92- - os : windows-latest
93- platform : PyPy
94-
95- - os : macos-14
96- platform : all
97-
98- - os : macos-13
99- platform : all
100-
101- - os : macos-latest
102- platform : PyPy
71+ include : ${{ fromJson(needs.prepare-matrix.outputs.matrix) }}
10372
10473 steps :
10574 - uses : actions/checkout@v4
@@ -122,13 +91,20 @@ jobs:
12291 - name : Install OpenSSL for Windows
12392 if : runner.os == 'Windows'
12493 run : |
125- choco install openssl --version=3.4.1 -f -y
94+ choco install openssl --version=3.4.1 -f -y --no-progress
95+
96+ - name : Set up QEMU
97+ if : matrix.target == 'linux-aarch64'
98+ uses : docker/setup-qemu-action@v3
99+ with :
100+ platforms : all
101+ image : ' docker.io/tonistiigi/binfmt:desktop-v8.1.5'
126102
127103 - name : Install Conan
128104 if : runner.os == 'Windows'
129105 uses : turtlebrowser/get-conan@main
130106
131- - name : configure libev for Windows
107+ - name : Configure libev for Windows
132108 if : runner.os == 'Windows'
133109 run : |
134110 conan profile detect
@@ -139,57 +115,31 @@ jobs:
139115 run : |
140116 brew install libev
141117
142- - name : Overwrite for Linux 64
143- if : runner.os == 'Linux' && matrix.platform == 'x86_64'
144- run : |
145- echo "CIBW_BUILD=cp3*_x86_64" >> $GITHUB_ENV
146-
147- - name : Overwrite for Linux PyPy
148- if : runner.os == 'Linux' && matrix.platform == 'PyPy'
118+ - name : Overwrite for MacOS
119+ if : runner.os == 'MacOS'
149120 run : |
150- echo "CIBW_BUILD=pp*" >> $GITHUB_ENV
151- echo "CIBW_TEST_COMMAND_LINUX=" >> $GITHUB_ENV
152-
153- - name : Overwrite for Windows 64
154- if : runner.os == 'Windows' && matrix.platform == 'win64'
155- run : |
156- echo "CIBW_BUILD=cp*win_amd64" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
157- echo "CIBW_ENVIRONMENT_WINDOWS= CC=clang CXX=clang++" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
158-
159- - name : Overwrite for Windows PyPY
160- if : runner.os == 'Windows' && matrix.platform == 'PyPy'
161- run : |
162- echo "CIBW_BUILD=pp*" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
163- echo "CIBW_TEST_COMMAND_WINDOWS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
164-
165- - name : Overwrite for MacOs
166- if : runner.os == 'MacOs' && matrix.platform == 'all'
167- run : |
168- echo "CIBW_BUILD=cp39* cp310* cp311* cp312* cp313*" >> $GITHUB_ENV
169- echo "CIBW_BEFORE_TEST_MACOS=pip install -r {project}/test-requirements.txt pytest" >> $GITHUB_ENV
121+ ##### Set MACOSX_DEPLOYMENT_TARGET
170122 if [ "${{ matrix.os }}" == "macos-13" ]; then
171123 echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV;
172124 echo "Enforcing target deployment for 13.0"
173125 elif [ "${{ matrix.os }}" == "macos-14" ]; then
174126 echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV;
175127 echo "Enforcing target deployment for 14.0"
176- else
177- echo "Unknown macos version" && false;
178128 fi
179- - name : Overwrite for MacOs PyPy
180- if : runner.os == 'MacOs' && matrix.platform == 'PyPy'
181- run : |
182- echo "CIBW_BUILD=pp*" >> $GITHUB_ENV
183- echo "CIBW_BEFORE_TEST_MACOS=pip install -r {project}/test-requirements.txt pytest" >> $GITHUB_ENV
184- echo "CIBW_TEST_COMMAND_MACOS=" >> $GITHUB_ENV
185129
186130 - name : Build wheels
131+ if : matrix.target != 'linux-aarch64'
187132 run : |
188133 python3 -m cibuildwheel --output-dir wheelhouse
189134
135+ - name : Build wheels for linux aarch64
136+ if : matrix.target == 'linux-aarch64'
137+ run : |
138+ CIBW_BUILD='cp3*' python -m cibuildwheel --archs aarch64 --output-dir wheelhouse
139+
190140 - uses : actions/upload-artifact@v4
191141 with :
192- name : wheels-${{ matrix.os }}-${{ matrix.platform }}
142+ name : wheels-${{ matrix.target }}-${{ matrix.os }}
193143 path : ./wheelhouse/*.whl
194144
195145 build-sdist :
@@ -211,56 +161,13 @@ jobs:
211161 name : source-dist
212162 path : dist/*.tar.gz
213163
214- build-wheels-extra-arch :
215- # The host should always be linux
216- runs-on : ubuntu-24.04
217- name : Build extra arch ${{ matrix.archs }} wheels
218- strategy :
219- fail-fast : false
220- matrix :
221- archs : [ aarch64,] # ppc64le ]
222-
223- steps :
224- - uses : actions/checkout@v4
225-
226- - name : Set up QEMU
227- id : qemu
228- uses : docker/setup-qemu-action@v3
229- with :
230- platforms : all
231- image : ' docker.io/tonistiigi/binfmt:desktop-v8.1.5'
232- if : runner.os == 'Linux'
233-
234- - uses : actions/setup-python@v5
235- name : Install Python
236- with :
237- python-version : ${{ inputs.python-version }}
238-
239- - name : Install cibuildwheel
240- run : |
241- python -m pip install cibuildwheel==2.22.0
242-
243- - name : Build wheels
244- env :
245- CIBW_BUILD : " cp39* cp310* cp311* cp312* cp313*" # limit to specific version since it take much more time than jobs limit
246- run : |
247- python -m cibuildwheel --archs ${{ matrix.archs }} --output-dir wheelhouse
248-
249- - uses : actions/upload-artifact@v4
250- with :
251- name : wheels-${{ matrix.archs }}
252- path : ./wheelhouse/*.whl
253-
254164 upload_pypi :
255165 if : inputs.upload
256- needs : [build-wheels, build-wheels-extra-arch, build- sdist]
166+ needs : [build-wheels, build-sdist]
257167 runs-on : ubuntu-24.04
258168 permissions :
259169 id-token : write
260170
261- # upload to PyPI on every tag starting with 'v'
262- # alternatively, to publish when a GitHub Release is created, use the following rule:
263- # if: github.event_name == 'release' && github.event.action == 'published'
264171 steps :
265172 - uses : actions/download-artifact@v4
266173 with :
0 commit comments