Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .ci/scripts/calculate_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def set_output(key: str, value: str):
"database": "sqlite",
"extras": "all",
}
for version in ("3.11", "3.12", "3.13")
for version in ("3.11", "3.12", "3.13", "3.14")
)

trial_postgres_tests = [
Expand All @@ -68,7 +68,7 @@ def set_output(key: str, value: str):
if not IS_PR:
trial_postgres_tests.append(
{
"python-version": "3.13",
"python-version": "3.14",
"database": "postgres",
"postgres-version": "17",
"extras": "all",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ jobs:
- python-version: "3.10"
postgres-version: "13"

- python-version: "3.13"
- python-version: "3.14"
postgres-version: "17"

services:
Expand Down
29 changes: 14 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions changelog.d/19055.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for Python 3.14.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this fixes #19117

(update PR description)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that will be fixed by just clearing our caches (or otherwise getting CI to use the right PyO3 version (0.25.0+)). But this PR will invalidate the Rust cache, so technically it'll likely fix it too.

I'd like to merge this PR and check CI passes with the old runner before closing that issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this fixes #19122

(update PR description)

Copy link
Member Author

@anoadragon453 anoadragon453 Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will be fixed by updating zope-interface, yes.

313 changes: 151 additions & 162 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ python = "^3.10.0"
# ----------------------
# we use the TYPE_CHECKER.redefine method added in jsonschema 3.0.0
jsonschema = ">=3.0.0"
# 0.25.0 is the first version to support Python 3.14.
# We can remove this once https://github.com/python-jsonschema/jsonschema/issues/1426 is fixed
# and included in a release.
rpds-py = ">=0.25.0"
Comment on lines +174 to +177
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python-jsonschema/jsonschema#1426 is now fixed but I don't see a recent release so I'm guessing we still need this

# We choose 2.0 as a lower bound: the most recent backwards incompatible release.
# It seems generally available, judging by https://pkgs.org/search/?q=immutabledict
immutabledict = ">=2.0"
Expand Down
6 changes: 3 additions & 3 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ http = "1.1.0"
lazy_static = "1.4.0"
log = "0.4.17"
mime = "0.3.17"
pyo3 = { version = "0.25.1", features = [
pyo3 = { version = "0.26.0", features = [
"macros",
"anyhow",
"abi3",
"abi3-py310",
] }
pyo3-log = "0.12.4"
pythonize = "0.25.0"
pyo3-log = "0.13.1"
pythonize = "0.26.0"
regex = "1.6.0"
sha2 = "0.10.8"
serde = { version = "1.0.144", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions rust/src/events/internal_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use pyo3::{
pybacked::PyBackedStr,
pyclass, pymethods,
types::{PyAnyMethods, PyDict, PyDictMethods, PyString},
Bound, IntoPyObject, PyAny, PyObject, PyResult, Python,
Bound, IntoPyObject, Py, PyAny, PyResult, Python,
};

use crate::UnwrapInfallible;
Expand Down Expand Up @@ -289,7 +289,7 @@ impl EventInternalMetadata {
/// Get a dict holding the data stored in the `internal_metadata` column in the database.
///
/// Note that `outlier` and `stream_ordering` are stored in separate columns so are not returned here.
fn get_dict(&self, py: Python<'_>) -> PyResult<PyObject> {
fn get_dict(&self, py: Python<'_>) -> PyResult<Py<PyAny>> {
let dict = PyDict::new(py);

for entry in &self.data {
Expand Down
8 changes: 4 additions & 4 deletions rust/src/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn get_runtime<'a>(reactor: &Bound<'a, PyAny>) -> PyResult<PyRef<'a, PyTokioRunt
}

/// A reference to the `twisted.internet.defer` module.
static DEFER: OnceCell<PyObject> = OnceCell::new();
static DEFER: OnceCell<Py<PyAny>> = OnceCell::new();

/// Access to the `twisted.internet.defer` module.
fn defer(py: Python<'_>) -> PyResult<&Bound<'_, PyAny>> {
Expand Down Expand Up @@ -165,7 +165,7 @@ pub fn register_module(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()>
#[pyclass]
struct HttpClient {
client: reqwest::Client,
reactor: PyObject,
reactor: Py<PyAny>,
}

#[pymethods]
Expand Down Expand Up @@ -237,7 +237,7 @@ impl HttpClient {
return Err(HttpResponseException::new(status, buffer));
}

let r = Python::with_gil(|py| buffer.into_pyobject(py).map(|o| o.unbind()))?;
let r = Python::attach(|py| buffer.into_pyobject(py).map(|o| o.unbind()))?;

Ok(r)
})
Expand Down Expand Up @@ -270,7 +270,7 @@ where
handle.spawn(async move {
let res = task.await;

Python::with_gil(move |py| {
Python::attach(move |py| {
// Flatten the panic into standard python error
let res = match res {
Ok(r) => r,
Expand Down
4 changes: 2 additions & 2 deletions rust/src/rendezvous/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use pyo3::{
exceptions::PyValueError,
pyclass, pymethods,
types::{PyAnyMethods, PyModule, PyModuleMethods},
Bound, IntoPyObject, Py, PyAny, PyObject, PyResult, Python,
Bound, IntoPyObject, Py, PyAny, PyResult, Python,
};
use ulid::Ulid;

Expand All @@ -56,7 +56,7 @@ fn prepare_headers(headers: &mut HeaderMap, session: &Session) {
#[pyclass]
struct RendezvousHandler {
base: Uri,
clock: PyObject,
clock: Py<PyAny>,
sessions: BTreeMap<Ulid, Session>,
capacity: usize,
max_content_length: u64,
Expand Down
Loading