feat: update PyO3 0.24 -> 0.28.2 for Python 3.14 support#266
Merged
Conversation
PyO3 0.24 does not support Python 3.14 (max 3.13). Update to 0.28.2 which has full Python 3.14 support. Migrate all deprecated APIs: - Python::with_gil -> Python::attach - .downcast() -> .cast(), .downcast_bound() -> .cast_bound() - Add #[pyclass(from_py_object)] on Clone types - IntoPyObject<Target=PyTuple> -> PyCallArgs trait bound Also declare Python 3.11-3.14 support in pyproject.toml classifiers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Stale build dependency creates version mismatch in lockfile
- Removed the unused
pyo3-build-configbuild-dependency fromCargo.tomland updatedCargo.lockto eliminate the stale 0.24.0 entry so only the pyo3-aligned version remains.
- Removed the unused
Or push these changes by commenting:
@cursor push 9203dec2af
Preview (9203dec2af)
diff --git a/sentry_streams/Cargo.lock b/sentry_streams/Cargo.lock
--- a/sentry_streams/Cargo.lock
+++ b/sentry_streams/Cargo.lock
@@ -1299,23 +1299,13 @@
"libc",
"once_cell",
"portable-atomic",
- "pyo3-build-config 0.28.2",
+ "pyo3-build-config",
"pyo3-ffi",
"pyo3-macros",
]
[[package]]
name = "pyo3-build-config"
-version = "0.24.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9b6c2b34cf71427ea37c7001aefbaeb85886a074795e35f161f5aecc7620a7a"
-dependencies = [
- "once_cell",
- "target-lexicon",
-]
-
-[[package]]
-name = "pyo3-build-config"
version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bf94ee265674bf76c09fa430b0e99c26e319c945d96ca0d5a8215f31bf81cf7"
@@ -1330,7 +1320,7 @@
checksum = "491aa5fc66d8059dd44a75f4580a2962c1862a1c2945359db36f6c2818b748dc"
dependencies = [
"libc",
- "pyo3-build-config 0.28.2",
+ "pyo3-build-config",
]
[[package]]
@@ -1353,7 +1343,7 @@
dependencies = [
"heck",
"proc-macro2",
- "pyo3-build-config 0.28.2",
+ "pyo3-build-config",
"quote",
"syn",
]
@@ -1589,7 +1579,6 @@
"metrics-exporter-dogstatsd",
"parking_lot",
"pyo3",
- "pyo3-build-config 0.24.0",
"rand 0.8.5",
"rdkafka",
"reqwest",
diff --git a/sentry_streams/Cargo.toml b/sentry_streams/Cargo.toml
--- a/sentry_streams/Cargo.toml
+++ b/sentry_streams/Cargo.toml
@@ -39,9 +39,6 @@
parking_lot = "0.12.1"
pyo3 = { version = "*", features = ["auto-initialize"] }
-[build-dependencies]
-pyo3-build-config = "*"
-
# For now (while we are still rolling out streams to SBC), let's enable maximal
# debug information. There should only be overhead in space and when many
# stacktraces are generated (thousands/sec)This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
- py.allow_threads() was renamed to py.detach() in PyO3 0.28 - Remove unused pyo3-build-config build dependency (no build.rs exists) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
evanh
approved these changes
Mar 17, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


noticed we fail to build 3.14 wheels here: https://github.com/getsentry/pypi/actions/runs/23167821965/job/67312251630#step:4:14
with_gil->attach,downcast->cast, etc.)