Skip to content
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3708697
Add news item
clin1234 Dec 21, 2024
1620df2
Move news file
clin1234 Dec 22, 2024
13c4a9c
Fix version limit check in noxfile.py
clin1234 Dec 22, 2024
64b7f3d
Bump Python version for testing debug builds
clin1234 Dec 24, 2024
e88ea62
3.14 is available from GH's setup-python action
clin1234 Dec 24, 2024
c849569
Bump maximum supported CPython version in pyo3-ffi
clin1234 Jan 17, 2025
dfa564f
Rework PyASCIIObject and PyUnicodeObject to be compatible with 3.14
clin1234 Jan 21, 2025
829f3a1
Run `cargo fmt --all`
clin1234 Jan 21, 2025
56f6b28
Actually add Py_3_14 as a legitimate macro
clin1234 Jan 23, 2025
1b0dc44
Revert "Actually add Py_3_14 as a legitimate macro"
clin1234 Jan 23, 2025
ec954e1
Fix version macro placement for 3.14-specific getters and setters
clin1234 Jan 23, 2025
41b9a04
Import 'c_ushort' only if compiling against CPython 3.14 or later
clin1234 Jan 23, 2025
d4f06d7
Add wrapper functions for the statically_allocated field
clin1234 Jan 23, 2025
8e323ce
Remove unused libc::c_ushort
clin1234 Jan 23, 2025
3be5933
Add (hopefully) final version-specific macros
clin1234 Jan 23, 2025
31d302f
Port 3.14-specific 64-bit code of Py_INCREF
clin1234 Feb 13, 2025
6354444
Don't expose PyDictObject.ma_version_tag when building against 3.14 o…
clin1234 Feb 13, 2025
043b0d4
fix ffi-check on the GIL-enabled ABI
ngoldbaum Feb 20, 2025
ca49f9f
fix older pythons
ngoldbaum Feb 20, 2025
f414b08
fix ffi-check on older pythons
ngoldbaum Feb 20, 2025
df308ac
WIP: update for 3.14t
ngoldbaum Feb 20, 2025
022daa7
fix ffi-check on the free-threaded build
ngoldbaum Feb 20, 2025
cbd03b3
fix clippy
ngoldbaum Feb 20, 2025
465807d
fix clippy on older python versions
ngoldbaum Feb 20, 2025
8ea31b8
fix cargo check on the MSRV
ngoldbaum Feb 21, 2025
ce3ced2
fix ffi-check on 3.13t
ngoldbaum Feb 21, 2025
fa64df9
fix CI which is using 3.13.1
ngoldbaum Feb 21, 2025
46cf120
fix copy/paste error in noxfile
ngoldbaum Apr 10, 2025
adbf204
update ffi bindings for the latest changes in 3.14
ngoldbaum Apr 10, 2025
7a4430a
update layout of refcnt field on gil-enabled build
ngoldbaum Apr 10, 2025
d1de835
delete unused HangThread struct
ngoldbaum Apr 11, 2025
2d922f2
fix ffi-check on GIL-enabled build
ngoldbaum Apr 11, 2025
e910488
Revert "delete unused HangThread struct"
ngoldbaum Apr 11, 2025
73284b6
config-out HangThread
ngoldbaum Apr 11, 2025
79181ab
fix 3.13 ffi-check
ngoldbaum Apr 11, 2025
bdc0186
fix debug python build error
ngoldbaum Apr 11, 2025
0a12d9e
fix graalpy build
ngoldbaum Apr 11, 2025
a56aacb
Ignore DeprecationWarnings from the pytest_asyncio module in tests
clin1234 Apr 11, 2025
19d4295
Add abi3-py314
clin1234 Apr 11, 2025
6880abd
fix free-threading issue in `test_coroutine` (#5069)
davidhewitt Apr 21, 2025
eb16971
Introspection: add function signatures (#5025)
Tpt Apr 21, 2025
6e67f1e
Merge branch 'main' into 3.14-testing
ngoldbaum Apr 25, 2025
46a4dfc
respond to david's code review
ngoldbaum Apr 25, 2025
6ced135
add comment and fix test failure
ngoldbaum Apr 25, 2025
dcdd9e6
fix check-feature-powerset
ngoldbaum Apr 25, 2025
e2f28e6
fix clippy
ngoldbaum Apr 25, 2025
9889a86
fix wasip1 clippy
ngoldbaum Apr 25, 2025
0c97f89
fix 32 bit python 3.14 bug
ngoldbaum Apr 25, 2025
840cf88
Merge branch 'main' into 3.14-testing
ngoldbaum Apr 25, 2025
6d06135
mark test-py step continue-on-error for dev python builds
ngoldbaum Apr 26, 2025
c059f39
use github issue URL
ngoldbaum Apr 26, 2025
191ae30
run ffi-check before running tests
ngoldbaum Apr 26, 2025
87a6522
fix ffi-check for 3.14.0a7
ngoldbaum Apr 26, 2025
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
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ jobs:
"3.12",
"3.13",
"3.13t",
"3.14-dev",
"3.14t-dev",
"pypy3.9",
"pypy3.10",
"pypy3.11",
Expand Down Expand Up @@ -528,8 +530,8 @@ jobs:
components: rust-src
- name: Install python3 standalone debug build with nox
run: |
PBS_RELEASE="20241016"
PBS_PYTHON_VERSION="3.13.0"
PBS_RELEASE="20241219"
PBS_PYTHON_VERSION="3.13.1"
PBS_ARCHIVE="cpython-${PBS_PYTHON_VERSION}+${PBS_RELEASE}-x86_64-unknown-linux-gnu-debug-full.tar.zst"
wget "https://github.com/indygreg/python-build-standalone/releases/download/${PBS_RELEASE}/${PBS_ARCHIVE}"
tar -I zstd -xf "${PBS_ARCHIVE}"
Expand Down
1 change: 1 addition & 0 deletions newsfragments/4811.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bump supported cpython version to 3.14 for testing
6 changes: 3 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,11 +708,11 @@ def test_version_limits(session: nox.Session):
config_file.set("CPython", "3.6")
_run_cargo(session, "check", env=env, expect_error=True)

assert "3.14" not in PY_VERSIONS
config_file.set("CPython", "3.14")
assert "3.15" not in PY_VERSIONS
config_file.set("CPython", "3.15")
_run_cargo(session, "check", env=env, expect_error=True)

# 3.14 CPython should build with forward compatibility
# 3.15 CPython should build with forward compatibility
env["PYO3_USE_ABI3_FORWARD_COMPATIBILITY"] = "1"
_run_cargo(session, "check", env=env)

Expand Down
3 changes: 2 additions & 1 deletion pyo3-build-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ abi3-py39 = ["abi3-py310"]
abi3-py310 = ["abi3-py311"]
abi3-py311 = ["abi3-py312"]
abi3-py312 = ["abi3-py313"]
abi3-py313 = ["abi3"]
abi3-py313 = ["abi3-py314"]
abi3-py314 = ["abi3"]

[package.metadata.docs.rs]
features = ["resolve-config"]
19 changes: 19 additions & 0 deletions pyo3-ffi-check/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
use std::env;
use std::path::PathBuf;

#[derive(Debug)]
struct ParseCallbacks;

impl bindgen::callbacks::ParseCallbacks for ParseCallbacks {
// these are anonymous fields and structs in CPython that we needed to
// invent names for. Bindgen seems to generate stable names, so we remap the
// automatically generated names to the names we invented in the FFI
fn item_name(&self, _original_item_name: &str) -> Option<String> {
if _original_item_name == "_object__bindgen_ty_1__bindgen_ty_1" {
Some("PyObjectObFlagsAndRefcnt".into())
} else if _original_item_name == "_object__bindgen_ty_1" {
Some("PyObjectObRefcnt".into())
} else {
None
}
}
}

fn main() {
let config = pyo3_build_config::get();
let python_include_dir = config
Expand Down Expand Up @@ -29,6 +47,7 @@ fn main() {
.header("wrapper.h")
.clang_args(clang_args)
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.parse_callbacks(Box::new(ParseCallbacks))
// blocklist some values which apparently have conflicting definitions on unix
.blocklist_item("FP_NORMAL")
.blocklist_item("FP_SUBNORMAL")
Expand Down
5 changes: 3 additions & 2 deletions pyo3-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ abi3-py39 = ["abi3-py310", "pyo3-build-config/abi3-py39"]
abi3-py310 = ["abi3-py311", "pyo3-build-config/abi3-py310"]
abi3-py311 = ["abi3-py312", "pyo3-build-config/abi3-py311"]
abi3-py312 = ["abi3-py313", "pyo3-build-config/abi3-py312"]
abi3-py313 = ["abi3", "pyo3-build-config/abi3-py313"]
abi3-py313 = ["abi3-py314", "pyo3-build-config/abi3-py313"]
abi3-py314 = ["abi3", "pyo3-build-config/abi3-py314"]

# Automatically generates `python3.dll` import libraries for Windows targets.
generate-import-lib = ["pyo3-build-config/python3-dll-a"]
Expand All @@ -50,7 +51,7 @@ workspace = true

[package.metadata.cpython]
min-version = "3.7"
max-version = "3.13" # inclusive
max-version = "3.14" # inclusive

[package.metadata.pypy]
min-version = "3.9"
Expand Down
2 changes: 1 addition & 1 deletion pyo3-ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const SUPPORTED_VERSIONS_CPYTHON: SupportedVersions = SupportedVersions {
min: PythonVersion { major: 3, minor: 7 },
max: PythonVersion {
major: 3,
minor: 13,
minor: 14,
},
};

Expand Down
1 change: 1 addition & 0 deletions pyo3-ffi/src/abstract_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub unsafe fn PyObject_DelAttr(o: *mut PyObject, attr_name: *mut PyObject) -> c_
extern "C" {
#[cfg(all(
not(PyPy),
not(GraalPy),
any(Py_3_10, all(not(Py_LIMITED_API), Py_3_9)) // Added to python in 3.9 but to limited API in 3.10
))]
#[cfg_attr(PyPy, link_name = "PyPyObject_CallNoArgs")]
Expand Down
3 changes: 3 additions & 0 deletions pyo3-ffi/src/cpython/dictobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ pub struct PyDictObject {
Py_3_12,
deprecated(note = "Deprecated in Python 3.12 and will be removed in the future.")
)]
#[cfg(not(Py_3_14))]
pub ma_version_tag: u64,
#[cfg(Py_3_14)]
_ma_watcher_tag: u64,
pub ma_keys: *mut PyDictKeysObject,
#[cfg(not(Py_3_11))]
pub ma_values: *mut *mut PyObject,
Expand Down
2 changes: 2 additions & 0 deletions pyo3-ffi/src/cpython/funcobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ pub struct PyFunctionObject {
pub func_weakreflist: *mut PyObject,
pub func_module: *mut PyObject,
pub func_annotations: *mut PyObject,
#[cfg(Py_3_14)]
pub func_annotate: *mut PyObject,
#[cfg(Py_3_12)]
pub func_typeparams: *mut PyObject,
pub vectorcall: Option<crate::vectorcallfunc>,
Expand Down
7 changes: 5 additions & 2 deletions pyo3-ffi/src/cpython/genobject.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::object::*;
use crate::PyFrameObject;
#[cfg(all(Py_3_11, not(any(PyPy, GraalPy))))]
#[cfg(all(Py_3_11, not(any(PyPy, GraalPy, Py_3_14))))]
use std::os::raw::c_char;
use std::os::raw::c_int;
use std::ptr::addr_of_mut;

#[cfg(not(any(PyPy, GraalPy)))]
#[cfg(not(any(PyPy, GraalPy, Py_3_14)))]
#[repr(C)]
pub struct PyGenObject {
pub ob_base: PyObject,
Expand Down Expand Up @@ -33,6 +33,9 @@ pub struct PyGenObject {
pub gi_iframe: [*mut PyObject; 1],
}

#[cfg(all(Py_3_14, not(any(PyPy, GraalPy))))]
opaque_struct!(pub PyGenObject);

#[cfg_attr(windows, link(name = "pythonXY"))]
extern "C" {
pub static mut PyGen_Type: PyTypeObject;
Expand Down
10 changes: 10 additions & 0 deletions pyo3-ffi/src/cpython/initconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ pub struct PyConfig {
pub tracemalloc: c_int,
#[cfg(Py_3_12)]
pub perf_profiling: c_int,
#[cfg(Py_3_14)]
pub remote_debug: c_int,
pub import_time: c_int,
#[cfg(Py_3_11)]
pub code_debug_ranges: c_int,
Expand Down Expand Up @@ -141,10 +143,18 @@ pub struct PyConfig {
pub safe_path: c_int,
#[cfg(Py_3_12)]
pub int_max_str_digits: c_int,
#[cfg(Py_3_14)]
pub thread_inherit_context: c_int,
#[cfg(Py_3_14)]
pub context_aware_warnings: c_int,
#[cfg(all(Py_3_14, target_os = "macos"))]
pub use_system_logger: c_int,
#[cfg(Py_3_13)]
pub cpu_count: c_int,
#[cfg(Py_GIL_DISABLED)]
pub enable_gil: c_int,
#[cfg(all(Py_3_14, Py_GIL_DISABLED))]
pub tlbc_enabled: c_int,
pub pathconfig_warnings: c_int,
#[cfg(Py_3_10)]
pub program_name: *mut wchar_t,
Expand Down
4 changes: 4 additions & 0 deletions pyo3-ffi/src/cpython/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,12 @@ pub struct PyHeapTypeObject {
pub ht_module: *mut object::PyObject,
#[cfg(all(Py_3_11, not(PyPy)))]
_ht_tpname: *mut c_char,
#[cfg(Py_3_14)]
pub ht_token: *mut c_void,
#[cfg(all(Py_3_11, not(PyPy)))]
_spec_cache: _specialization_cache,
#[cfg(all(Py_GIL_DISABLED, Py_3_14))]
pub unique_id: Py_ssize_t,
}

impl Default for PyHeapTypeObject {
Expand Down
2 changes: 2 additions & 0 deletions pyo3-ffi/src/cpython/pyerrors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ pub struct PySyntaxErrorObject {
pub end_offset: *mut PyObject,
pub text: *mut PyObject,
pub print_file_and_line: *mut PyObject,
#[cfg(Py_3_14)]
pub metadata: *mut PyObject,
}

#[cfg(not(any(PyPy, GraalPy)))]
Expand Down
4 changes: 4 additions & 0 deletions pyo3-ffi/src/cpython/tupleobject.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
use crate::object::*;
#[cfg(Py_3_14)]
use crate::pyport::Py_hash_t;
#[cfg(not(PyPy))]
use crate::pyport::Py_ssize_t;

#[repr(C)]
pub struct PyTupleObject {
pub ob_base: PyVarObject,
#[cfg(Py_3_14)]
pub ob_hash: Py_hash_t,
pub ob_item: [*mut PyObject; 1],
}

Expand Down
Loading
Loading