Skip to content

Commit 4ee0114

Browse files
committed
Add support for Python 3.14
1 parent c0f4a7f commit 4ee0114

File tree

7 files changed

+41
-44
lines changed

7 files changed

+41
-44
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ jobs:
5555
with:
5656
files: codecov.json
5757

58-
# See https://github.com/PyO3/pyo3/discussions/2781
59-
# tests intermittently segfault with pypy and cpython 3.7 when using `coverage run ...`, hence separate job
6058
test-python:
6159
name: test ${{ matrix.python-version }}
6260
strategy:
@@ -69,6 +67,8 @@ jobs:
6967
- '3.12'
7068
- '3.13'
7169
- '3.13t'
70+
- '3.14'
71+
- '3.14t'
7272
- 'pypy3.9'
7373
- 'pypy3.10'
7474

@@ -410,15 +410,15 @@ jobs:
410410
- os: linux
411411
manylinux: auto
412412
target: armv7
413-
interpreter: 3.9 3.10 3.11 3.12 3.13
413+
interpreter: 3.9 3.10 3.11 3.12 3.13 3.14
414414
- os: linux
415415
manylinux: auto
416416
target: ppc64le
417-
interpreter: 3.9 3.10 3.11 3.12 3.13
417+
interpreter: 3.9 3.10 3.11 3.12 3.13 3.14
418418
- os: linux
419419
manylinux: auto
420420
target: s390x
421-
interpreter: 3.9 3.10 3.11 3.12 3.13
421+
interpreter: 3.9 3.10 3.11 3.12 3.13 3.14
422422
- os: linux
423423
manylinux: auto
424424
target: x86_64
@@ -454,10 +454,10 @@ jobs:
454454
- os: windows
455455
target: i686
456456
python-architecture: x86
457-
interpreter: 3.9 3.10 3.11 3.12 3.13
457+
interpreter: 3.9 3.10 3.11 3.12 3.13 3.14
458458
- os: windows
459459
target: aarch64
460-
interpreter: 3.11 3.12 3.13
460+
interpreter: 3.11 3.12 3.13 3.14
461461

462462
exclude:
463463
# See above; disabled for now.
@@ -484,7 +484,7 @@ jobs:
484484
with:
485485
target: ${{ matrix.target }}
486486
manylinux: ${{ matrix.manylinux }}
487-
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10 pypy3.11' }}
487+
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.9 3.10 3.11 3.12 3.13 3.14 pypy3.9 pypy3.10 pypy3.11' }}
488488
rust-toolchain: stable
489489
docker-options: -e CI
490490

@@ -505,7 +505,7 @@ jobs:
505505
fail-fast: false
506506
matrix:
507507
os: [linux, windows, macos]
508-
interpreter: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.13t']
508+
interpreter: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.13t', '3.14', '3.14t']
509509
include:
510510
# standard runners with override for macos arm
511511
- os: linux

Cargo.lock

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ rust-version = "1.75"
2929
[dependencies]
3030
# TODO it would be very nice to remove the "py-clone" feature as it can panic,
3131
# but needs a bit of work to make sure it's not used in the codebase
32-
pyo3 = { version = "0.24", features = ["generate-import-lib", "num-bigint", "py-clone"] }
32+
pyo3 = { version = "0.25", features = ["generate-import-lib", "num-bigint", "py-clone"] }
3333
regex = "1.11.1"
3434
strum = { version = "0.26.3", features = ["derive"] }
3535
strum_macros = "0.26.4"
@@ -46,7 +46,7 @@ base64 = "0.22.1"
4646
num-bigint = "0.4.6"
4747
num-traits = "0.2.19"
4848
uuid = "1.16.0"
49-
jiter = { version = "0.9.0", features = ["python"] }
49+
jiter = { version = "0.10.0", features = ["python"] }
5050
hex = "0.4.3"
5151

5252
[lib]
@@ -74,12 +74,12 @@ debug = true
7474
strip = false
7575

7676
[dev-dependencies]
77-
pyo3 = { version = "0.24", features = ["auto-initialize"] }
77+
pyo3 = { version = "0.25", features = ["auto-initialize"] }
7878

7979
[build-dependencies]
8080
version_check = "0.9.5"
8181
# used where logic has to be version/distribution specific, e.g. pypy
82-
pyo3-build-config = { version = "0.24" }
82+
pyo3-build-config = { version = "0.25" }
8383

8484
[lints.clippy]
8585
dbg_macro = "warn"

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ classifiers = [
2424
'Programming Language :: Python :: 3.11',
2525
'Programming Language :: Python :: 3.12',
2626
'Programming Language :: Python :: 3.13',
27+
'Programming Language :: Python :: 3.14',
2728
'Programming Language :: Rust',
2829
'Framework :: Pydantic',
2930
'Intended Audience :: Developers',
@@ -71,7 +72,7 @@ linting = [{ include-group = "dev" }, 'griffe', 'pyright', 'ruff', 'mypy']
7172
wasm = [{ include-group = "dev" }, 'typing_extensions', 'ruff']
7273
codspeed = [
7374
# codspeed is only run on CI, with latest version of CPython
74-
'pytest-codspeed; python_version == "3.13" and implementation_name == "cpython"',
75+
'pytest-codspeed; python_version == "3.14" and implementation_name == "cpython"',
7576
]
7677

7778
all = [

src/py_gc.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@ use std::sync::Arc;
22

33
use ahash::AHashMap;
44
use enum_dispatch::enum_dispatch;
5-
use pyo3::{AsPyPointer, Py, PyTraverseError, PyVisit};
5+
use pyo3::{Py, PyTraverseError, PyVisit};
66

77
/// Trait implemented by types which can be traversed by the Python GC.
88
#[enum_dispatch]
99
pub trait PyGcTraverse {
1010
fn py_gc_traverse(&self, visit: &PyVisit<'_>) -> Result<(), PyTraverseError>;
1111
}
1212

13-
impl<T> PyGcTraverse for Py<T>
14-
where
15-
Py<T>: AsPyPointer,
16-
{
13+
impl<T> PyGcTraverse for Py<T> {
1714
fn py_gc_traverse(&self, visit: &PyVisit<'_>) -> Result<(), PyTraverseError> {
1815
visit.call(self)
1916
}

src/tools.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use pyo3::types::{PyDict, PyString};
88
use pyo3::{intern, FromPyObject};
99

1010
use crate::input::Int;
11-
use jiter::{cached_py_string, pystring_fast_new, StringCacheMode};
11+
use jiter::{cached_py_string, StringCacheMode};
1212

1313
pub trait SchemaDict<'py> {
1414
fn get_as<T>(&self, key: &Bound<'py, PyString>) -> PyResult<Option<T>>
@@ -148,11 +148,10 @@ pub fn extract_int(v: &Bound<'_, PyAny>) -> Option<Int> {
148148

149149
pub(crate) fn new_py_string<'py>(py: Python<'py>, s: &str, cache_str: StringCacheMode) -> Bound<'py, PyString> {
150150
// we could use `bytecount::num_chars(s.as_bytes()) == s.len()` as orjson does, but it doesn't appear to be faster
151-
let ascii_only = false;
152151
if matches!(cache_str, StringCacheMode::All) {
153-
cached_py_string(py, s, ascii_only)
152+
cached_py_string(py, s)
154153
} else {
155-
pystring_fast_new(py, s, ascii_only)
154+
PyString::new(py, s)
156155
}
157156
}
158157

uv.lock

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)