Skip to content

Commit 5610078

Browse files
committed
MSRV 1.89
1 parent 01fff2d commit 5610078

File tree

6 files changed

+24
-14
lines changed

6 files changed

+24
-14
lines changed

.github/workflows/artifact.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env:
55
ORJSON_BUILD_FREETHREADED: "1"
66
PIP_DISABLE_PIP_VERSION_CHECK: "1"
77
RUST_TOOLCHAIN: "nightly-2025-12-01"
8-
RUST_TOOLCHAIN_STABLE: "1.85"
8+
RUST_TOOLCHAIN_STABLE: "1.89"
99
UNSAFE_PYO3_BUILD_FREE_THREADED: "1"
1010
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
1111
UV_LINK_MODE: "copy"

.github/workflows/unusual.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
cfg: [
14-
{ rust: "1.85", python: "3.15", version_check: "1" },
15-
{ rust: "1.85", python: "3.14", version_check: "0" },
16-
{ rust: "1.85", python: "3.10", version_check: "0" },
14+
{ rust: "1.89", python: "3.15", version_check: "1" },
15+
{ rust: "1.89", python: "3.14", version_check: "0" },
16+
{ rust: "1.89", python: "3.10", version_check: "0" },
1717
]
1818
steps:
1919
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${{ matrix.cfg.rust }} --profile minimal -y

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = "Fast, correct Python JSON library supporting dataclasses, datetim
66
repository = "https://github.com/ijl/orjson"
77
edition = "2024"
88
resolver = "3"
9-
rust-version = "1.85"
9+
rust-version = "1.89"
1010
license = "Apache-2.0 OR MIT"
1111
keywords = ["fast", "json", "dataclass", "dataclasses", "datetime", "rfc", "8259", "3339"]
1212
include = [

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,15 +1068,15 @@ functions and objects using the normal `PyImport_*` APIs.
10681068

10691069
## Packaging
10701070

1071-
To package orjson requires at least [Rust](https://www.rust-lang.org/) 1.85,
1071+
To package orjson requires at least [Rust](https://www.rust-lang.org/) 1.89,
10721072
a C compiler, and the [maturin](https://github.com/PyO3/maturin) build tool.
10731073
The recommended build command is:
10741074

10751075
```sh
10761076
maturin build --release --strip
10771077
```
10781078

1079-
The project's own CI tests against `nightly-2025-12-01` and stable 1.85. It
1079+
The project's own CI tests against `nightly-2025-12-01` and stable 1.89. It
10801080
is prudent to pin the nightly version because that channel can introduce
10811081
breaking changes. There is a significant performance benefit to using
10821082
nightly.

build.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ fn main() {
88
not_supported("free-threaded Python")
99
}
1010

11-
for cfg in python_config.build_script_outputs() {
12-
println!("{cfg}");
13-
}
14-
1511
#[allow(unused_variables)]
1612
let is_64_bit_python = matches!(python_config.pointer_width, Some(64));
1713

@@ -27,6 +23,10 @@ fn main() {
2723
pyo3_build_config::PythonImplementation::PyPy => not_supported("PyPy"),
2824
}
2925

26+
for cfg in python_config.build_script_outputs() {
27+
println!("{cfg}");
28+
}
29+
3030
println!("cargo:rerun-if-changed=build.rs");
3131
println!("cargo:rerun-if-changed=include/yyjson/*");
3232
println!("cargo:rerun-if-env-changed=CC");
@@ -48,7 +48,7 @@ fn main() {
4848
println!("cargo:rustc-check-cfg=cfg(PyPy)");
4949

5050
#[cfg(all(target_arch = "x86_64", not(target_os = "macos")))]
51-
if version_check::is_min_version("1.89.0").unwrap_or(false) && is_64_bit_python {
51+
if is_64_bit_python {
5252
println!("cargo:rustc-cfg=feature=\"avx512\"");
5353
}
5454

src/lib.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#![allow(clippy::host_endian_bytes)]
2828
#![allow(clippy::if_not_else)]
2929
#![allow(clippy::implicit_return)]
30-
#![allow(clippy::incompatible_msrv)] // MSRV 1.89
3130
#![allow(clippy::inline_always)]
3231
#![allow(clippy::let_underscore_untyped)]
3332
#![allow(clippy::missing_assert_message)]
@@ -106,13 +105,20 @@ macro_rules! add {
106105
};
107106
}
108107

109-
#[cfg(not(Py_3_13))]
108+
#[cfg(all(Py_3_10, not(Py_3_13)))]
110109
macro_rules! add {
111110
($mptr:expr, $name:expr, $obj:expr) => {
112111
crate::ffi::PyModule_AddObjectRef($mptr, $name.as_ptr(), $obj);
113112
};
114113
}
115114

115+
#[cfg(not(Py_3_10))]
116+
macro_rules! add {
117+
($mptr:expr, $name:expr, $obj:expr) => {
118+
crate::ffi::PyModule_AddObject($mptr, $name.as_ptr(), $obj);
119+
};
120+
}
121+
116122
macro_rules! opt {
117123
($mptr:expr, $name:expr, $opt:expr) => {
118124
#[cfg(all(not(target_os = "windows"), target_pointer_width = "64"))]
@@ -127,6 +133,7 @@ macro_rules! opt {
127133
#[allow(non_snake_case)]
128134
#[unsafe(no_mangle)]
129135
#[cold]
136+
#[cfg_attr(not(Py_3_10), allow(deprecated))] // _PyCFunctionFastWithKeywords
130137
#[cfg_attr(feature = "optimize", optimize(size))]
131138
pub(crate) unsafe extern "C" fn orjson_init_exec(mptr: *mut PyObject) -> c_int {
132139
unsafe {
@@ -147,7 +154,10 @@ pub(crate) unsafe extern "C" fn orjson_init_exec(mptr: *mut PyObject) -> c_int {
147154
let wrapped_dumps = Box::new(PyMethodDef {
148155
ml_name: c"dumps".as_ptr(),
149156
ml_meth: PyMethodDefPointer {
157+
#[cfg(Py_3_10)]
150158
PyCFunctionFastWithKeywords: dumps,
159+
#[cfg(not(Py_3_10))]
160+
_PyCFunctionFastWithKeywords: dumps,
151161
},
152162
ml_flags: crate::ffi::METH_FASTCALL | METH_KEYWORDS,
153163
ml_doc: dumps_doc.as_ptr(),

0 commit comments

Comments
 (0)