Skip to content

Commit 01b9daa

Browse files
committed
1
1 parent 508dc5f commit 01b9daa

File tree

2 files changed

+48
-90
lines changed

2 files changed

+48
-90
lines changed

.github/workflows/lib-build-and-push.yml

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,6 @@ on:
2121
required: false
2222
default: "linux,macos,windows"
2323

24-
cibw-skip:
25-
description: 'CIBUILDWHEEL builds pattern to skip, goes to CIBW_SKIP env'
26-
type: string
27-
required: false
28-
default: 'cp2* cp35* cp36* cp37* *i686 *musllinux*'
29-
30-
target-wheels-python-versions:
31-
description: "List of python version to build wheels for, to be translated to CIBW_BUILD env"
32-
type: string
33-
required: false
34-
default: 3.8 3.9 3.10 3.11 3.12 3.13
35-
36-
cibw-manylinux-default-image:
37-
description: "A manylinux image to be used by cibuildwheel"
38-
type: string
39-
required: false
40-
default: "manylinux_2_28"
41-
42-
env:
43-
CIBW_TEST_COMMAND_LINUX: >
44-
pytest {project}/tests/unit &&
45-
EVENT_LOOP_MANAGER=gevent pytest {project}/tests/unit/io/test_geventreactor.py
46-
47-
CIBW_TEST_COMMAND_MACOS: "pytest {project}/tests/unit -k 'not (test_multi_timer_validation or test_empty_connections or test_timer_cancellation)' "
48-
CIBW_TEST_COMMAND_WINDOWS: "pytest {project}/tests/unit -k \"not (test_deserialize_date_range_year or test_datetype or test_libevreactor)\" "
49-
CIBW_BEFORE_TEST: "pip install -r {project}/test-requirements.txt"
50-
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"
51-
CIBW_ENVIRONMENT: "CASS_DRIVER_BUILD_CONCURRENCY=2 CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST=yes CFLAGS='-g0 -O3'"
52-
CIBW_SKIP: ${{ inputs.cibw-skip }}
53-
CIBW_MANYLINUX_X86_64_IMAGE: ${{ inputs.cibw-manylinux-default-image }}
54-
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ inputs.cibw-manylinux-default-image }}
55-
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ inputs.cibw-manylinux-default-image }}
56-
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: ${{ inputs.cibw-manylinux-default-image }}
57-
CIBW_ENVIRONMENT_WINDOWS: "CC=clang CXX=clang++"
58-
5924
jobs:
6025
prepare-matrix:
6126
name: "Prepare matrix to run for ${{ inputs.python-version }} on `${{ inputs.target }}`"
@@ -138,35 +103,6 @@ jobs:
138103
- name: Overwrite for Linux and MacOS
139104
if: runner.os == 'Linux' || runner.os == 'MacOS'
140105
run: |
141-
142-
##### Set CIBW_BUILD
143-
pre=""
144-
post=""
145-
146-
if [[ "${{ matrix.platform }}" == "PyPy" ]]; then
147-
# Will convert `inputs.target-wheels-python-versions` (3.11 3.12 3.13) into `pp311* pp312* pp313*`
148-
pre="pp"
149-
post="*"
150-
elif [[ "${{ matrix.platform }}" == "all" ]]; then
151-
# Convert `inputs.target-wheels-python-versions` (3.11 3.12 3.13) into `cp311* cp312* cp313*`
152-
pre="cp"
153-
post="*"
154-
elif [[ "${{ matrix.platform }}" == "x86_64" ]]; then
155-
# Convert `inputs.target-wheels-python-versions` (3.11 3.12 3.13) into `cp311*x86_64 cp312*x86_64 cp313*x86_64`
156-
pre="cp"
157-
post="*x86_64"
158-
else
159-
echo "Unknown target platfor '${{ matrix.platform }}'"
160-
exit 1
161-
fi
162-
163-
CIBW_BUILD=""
164-
for item in `echo "${{ inputs.target-wheels-python-versions }}" | tr " " "\n"`; do
165-
CIBW_BUILD="${CIBW_BUILD} ${pre}${item//.}${post}"
166-
done
167-
echo "Resulted CIBW_BUILD: $CIBW_BUILD"
168-
echo "CIBW_BUILD=$CIBW_BUILD" >> $GITHUB_ENV
169-
170106
##### Set MACOSX_DEPLOYMENT_TARGET
171107
if [ "${{ matrix.os }}" == "macos-13" ]; then
172108
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV;
@@ -175,31 +111,6 @@ jobs:
175111
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV;
176112
echo "Enforcing target deployment for 14.0"
177113
fi
178-
179-
##### Set CIBW_TEST_COMMAND_MACOS and CIBW_TEST_COMMAND_LINUX
180-
if [[ "${{ matrix.platform }}" == "PyPy" ]]; then
181-
echo "CIBW_TEST_COMMAND_MACOS=" >> $GITHUB_ENV
182-
echo "CIBW_TEST_COMMAND_LINUX=" >> $GITHUB_ENV
183-
fi
184-
185-
- name: Overwrite for Windows
186-
if: runner.os == 'Windows'
187-
run: |
188-
##### Set CIBW_BUILD
189-
if ("${{ matrix.platform }}" -match "PyPy") {
190-
# Convert `inputs.target-wheels-python-versions` (3.11 3.12 3.13) into `pp311* pp312* pp313*`
191-
$cibw_build_patterns = (("${{ inputs.target-wheels-python-versions }}" -replace '\.') -split " " | ForEach-Object { "pp${_}*" }) -join " "
192-
echo "CIBW_BUILD=$cibw_build_patterns" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
193-
} else {
194-
# Convert `inputs.target-wheels-python-versions` (3.11 3.12 3.13) into `cp311*amd64 cp312*amd64 cp313*amd64`
195-
$cibw_build_patterns = (("${{ inputs.target-wheels-python-versions }}" -replace '\.') -split " " | ForEach-Object { "cp${_}*amd64" }) -join " "
196-
echo "CIBW_BUILD=$cibw_build_patterns" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
197-
}
198-
199-
##### Set CIBW_TEST_COMMAND_WINDOWS
200-
if ("${{ matrix.platform }}" -match "PyPy") {
201-
echo "CIBW_TEST_COMMAND_WINDOWS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
202-
}
203114
204115
- name: Build wheels
205116
run: |

pyproject.toml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,51 @@ requires = [
7878
"Cython",
7979
]
8080

81-
build-backend = "setuptools.build_meta"
81+
build-backend = "setuptools.build_meta"
82+
83+
[tool.setuptools_scm]
84+
version_file = "cassandra/_version.py"
85+
tag_regex = '(?P<version>\d*?\.\d*?\.\d*?)-scylla'
86+
87+
#### CI BUILDWHEEL CONFIG ####
88+
89+
[tool.cibuildwheel]
90+
91+
build-frontend = "build[uv]"
92+
environment = { CASS_DRIVER_BUILD_CONCURRENCY = "2", CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST = "yes", CFLAGS = "-g0 -O3" }
93+
skip = ["cp2*", "cp36*", "pp36*", "cp37*", "pp37*", "*i686", "*musllinux*"]
94+
95+
before-test = "pip install -r {project}/test-requirements.txt"
96+
97+
manylinux-x86_64-image = "manylinux_2_28"
98+
manylinux-aarch64-image = "manylinux_2_28"
99+
manylinux-pypy-x86_64-image = "manylinux_2_28"
100+
manylinux-pypy-aarch64-image = "manylinux_2_28"
101+
102+
[tool.cibuildwheel.linux]
103+
build = ["cp3*_x86_64"]
104+
105+
before-build = "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"
106+
test-command = [
107+
"pytest {package}/tests/unit",
108+
"EVENT_LOOP_MANAGER=gevent pytest {package}/tests/unit/io/test_geventreactor.py",
109+
]
110+
111+
[tool.cibuildwheel.macos]
112+
build = ["cp3*"]
113+
test-command = [
114+
"pytest {project}/tests/unit -k 'not (test_multi_timer_validation or test_empty_connections or test_timer_cancellation)'"
115+
]
116+
117+
[tool.cibuildwheel.windows]
118+
build = ["cp3*"]
119+
build-frontend = "build" # build[uv] seems to be broken on Windows
120+
test-command = [
121+
"pytest {project}/tests/unit -k 'not (test_deserialize_date_range_year or test_datetype or test_libevreactor)'"
122+
]
123+
124+
environment = { CASS_DRIVER_BUILD_CONCURRENCY = "2", CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST = "yes", CFLAGS = "-g0 -O3", CC = "clang", CXX = "clang++" }
125+
126+
[[tool.cibuildwheel.overrides]]
127+
select = "pp*"
128+
test-command = []

0 commit comments

Comments
 (0)