Skip to content

Commit

Permalink
Merge pull request #411 from scylladb/dk/fix-3.13-building
Browse files Browse the repository at this point in the history
fix extensions building
  • Loading branch information
dkropachev authored Jan 28, 2025
2 parents dccfe90 + 3a4601a commit d02c619
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 94 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
CIBW_TEST_COMMAND_WINDOWS: "pytest {project}/tests/unit -k \"not (test_deserialize_date_range_year or test_datetype or test_libevreactor)\" "
CIBW_BEFORE_TEST: "pip install -r {project}/test-requirements.txt"
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"
CIBW_ENVIRONMENT: "CASS_DRIVER_BUILD_CONCURRENCY=2 CFLAGS='-g0 -O3'"
CIBW_ENVIRONMENT: "CASS_DRIVER_BUILD_CONCURRENCY=2 CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST=yes CFLAGS='-g0 -O3'"
CIBW_SKIP: cp36* cp37* pp*i686 *musllinux*
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_28
Expand All @@ -28,19 +28,19 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
- os: ubuntu-24.04
platform: x86_64

- os: ubuntu-20.04
- os: ubuntu-24.04
platform: PyPy

- os: windows-latest
- os: windows-2022
platform: win64

- os: windows-latest
platform: PyPy

- os: macos-latest
- os: macos-14
platform: all

- os: macos-13
Expand Down Expand Up @@ -100,6 +100,7 @@ jobs:
if: runner.os == 'Windows' && matrix.platform == 'win64'
run: |
echo "CIBW_BUILD=cp*win_amd64" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "CIBW_ENVIRONMENT_WINDOWS= CC=clang CXX=clang++" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Overwrite for Windows PyPY
if: runner.os == 'Windows' && matrix.platform == 'PyPy'
Expand All @@ -112,8 +113,15 @@ jobs:
run: |
echo "CIBW_BUILD=cp39* cp310* cp311* cp312* cp313*" >> $GITHUB_ENV
echo "CIBW_BEFORE_TEST_MACOS=pip install -r {project}/test-requirements.txt pytest" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV
if [ "${{ matrix.os }}" == "macos-13" ]; then
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV;
echo "Enforcing target deployment for 13.0"
elif [ "${{ matrix.os }}" == "macos-14" ]; then
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV;
echo "Enforcing target deployment for 14.0"
else
echo "Unknown macos version" && false;
fi
- name: Overwrite for MacOs PyPy
if: runner.os == 'MacOs' && matrix.platform == 'PyPy'
run: |
Expand All @@ -133,7 +141,7 @@ jobs:
build_sdist:
name: Build source distribution
if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build'))|| github.event_name == 'push' && endsWith(github.event.ref, 'scylla')"
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

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

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

upload_pypi:
needs: [build_wheels, build_wheels_extra_arch, build_sdist]
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
permissions:
id-token: write

Expand Down
3 changes: 0 additions & 3 deletions cassandra/io/libevwrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,6 @@ initlibevwrapper(void)
if (PyModule_AddObject(module, "Timer", (PyObject *)&libevwrapper_TimerType) == -1)
INITERROR;

if (!PyEval_ThreadsInitialized()) {
PyEval_InitThreads();
}

#if PY_MAJOR_VERSION >= 3
return module;
Expand Down
81 changes: 81 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[project]
name = "scylla-driver"
description = "Scylla Driver for Apache Cassandra"
authors = [
{name = "ScyllaDB"},
]
keywords = ["cassandra", "cql", "orm", "dse", "graph"]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules'
]
dependencies = [
'geomet>=0.1,<0.3',
'pyyaml > 5.0'
]
dynamic = ["version", "readme"]

[project.urls]
"Homepage" = "https://github.com/scylladb/python-driver"
"Documentation" = "https://scylladb.github.io/python-driver/"
"Source" = "https://github.com/scylladb/python-driver/"
"Issues" = "https://github.com/scylladb/python-driver/issues"

[project.optional-dependencies]
graph = ['gremlinpython==3.4.6']
cle = ['cryptography>=35.0']
test = [
"pytest",
"mock>=2.0.0",
"PyYAML",
"pytz",
"sure",
"scales",
"pure-sasl",
"twisted[tls]; python_version >= '3.5'",
"twisted[tls]==19.2.1; python_version < '3.5'",
"gevent>=1.0; python_version < '3.13' and platform_machine != 'i686' and platform_machine != 'win32'",
"gevent==23.9.0; python_version < '3.13' and (platform_machine == 'i686' or platform_machine == 'win32')",
"eventlet>=0.33.3; python_version < '3.13'",
"cython",
"packaging",
"futurist; python_version >= '3.7'",
"asynctest; python_version >= '3.5'",
"pyyaml",
]

[tool.setuptools]
include-package-data = true
packages=[
'cassandra', 'cassandra.io', 'cassandra.cqlengine', 'cassandra.graph',
'cassandra.datastax', 'cassandra.datastax.insights', 'cassandra.datastax.graph',
'cassandra.datastax.graph.fluent', 'cassandra.datastax.cloud', 'cassandra.scylla',
'cassandra.column_encryption'
]

[tool.setuptools.dynamic]
version = {attr = "cassandra.__version__"} # any module attribute compatible with ast.literal_eval
readme = {file = "README.rst", content-type = "text/x-rst"}

[build-system]
requires = [
"setuptools>=42",
"Cython",
]

build-backend = "setuptools.build_meta"
Loading

0 comments on commit d02c619

Please sign in to comment.