Skip to content

Commit b718e75

Browse files
committed
Drop support for python3.9
1 parent f12e562 commit b718e75

14 files changed

Lines changed: 35 additions & 72 deletions

File tree

.github/workflows/artifact.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ jobs:
8787
{ interpreter: 'python3.12', compatibility: "manylinux_2_17", publish: true },
8888
{ interpreter: 'python3.11', compatibility: "manylinux_2_17", publish: true },
8989
{ interpreter: 'python3.10', compatibility: "manylinux_2_17", publish: true },
90-
{ interpreter: 'python3.9', compatibility: "manylinux_2_17", publish: true },
9190
]
9291
arch: [
9392
{ runner: "ubuntu-24.04", arch: "x86_64", features: "avx512", },
@@ -148,7 +147,6 @@ jobs:
148147
{ interpreter: 'python3.12', abi: 'cp312-cp312', manylinux: 'manylinux_2_17', publish: true },
149148
{ interpreter: 'python3.11', abi: 'cp311-cp311', manylinux: 'manylinux_2_17', publish: true },
150149
{ interpreter: 'python3.10', abi: 'cp310-cp310', manylinux: 'manylinux_2_17', publish: true },
151-
{ interpreter: 'python3.9', abi: 'cp39-cp39', manylinux: 'manylinux_2_17', publish: true },
152150
]
153151
target: [
154152
{
@@ -254,7 +252,6 @@ jobs:
254252
{ version: '3.12', pytest: '1', publish: true },
255253
{ version: '3.11', pytest: '0', publish: true },
256254
{ version: '3.10', pytest: '0', publish: true },
257-
{ version: '3.9', pytest: '0', publish: true },
258255
]
259256
platform:
260257
- target: x86_64-unknown-linux-musl
@@ -330,7 +327,6 @@ jobs:
330327
{ version: '3.12', publish: true },
331328
{ version: '3.11', publish: true },
332329
{ version: '3.10', publish: true },
333-
{ version: '3.9', publish: true },
334330
]
335331
platform:
336332
- target: aarch64-unknown-linux-musl
@@ -485,7 +481,6 @@ jobs:
485481
{ version: '3.12', macosx_target: "10.15", publish: true },
486482
{ version: '3.11', macosx_target: "10.15", publish: true },
487483
{ version: '3.10', macosx_target: "10.15", publish: true },
488-
{ version: '3.9', macosx_target: "10.15", publish: true },
489484
]
490485
env:
491486
CC: "clang"
@@ -571,7 +566,6 @@ jobs:
571566
{ version: '3.12', publish: true },
572567
{ version: '3.11', publish: true },
573568
{ version: '3.10', publish: true },
574-
{ version: '3.9', publish: true },
575569
]
576570
platform: [
577571
{ arch: "x64", target: "x86_64-pc-windows-msvc", features: "avx512" },

.github/workflows/unusual.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: MPL-2.0
2-
# Copyright ijl (2023-2025)
2+
# Copyright ijl (2023-2026)
33

44
name: unusual
55
on: push
@@ -16,7 +16,7 @@ jobs:
1616
cfg: [
1717
{ rust: "1.85", python: "3.15", version_check: "1" },
1818
{ rust: "1.85", python: "3.14", version_check: "0" },
19-
{ rust: "1.85", python: "3.9", version_check: "0" },
19+
{ rust: "1.85", python: "3.10", version_check: "0" },
2020
]
2121
steps:
2222
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${{ matrix.cfg.rust }} --profile minimal -y

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RFC 8259 ("The JavaScript Object Notation (JSON) Data Interchange Format").
2121
Reading from and writing to files, line-delimited JSON files, and so on is
2222
not provided by the library.
2323

24-
orjson supports CPython 3.9, 3.10, 3.11, 3.12, 3.13, 3.14, and 3.15.
24+
orjson supports CPython 3.10, 3.11, 3.12, 3.13, 3.14, and 3.15.
2525

2626
It distributes amd64/x86_64/x64, i686/x86, aarch64/arm64/armv8, arm7,
2727
ppc64le/POWER8, and s390x wheels for Linux, amd64 and aarch64 wheels
@@ -692,7 +692,7 @@ b'"2100-09-01T21:55:02"'
692692
```
693693

694694
`datetime.datetime` supports instances with a `tzinfo` that is `None`,
695-
`datetime.timezone.utc`, a timezone instance from the python3.9+ `zoneinfo`
695+
`datetime.timezone.utc`, a timezone instance from the standard library `zoneinfo`
696696
module, or a timezone instance from the third-party `pendulum`, `pytz`, or
697697
`dateutil`/`arrow` libraries.
698698

build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ fn main() {
4444
println!("cargo:rustc-check-cfg=cfg(Py_3_13)");
4545
println!("cargo:rustc-check-cfg=cfg(Py_3_14)");
4646
println!("cargo:rustc-check-cfg=cfg(Py_3_15)");
47-
println!("cargo:rustc-check-cfg=cfg(Py_3_9)");
4847
println!("cargo:rustc-check-cfg=cfg(Py_GIL_DISABLED)");
4948
println!("cargo:rustc-check-cfg=cfg(PyPy)");
5049

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "orjson"
33
version = "3.11.5"
44
repository = "https://github.com/ijl/orjson"
55
description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy"
6-
requires-python = ">=3.9"
6+
requires-python = ">=3.10"
77
classifiers = [
88
"Development Status :: 5 - Production/Stable",
99
"Intended Audience :: Developers",
@@ -14,7 +14,6 @@ classifiers = [
1414
"Operating System :: Microsoft :: Windows",
1515
"Operating System :: POSIX :: Linux",
1616
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.9",
1817
"Programming Language :: Python :: 3.10",
1918
"Programming Language :: Python :: 3.11",
2019
"Programming Language :: Python :: 3.12",
@@ -50,7 +49,7 @@ include = [
5049

5150
[tool.ruff]
5251
line-length = 88
53-
target-version = "py39"
52+
target-version = "py310"
5453

5554
[tool.ruff.lint]
5655
select = [
@@ -96,7 +95,7 @@ strict = true
9695
known-first-party = ["orjson"]
9796

9897
[tool.mypy]
99-
python_version = "3.9"
98+
python_version = "3.10"
10099

101100
[[tool.mypy.overrides]]
102101
module = ["dateutil", "pytz"]

pysrc/orjson/__init__.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
2-
# Copyright ijl (2019-2025), Eric Jolibois (2022), Anders Kaseorg (2020)
2+
# Copyright ijl (2019-2026), Eric Jolibois (2022), Anders Kaseorg (2020)
33

44
import json
5-
from typing import Any, Callable
5+
from collections.abc import Callable
6+
from typing import Any
67

78
__version__: str
89

script/check-pypi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pyproject_version = pyproject_doc["project"]["version"]
1515
prefix = f"orjson-{pyproject_version}"
1616

1717
abis = (
18-
"cp39-cp39",
1918
"cp310-cp310",
2019
"cp311-cp311",
2120
"cp312-cp312",

src/ffi/compat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MPL-2.0
2-
// Copyright ijl (2024-2025)
2+
// Copyright ijl (2024-2026)
33

44
#[cfg(Py_GIL_DISABLED)]
55
#[allow(non_upper_case_globals)]
@@ -203,7 +203,7 @@ unsafe extern "C" {
203203
hash: *mut pyo3_ffi::Py_hash_t,
204204
) -> core::ffi::c_int;
205205

206-
#[cfg(all(CPython, Py_3_10))]
206+
#[cfg(CPython)]
207207
pub fn _PyDict_Contains_KnownHash(
208208
op: *mut pyo3_ffi::PyObject,
209209
key: *mut pyo3_ffi::PyObject,

src/ffi/fragment.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MPL-2.0
2-
// Copyright ijl (2020-2025)
2+
// Copyright ijl (2020-2026)
33

44
use core::ffi::c_char;
55

@@ -118,10 +118,8 @@ pub(crate) unsafe extern "C" fn orjson_fragmenttype_new() -> *mut PyTypeObject {
118118
#[cfg(Py_GIL_DISABLED)]
119119
let tp_flags: AtomicCULong =
120120
AtomicCULong::new(Py_TPFLAGS_DEFAULT | pyo3_ffi::Py_TPFLAGS_IMMUTABLETYPE);
121-
#[cfg(all(Py_3_10, not(Py_GIL_DISABLED)))]
121+
#[cfg(not(Py_GIL_DISABLED))]
122122
let tp_flags: core::ffi::c_ulong = Py_TPFLAGS_DEFAULT | pyo3_ffi::Py_TPFLAGS_IMMUTABLETYPE;
123-
#[cfg(not(Py_3_10))]
124-
let tp_flags: core::ffi::c_ulong = Py_TPFLAGS_DEFAULT;
125123
let ob = Box::new(PyTypeObject {
126124
ob_base: PyVarObject {
127125
ob_base: PyObject {

src/ffi/mod.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MPL-2.0
2-
// Copyright ijl (2022-2025)
2+
// Copyright ijl (2022-2026)
33

44
#[cfg(Py_GIL_DISABLED)]
55
mod atomiculong;
@@ -18,7 +18,7 @@ pub(crate) use long::pylong_is_unsigned;
1818
#[cfg(feature = "inline_int")]
1919
pub(crate) use long::{pylong_fits_in_i32, pylong_get_inline_value, pylong_is_zero};
2020

21-
#[allow(unused_imports, deprecated)]
21+
#[allow(unused_imports)]
2222
pub(crate) use pyo3_ffi::{
2323
_PyBytes_Resize, METH_FASTCALL, METH_KEYWORDS, METH_O, Py_DECREF, Py_False, Py_INCREF, Py_None,
2424
Py_REFCNT, Py_SIZE, Py_TPFLAGS_DEFAULT, Py_TPFLAGS_DICT_SUBCLASS, Py_TPFLAGS_LIST_SUBCLASS,
@@ -33,30 +33,29 @@ pub(crate) use pyo3_ffi::{
3333
PyDateTime_IMPORT, PyDateTime_TIME_GET_HOUR, PyDateTime_TIME_GET_MICROSECOND,
3434
PyDateTime_TIME_GET_MINUTE, PyDateTime_TIME_GET_SECOND, PyDateTime_Time, PyDict_Contains,
3535
PyDict_New, PyDict_Next, PyDict_SetItem, PyDict_Type, PyDictObject, PyErr_Clear,
36-
PyErr_NewException, PyErr_Occurred, PyErr_Restore, PyErr_SetObject, PyExc_TypeError,
37-
PyException_SetCause, PyFloat_AS_DOUBLE, PyFloat_FromDouble, PyFloat_Type,
38-
PyImport_ImportModule, PyList_GET_ITEM, PyList_New, PyList_SET_ITEM, PyList_Type, PyListObject,
39-
PyLong_AsLong, PyLong_AsLongLong, PyLong_AsUnsignedLongLong, PyLong_FromLongLong,
40-
PyLong_FromUnsignedLongLong, PyLong_Type, PyLongObject, PyMapping_GetItemString, PyMem_Free,
41-
PyMem_Malloc, PyMem_Realloc, PyMemoryView_Type, PyMethodDef, PyMethodDefPointer,
42-
PyModule_AddIntConstant, PyModuleDef, PyModuleDef_HEAD_INIT, PyModuleDef_Init,
43-
PyModuleDef_Slot, PyObject, PyObject_CallMethodObjArgs, PyObject_GenericGetDict,
36+
PyErr_NewException, PyErr_Occurred, PyErr_SetObject, PyExc_TypeError, PyException_SetCause,
37+
PyFloat_AS_DOUBLE, PyFloat_FromDouble, PyFloat_Type, PyImport_ImportModule, PyList_GET_ITEM,
38+
PyList_New, PyList_SET_ITEM, PyList_Type, PyListObject, PyLong_AsLong, PyLong_AsLongLong,
39+
PyLong_AsUnsignedLongLong, PyLong_FromLongLong, PyLong_FromUnsignedLongLong, PyLong_Type,
40+
PyLongObject, PyMapping_GetItemString, PyMem_Free, PyMem_Malloc, PyMem_Realloc,
41+
PyMemoryView_Type, PyMethodDef, PyMethodDefPointer, PyModule_AddIntConstant,
42+
PyModule_AddObject, PyModuleDef, PyModuleDef_HEAD_INIT, PyModuleDef_Init, PyModuleDef_Slot,
43+
PyObject, PyObject_CallFunctionObjArgs, PyObject_CallMethodObjArgs, PyObject_GenericGetDict,
4444
PyObject_GetAttr, PyObject_HasAttr, PyObject_Hash, PyObject_Vectorcall, PyTuple_New,
4545
PyTuple_Type, PyTupleObject, PyType_Ready, PyType_Type, PyTypeObject, PyUnicode_AsUTF8AndSize,
4646
PyUnicode_FromStringAndSize, PyUnicode_InternFromString, PyUnicode_New, PyUnicode_Type,
4747
PyVarObject, PyVectorcall_NARGS,
4848
};
4949

50+
#[allow(unused_imports, deprecated)]
51+
pub(crate) use pyo3_ffi::PyErr_Restore;
52+
5053
#[cfg(CPython)]
5154
pub(crate) use pyo3_ffi::{PyObject_CallMethodNoArgs, PyObject_CallMethodOneArg};
5255

5356
#[cfg(all(CPython, not(target_endian = "little")))]
5457
pub(crate) use pyo3_ffi::{PyUnicode_DATA, PyUnicode_KIND};
5558

56-
#[cfg(not(Py_3_10))]
57-
#[allow(unused_imports)]
58-
pub(crate) use pyo3_ffi::{PyModule_AddObject, PyObject_CallFunctionObjArgs};
59-
6059
#[cfg(Py_3_12)]
6160
#[allow(unused_imports)]
6261
pub(crate) use pyo3_ffi::{
@@ -68,7 +67,7 @@ pub(crate) use pyo3_ffi::{
6867
#[allow(unused_imports)]
6968
pub(crate) use pyo3_ffi::{PyErr_Fetch, PyErr_NormalizeException};
7069

71-
#[cfg(all(Py_3_10, not(Py_3_13)))]
70+
#[cfg(not(Py_3_13))]
7271
#[allow(unused_imports)]
7372
pub(crate) use pyo3_ffi::PyModule_AddObjectRef;
7473

0 commit comments

Comments
 (0)