Skip to content

Commit d02c619

Browse files
authored
Merge pull request #411 from scylladb/dk/fix-3.13-building
fix extensions building
2 parents dccfe90 + 3a4601a commit d02c619

File tree

4 files changed

+169
-94
lines changed

4 files changed

+169
-94
lines changed

.github/workflows/build-push.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
CIBW_TEST_COMMAND_WINDOWS: "pytest {project}/tests/unit -k \"not (test_deserialize_date_range_year or test_datetype or test_libevreactor)\" "
1313
CIBW_BEFORE_TEST: "pip install -r {project}/test-requirements.txt"
1414
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"
15-
CIBW_ENVIRONMENT: "CASS_DRIVER_BUILD_CONCURRENCY=2 CFLAGS='-g0 -O3'"
15+
CIBW_ENVIRONMENT: "CASS_DRIVER_BUILD_CONCURRENCY=2 CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST=yes CFLAGS='-g0 -O3'"
1616
CIBW_SKIP: cp36* cp37* pp*i686 *musllinux*
1717
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
1818
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_28
@@ -28,19 +28,19 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
include:
31-
- os: ubuntu-20.04
31+
- os: ubuntu-24.04
3232
platform: x86_64
3333

34-
- os: ubuntu-20.04
34+
- os: ubuntu-24.04
3535
platform: PyPy
3636

37-
- os: windows-latest
37+
- os: windows-2022
3838
platform: win64
3939

4040
- os: windows-latest
4141
platform: PyPy
4242

43-
- os: macos-latest
43+
- os: macos-14
4444
platform: all
4545

4646
- os: macos-13
@@ -100,6 +100,7 @@ jobs:
100100
if: runner.os == 'Windows' && matrix.platform == 'win64'
101101
run: |
102102
echo "CIBW_BUILD=cp*win_amd64" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
103+
echo "CIBW_ENVIRONMENT_WINDOWS= CC=clang CXX=clang++" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
103104
104105
- name: Overwrite for Windows PyPY
105106
if: runner.os == 'Windows' && matrix.platform == 'PyPy'
@@ -112,8 +113,15 @@ jobs:
112113
run: |
113114
echo "CIBW_BUILD=cp39* cp310* cp311* cp312* cp313*" >> $GITHUB_ENV
114115
echo "CIBW_BEFORE_TEST_MACOS=pip install -r {project}/test-requirements.txt pytest" >> $GITHUB_ENV
115-
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV
116-
116+
if [ "${{ matrix.os }}" == "macos-13" ]; then
117+
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV;
118+
echo "Enforcing target deployment for 13.0"
119+
elif [ "${{ matrix.os }}" == "macos-14" ]; then
120+
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV;
121+
echo "Enforcing target deployment for 14.0"
122+
else
123+
echo "Unknown macos version" && false;
124+
fi
117125
- name: Overwrite for MacOs PyPy
118126
if: runner.os == 'MacOs' && matrix.platform == 'PyPy'
119127
run: |
@@ -133,7 +141,7 @@ jobs:
133141
build_sdist:
134142
name: Build source distribution
135143
if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build'))|| github.event_name == 'push' && endsWith(github.event.ref, 'scylla')"
136-
runs-on: ubuntu-20.04
144+
runs-on: ubuntu-24.04
137145
steps:
138146
- uses: actions/checkout@v4
139147

@@ -153,7 +161,7 @@ jobs:
153161
build_wheels_extra_arch:
154162
if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build'))|| github.event_name == 'push' && endsWith(github.event.ref, 'scylla')"
155163
# The host should always be linux
156-
runs-on: ubuntu-20.04
164+
runs-on: ubuntu-24.04
157165
name: Build extra arch ${{ matrix.archs }} wheels
158166
strategy:
159167
fail-fast: false
@@ -168,6 +176,7 @@ jobs:
168176
uses: docker/setup-qemu-action@v3
169177
with:
170178
platforms: all
179+
image: 'docker.io/tonistiigi/binfmt:desktop-v8.1.5'
171180
if: runner.os == 'Linux'
172181

173182
- uses: actions/setup-python@v5
@@ -181,7 +190,7 @@ jobs:
181190
182191
- name: Build wheels
183192
env:
184-
CIBW_BUILD: "cp39* cp310* cp311* cp312*" # limit to specific version since it take much more time than jobs limit
193+
CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*" # limit to specific version since it take much more time than jobs limit
185194
run: |
186195
python -m cibuildwheel --archs ${{ matrix.archs }} --output-dir wheelhouse
187196
@@ -192,7 +201,7 @@ jobs:
192201

193202
upload_pypi:
194203
needs: [build_wheels, build_wheels_extra_arch, build_sdist]
195-
runs-on: ubuntu-20.04
204+
runs-on: ubuntu-24.04
196205
permissions:
197206
id-token: write
198207

cassandra/io/libevwrapper.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,6 @@ initlibevwrapper(void)
667667
if (PyModule_AddObject(module, "Timer", (PyObject *)&libevwrapper_TimerType) == -1)
668668
INITERROR;
669669

670-
if (!PyEval_ThreadsInitialized()) {
671-
PyEval_InitThreads();
672-
}
673670

674671
#if PY_MAJOR_VERSION >= 3
675672
return module;

pyproject.toml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
[project]
2+
name = "scylla-driver"
3+
description = "Scylla Driver for Apache Cassandra"
4+
authors = [
5+
{name = "ScyllaDB"},
6+
]
7+
keywords = ["cassandra", "cql", "orm", "dse", "graph"]
8+
classifiers = [
9+
'Development Status :: 5 - Production/Stable',
10+
'Intended Audience :: Developers',
11+
'License :: OSI Approved :: Apache Software License',
12+
'Natural Language :: English',
13+
'Operating System :: OS Independent',
14+
'Programming Language :: Python',
15+
'Programming Language :: Python :: 3',
16+
'Programming Language :: Python :: 3.7',
17+
'Programming Language :: Python :: 3.8',
18+
'Programming Language :: Python :: 3.9',
19+
'Programming Language :: Python :: 3.10',
20+
'Programming Language :: Python :: 3.11',
21+
'Programming Language :: Python :: 3.12',
22+
'Programming Language :: Python :: 3.13',
23+
'Programming Language :: Python :: Implementation :: CPython',
24+
'Programming Language :: Python :: Implementation :: PyPy',
25+
'Topic :: Software Development :: Libraries :: Python Modules'
26+
]
27+
dependencies = [
28+
'geomet>=0.1,<0.3',
29+
'pyyaml > 5.0'
30+
]
31+
dynamic = ["version", "readme"]
32+
33+
[project.urls]
34+
"Homepage" = "https://github.com/scylladb/python-driver"
35+
"Documentation" = "https://scylladb.github.io/python-driver/"
36+
"Source" = "https://github.com/scylladb/python-driver/"
37+
"Issues" = "https://github.com/scylladb/python-driver/issues"
38+
39+
[project.optional-dependencies]
40+
graph = ['gremlinpython==3.4.6']
41+
cle = ['cryptography>=35.0']
42+
test = [
43+
"pytest",
44+
"mock>=2.0.0",
45+
"PyYAML",
46+
"pytz",
47+
"sure",
48+
"scales",
49+
"pure-sasl",
50+
"twisted[tls]; python_version >= '3.5'",
51+
"twisted[tls]==19.2.1; python_version < '3.5'",
52+
"gevent>=1.0; python_version < '3.13' and platform_machine != 'i686' and platform_machine != 'win32'",
53+
"gevent==23.9.0; python_version < '3.13' and (platform_machine == 'i686' or platform_machine == 'win32')",
54+
"eventlet>=0.33.3; python_version < '3.13'",
55+
"cython",
56+
"packaging",
57+
"futurist; python_version >= '3.7'",
58+
"asynctest; python_version >= '3.5'",
59+
"pyyaml",
60+
]
61+
62+
[tool.setuptools]
63+
include-package-data = true
64+
packages=[
65+
'cassandra', 'cassandra.io', 'cassandra.cqlengine', 'cassandra.graph',
66+
'cassandra.datastax', 'cassandra.datastax.insights', 'cassandra.datastax.graph',
67+
'cassandra.datastax.graph.fluent', 'cassandra.datastax.cloud', 'cassandra.scylla',
68+
'cassandra.column_encryption'
69+
]
70+
71+
[tool.setuptools.dynamic]
72+
version = {attr = "cassandra.__version__"} # any module attribute compatible with ast.literal_eval
73+
readme = {file = "README.rst", content-type = "text/x-rst"}
74+
75+
[build-system]
76+
requires = [
77+
"setuptools>=42",
78+
"Cython",
79+
]
80+
81+
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)