Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .github/workflows/pyo3-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# Cover the supported floor through the newest release. 3.13
# and 3.14 exercise the GIL / free-threading changes where
# PyO3 extensions most often break. Floor is 3.9 β€” matches
# `requires-python` in pyo3/pyproject.toml. (3.9 also resolves
# the older `pyarrow>=14,<19` series via the env-marker split
# in pyproject.toml, exercising that path in CI.)
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
# `uv sync` resolves the newest pyarrow inside the declared bound,
# so the default legs only ever see the top of `>=23.0.1,<27`.
# The include below adds one leg pinned to the floor, so a kernel
Expand Down Expand Up @@ -207,7 +201,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
# Same floor leg as `build-and-test`; see the comment there.
pyarrow: ["latest"]
include:
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ How this shows up in the repo:
- **Python dep pinning follows the externally-published-library
rule from [go/pinning-python-deps](https://docs.google.com/document/d/1thJsoOBW3NzvRV6pWpujcD8mn4KOXgAW8t10iw6Z6LA/edit)**:
major-version upper bounds in `pyo3/pyproject.toml`
(`pyarrow>=14,<19`), no exact pins, no transitive constraints,
with no exact pins, no transitive constraints,
no committed lockfile. Exact pins would impede downstream
`pip install databricks-sql-kernel` for end-users with their
own pyarrow consumers. Trusted jobs use `db-pypi`, whose 7-day age filter is
Expand Down
8 changes: 2 additions & 6 deletions pyo3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,8 @@ extension-module = ["pyo3/extension-module"]
# kernel's default feature.
databricks-sql-kernel = { path = "..", default-features = false, features = ["tls-rustls"] }

# pyo3 β€” abi3-py39 builds a single stable-ABI wheel (tagged
# cp39-abi3) that loads on CPython 3.9+. The ABI floor is kept in
# step with `requires-python = ">=3.9"` in pyproject.toml; bumping
# both together avoids shipping a wheel whose ABI tag advertises an
# interpreter the package no longer claims to support.
pyo3 = { version = "0.29", features = ["abi3-py39"] }
# Match the stable ABI floor to the minimum supported Python version.
pyo3 = { version = "0.29", features = ["abi3-py310"] }

# Multi-thread runtime β€” one per Session, owned on the Rust side.
tokio = { version = "1", features = ["rt-multi-thread"] }
Expand Down
3 changes: 2 additions & 1 deletion pyo3/NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ changes go in the root `NEXT_CHANGELOG.md`.
raises `KernelError` (`InvalidArgument`).

### Changed
- The Python wheel now requires Python 3.10 or newer.
- Allow pyarrow 24.x through 26.x on Python 3.10+ (`pyarrow>=23.0.1,<27`),
so the wheel installs alongside pyarrow 26, the first release clear of
CVE-2026-92287. Fresh `[kernel]` installs without their own pyarrow pin now
resolve pyarrow 26 on Python 3.11+ (25.x on 3.10); pin `pyarrow<24` to stay
on 23.x. Python 3.9/3.10 have no fixed pyarrow release available;
on 23.x. Python 3.10 has no fixed pyarrow release available;
upgrade to Python 3.11+ to clear the CVE.

### Updated
Expand Down
32 changes: 2 additions & 30 deletions pyo3/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,10 @@ build-backend = "maturin"
name = "databricks-sql-kernel"
version = "1.5.0"
description = "Python bindings for the Databricks SQL Kernel (PyO3)"
# Floor matches the tested CI matrix in
# .github/workflows/pyo3-checks.yml (3.9 .. 3.14). The abi3-py39
# wheel (see pyo3/Cargo.toml) loads on every CPython at or above
# this floor from a single artifact.
requires-python = ">=3.9"
requires-python = ">=3.10"
license = { text = "Apache-2.0" }
authors = [{ name = "Databricks" }]
# Runtime dependency for downstream consumers. Major-version bound
# per the go/pinning-python-deps externally-published-library rule:
# exact pins make this wheel harder for end-users to install
# alongside their own pyarrow consumers. The CI environment also
# uses these bounds (no committed lockfile) β€” see the
# `[dependency-groups].dev` block below + the workflow comment in
# `.github/workflows/pyo3-checks.yml` for the policy rationale.
#
# Split by interpreter via PEP 508 environment markers because the
# two ends of the supported range need different pyarrow floors:
#
# * Python 3.10+: retain the connector's >=23.0.1 floor; <27 admits
# the CVE-2026-92287 fix in 26.x, which requires Python 3.11+.
# Python 3.10 resolves to 25.x.
# * Python 3.9: pyarrow 23.x dropped 3.9 wheels, so 3.9 takes the
# last series that still ships them (`>=14,<19`). 3.9 never sees
# 3.14, so the cp314 concern does not apply here.
#
# Both `<27` / `<19` ceilings preserve the major-version upper bound
# the go/pinning-python-deps policy requires (a future pyarrow major
# then surfaces as a deliberate bump, not a silent auto-resolve).
dependencies = [
"pyarrow>=23.0.1,<27; python_version >= '3.10'",
"pyarrow>=14,<19; python_version < '3.10'",
]
dependencies = ["pyarrow>=23.0.1,<27"]

# Dev / CI dependencies. PEP 735 standard; uv reads this directly.
# CI runs `uv sync --group dev` (no `--frozen`, no committed
Expand Down
2 changes: 1 addition & 1 deletion pyo3/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Subclassing native exception types is not allowed in `abi3` mode
//! (PyO3 emits a compile-time error: "with the abi3 feature enabled,
//! PyO3 does not support subclassing native types"). To keep one
//! wheel per platform across Python 3.9+, `KernelError` is built
//! wheel per platform across supported Python versions, `KernelError` is built
//! via `create_exception!` (subclasses `Exception` at the Python C
//! level, not at the Rust pyclass level) and the structured fields
//! are attached as Python attributes via `setattr` so callers still
Expand Down
2 changes: 1 addition & 1 deletion pyo3/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
//!
//! Runtime workers can outlive their handle (`KernelRuntime`'s `Drop`
//! doesn't wait for them), and pyo3's finalization check is compiled out
//! under `abi3-py39`, so a worker forwarding a record while the
//! at our stable ABI floor, so a worker forwarding a record while the
//! interpreter finalizes can abort the process. An `atexit` hook, which
//! runs before finalization starts, makes the bridge drop records from
//! then on.
Expand Down
3 changes: 0 additions & 3 deletions pyo3/tests/test_dependency_bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@

from __future__ import annotations

import sys
from importlib.metadata import requires

import pyarrow
import pytest
from packaging.requirements import Requirement
from packaging.version import Version

Expand Down Expand Up @@ -54,7 +52,6 @@ def test_installed_pyarrow_satisfies_declared_range():
)


@pytest.mark.skipif(sys.version_info < (3, 10), reason="Python 3.9 caps pyarrow at <19")
def test_declared_range_admits_pyarrow_clear_of_cve_2026_92287():
req = pyarrow_requirement()
assert req.specifier.contains(PYARROW_CVE_2026_92287_FIXED), (
Expand Down
Loading