diff --git a/.github/workflows/artifact.yaml b/.github/workflows/artifact.yaml index ecb0cd86..dcce4e2e 100644 --- a/.github/workflows/artifact.yaml +++ b/.github/workflows/artifact.yaml @@ -81,7 +81,6 @@ jobs: { interpreter: 'python3.11', package: 'python3.11' }, { interpreter: 'python3.10', package: 'python3.10' }, { interpreter: 'python3.9', package: 'python3.9' }, - { interpreter: 'python3.8', package: 'python3.8' }, ] env: PYTHON: "${{ matrix.python.interpreter }}" @@ -247,7 +246,6 @@ jobs: { version: '3.11' }, { version: '3.10' }, { version: '3.9' }, - { version: '3.8' }, ] platform: - target: aarch64-unknown-linux-musl @@ -322,7 +320,6 @@ jobs: { version: '3.11', abi: 'cp311-cp311' }, { version: '3.10', abi: 'cp310-cp310' }, { version: '3.9', abi: 'cp39-cp39' }, - { version: '3.8', abi: 'cp38-cp38' }, ] target: [ { @@ -465,7 +462,6 @@ jobs: matrix: python: [ { version: '3.9', macosx_target: "10.15" }, - { version: '3.8', macosx_target: "10.15" }, ] env: CC: "clang" diff --git a/.github/workflows/debug.yaml b/.github/workflows/debug.yaml index 60c9fe05..e57ed1d4 100644 --- a/.github/workflows/debug.yaml +++ b/.github/workflows/debug.yaml @@ -16,7 +16,7 @@ jobs: python: [ { version: '3.13' }, { version: '3.12' }, - { version: '3.8' }, + { version: '3.9' }, ] env: CC: "gcc" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index df817411..ae858165 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -8,7 +8,7 @@ jobs: with: python-version: "3.12" - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=default -y - - run: pip install -U autoflake isort black ruff mypy types-python-dateutil types-pytz types-simplejson types-ujson + - run: pip install -U ruff mypy types-python-dateutil types-pytz types-simplejson types-ujson - uses: actions/checkout@v4 diff --git a/README.md b/README.md index 2fa365c7..0936ec42 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ support for 64-bit * does not provide `load()` or `dump()` functions for reading from/writing to file-like objects -orjson supports CPython 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14. +orjson supports CPython 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14. It distributes amd64/x86_64, aarch64/armv8, arm7, POWER/ppc64le, and s390x wheels for Linux, amd64 and aarch64 wheels for macOS, and amd64 diff --git a/build.rs b/build.rs index 4eac1746..6eae9d22 100644 --- a/build.rs +++ b/build.rs @@ -19,7 +19,6 @@ fn main() { println!("cargo:rustc-check-cfg=cfg(Py_3_12)"); println!("cargo:rustc-check-cfg=cfg(Py_3_13)"); println!("cargo:rustc-check-cfg=cfg(Py_3_14)"); - println!("cargo:rustc-check-cfg=cfg(Py_3_8)"); println!("cargo:rustc-check-cfg=cfg(Py_3_9)"); println!("cargo:rustc-check-cfg=cfg(Py_GIL_DISABLED)"); diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 8382734e..1c979a45 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -83,22 +83,6 @@ jobs: - checkout: self - template: ./azure-win.yml -- job: win_python38_amd64 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.8.10\x64\python.exe - rustup: https://win.rustup.rs/x86_64 - target: x86_64-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.8.10' - addToPath: true - architecture: 'x64' - - checkout: self - - template: ./azure-win.yml - - job: win_python313_x86 pool: vmImage: windows-2022 @@ -178,19 +162,3 @@ jobs: architecture: 'x86' - checkout: self - template: ./azure-win.yml - -- job: win_python38_x86 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.8.10\x86\python.exe - rustup: https://win.rustup.rs/x86 - target: i686-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.8.10' - addToPath: true - architecture: 'x86' - - checkout: self - - template: ./azure-win.yml diff --git a/pyproject.toml b/pyproject.toml index 38ae9c19..dd96fd8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "orjson" repository = "https://github.com/ijl/orjson" -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -11,7 +11,6 @@ classifiers = [ "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -42,7 +41,7 @@ include = [ [tool.ruff] line-length = 88 -target-version = "py38" +target-version = "py39" [tool.ruff.lint] select = [ @@ -57,4 +56,4 @@ ignore = [ known-first-party = ["orjson"] [tool.mypy] -python_version = "3.8" +python_version = "3.9" diff --git a/src/ffi/fragment.rs b/src/ffi/fragment.rs index 9cfd4d7f..ae0fe664 100644 --- a/src/ffi/fragment.rs +++ b/src/ffi/fragment.rs @@ -98,8 +98,6 @@ pub unsafe extern "C" fn orjson_fragmenttype_new() -> *mut PyTypeObject { tp_vectorcall: None, tp_version_tag: 0, tp_weaklist: null_mut(), - #[cfg(not(Py_3_9))] - tp_print: None, tp_vectorcall_offset: 0, tp_getattr: None, tp_setattr: None, diff --git a/src/serialize/per_type/datetime.rs b/src/serialize/per_type/datetime.rs index 951398e7..fe9125f8 100644 --- a/src/serialize/per_type/datetime.rs +++ b/src/serialize/per_type/datetime.rs @@ -5,9 +5,9 @@ use crate::serialize::error::SerializeError; use crate::serialize::per_type::datetimelike::{ DateTimeBuffer, DateTimeError, DateTimeLike, Offset, }; -#[cfg(Py_3_9)] -use crate::typeref::ZONEINFO_TYPE; -use crate::typeref::{CONVERT_METHOD_STR, DST_STR, NORMALIZE_METHOD_STR, UTCOFFSET_METHOD_STR}; +use crate::typeref::{ + CONVERT_METHOD_STR, DST_STR, NORMALIZE_METHOD_STR, UTCOFFSET_METHOD_STR, ZONEINFO_TYPE, +}; use serde::ser::{Serialize, Serializer}; macro_rules! write_double_digit { @@ -203,7 +203,6 @@ impl DateTimeLike for DateTime { } } - #[cfg(Py_3_9)] fn offset(&self) -> Result { if !self.has_tz() { Ok(Offset::default()) @@ -223,15 +222,6 @@ impl DateTimeLike for DateTime { } } } - - #[cfg(not(Py_3_9))] - fn offset(&self) -> Result { - if !self.has_tz() { - Ok(Offset::default()) - } else { - self.slow_offset() - } - } } impl Serialize for DateTime { diff --git a/src/typeref.rs b/src/typeref.rs index 0fe13f9f..68c24213 100644 --- a/src/typeref.rs +++ b/src/typeref.rs @@ -58,7 +58,6 @@ pub static mut FRAGMENT_TYPE: *mut PyTypeObject = null_mut(); pub static mut NUMPY_TYPES: OnceBox>> = OnceBox::new(); -#[cfg(Py_3_9)] pub static mut ZONEINFO_TYPE: *mut PyTypeObject = null_mut(); pub static mut UTCOFFSET_METHOD_STR: *mut PyObject = null_mut(); @@ -172,11 +171,7 @@ fn _init_typerefs_impl() -> bool { UUID_TYPE = look_up_uuid_type(); ENUM_TYPE = look_up_enum_type(); FIELD_TYPE = look_up_field_type(); - - #[cfg(Py_3_9)] - { - ZONEINFO_TYPE = look_up_zoneinfo_type(); - } + ZONEINFO_TYPE = look_up_zoneinfo_type(); INT_ATTR_STR = PyUnicode_InternFromString("int\0".as_ptr() as *const c_char); UTCOFFSET_METHOD_STR = PyUnicode_InternFromString("utcoffset\0".as_ptr() as *const c_char); @@ -334,7 +329,6 @@ unsafe fn look_up_time_type() -> *mut PyTypeObject { ptr } -#[cfg(Py_3_9)] #[cold] #[cfg_attr(feature = "optimize", optimize(size))] unsafe fn look_up_zoneinfo_type() -> *mut PyTypeObject { diff --git a/src/util.rs b/src/util.rs index 8add0f75..d0e37c43 100644 --- a/src/util.rs +++ b/src/util.rs @@ -142,7 +142,6 @@ macro_rules! ffi { }; } -#[cfg(Py_3_9)] macro_rules! call_method { ($obj1:expr, $obj2:expr) => { unsafe { pyo3_ffi::PyObject_CallMethodNoArgs($obj1, $obj2) } @@ -152,29 +151,6 @@ macro_rules! call_method { }; } -#[cfg(not(Py_3_9))] -macro_rules! call_method { - ($obj1:expr, $obj2:expr) => { - unsafe { - pyo3_ffi::PyObject_CallMethodObjArgs( - $obj1, - $obj2, - core::ptr::null_mut() as *mut pyo3_ffi::PyObject, - ) - } - }; - ($obj1:expr, $obj2:expr, $obj3:expr) => { - unsafe { - pyo3_ffi::PyObject_CallMethodObjArgs( - $obj1, - $obj2, - $obj3, - core::ptr::null_mut() as *mut pyo3_ffi::PyObject, - ) - } - }; -} - macro_rules! str_hash { ($op:expr) => { unsafe { (*$op.cast::()).hash } diff --git a/test/requirements.txt b/test/requirements.txt index b07f7a6b..f2df4f1e 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -8,5 +8,3 @@ pytest pytest-random-order pytest-xdist pytz -typing_extensions;python_version<"3.8" -xxhash==1.4.3;sys_platform=="linux" and platform_machine=="x86_64" and python_version<"3.9" # creates non-compact ASCII for test_str_ascii diff --git a/test/test_type.py b/test/test_type.py index 81c89307..3a3f7a56 100644 --- a/test/test_type.py +++ b/test/test_type.py @@ -5,11 +5,6 @@ import pytest -try: - import xxhash -except ImportError: - xxhash = None - import orjson @@ -260,17 +255,6 @@ def test_str_surrogates_dumps(self): orjson.JSONEncodeError, orjson.dumps, b"\xed\xa0\xbd\xed\xba\x80" ) # \ud83d\ude80 - @pytest.mark.skipif( - xxhash is None, reason="xxhash install broken on win, python3.9, Azure" - ) - def test_str_ascii(self): - """ - str is ASCII but not compact - """ - digest = xxhash.xxh32_hexdigest("12345") - for _ in range(2): - assert orjson.dumps(digest) == b'"b30d56b4"' - def test_bytes_dumps(self): """ bytes dumps not supported