diff --git a/.github/workflows/debug.yaml b/.github/workflows/debug.yaml index 54387740..06b6d8fe 100644 --- a/.github/workflows/debug.yaml +++ b/.github/workflows/debug.yaml @@ -12,6 +12,7 @@ jobs: { version: "nightly-2023-10-10" }, ] python: [ + { version: '3.12', abi: 'cp312-cp312' }, { version: '3.11', abi: 'cp311-cp311' }, { version: '3.8', abi: 'cp38-cp38' }, ] diff --git a/Cargo.lock b/Cargo.lock index 57f704e7..d180fefe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,13 +4,14 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -45,9 +46,9 @@ dependencies = [ [[package]] name = "bytecount" -version = "0.6.4" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad152d03a2c813c80bb94fedbf3a3f02b28f793e39e7c214c8a0bcc196343de7" +checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" dependencies = [ "packed_simd", ] @@ -254,18 +255,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" dependencies = [ "proc-macro2", "quote", @@ -314,9 +315,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "unicode-ident" @@ -329,3 +330,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81ba595b9f2772fbee2312de30eeb80ec773b4cb2f1e8098db024afadda6c06f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772666c41fb6dceaf520b564b962d738a8e1a83b41bd48945f50837aed78bb1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index 8dfc6289..9ec26b01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,12 +48,12 @@ no-panic = [ yyjson = [] [dependencies] -ahash = { version = "0.8", default_features = false } +ahash = { version = "^0.8.6", default_features = false } arrayvec = { version = "0.7", default_features = false, features = ["std", "serde"] } associative-cache = { version = "2", default_features = false } beef = { version = "0.5", default_features = false, features = ["impl_serde"] } -bytecount = { version = "^0.6.4", default_features = false, features = ["runtime-dispatch-simd"] } -chrono = { version = "^0.4.24", default_features = false } +bytecount = { version = "^0.6.7", default_features = false, features = ["runtime-dispatch-simd"] } +chrono = { version = "^0.4.31", default_features = false } compact_str = { version = "0.7", default_features = false, features = ["serde"] } encoding_rs = { version = "0.8", default_features = false } itoa = { version = "1", default_features = false } diff --git a/src/lib.rs b/src/lib.rs index 31763b54..63b9a59a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -208,7 +208,7 @@ fn raise_loads_exception(err: deserialize::DeserializeError) -> *mut PyObject { PyTuple_SET_ITEM(args, 1, doc); PyTuple_SET_ITEM(args, 2, pos); PyErr_SetObject(typeref::JsonDecodeError, args); - debug_assert!(ffi!(Py_REFCNT(args)) == 2); + debug_assert!(ffi!(Py_REFCNT(args)) <= 2); Py_DECREF(args); }; null_mut() @@ -222,7 +222,7 @@ fn raise_dumps_exception_fixed(msg: &str) -> *mut PyObject { let err_msg = PyUnicode_FromStringAndSize(msg.as_ptr() as *const c_char, msg.len() as isize); PyErr_SetObject(typeref::JsonEncodeError, err_msg); - debug_assert!(ffi!(Py_REFCNT(err_msg)) == 2); + debug_assert!(ffi!(Py_REFCNT(err_msg)) <= 2); Py_DECREF(err_msg); }; null_mut() @@ -239,7 +239,7 @@ fn raise_dumps_exception_dynamic(err: &String) -> *mut PyObject { let err_msg = PyUnicode_FromStringAndSize(err.as_ptr() as *const c_char, err.len() as isize); PyErr_SetObject(typeref::JsonEncodeError, err_msg); - debug_assert!(ffi!(Py_REFCNT(err_msg)) == 2); + debug_assert!(ffi!(Py_REFCNT(err_msg)) <= 2); Py_DECREF(err_msg); if !cause_exc.is_null() { diff --git a/src/str/create.rs b/src/str/create.rs index b0a188d7..bf86ae0c 100644 --- a/src/str/create.rs +++ b/src/str/create.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: (Apache-2.0 OR MIT) -use crate::str::check::is_four_byte; +use crate::str::is_four_byte; use crate::typeref::EMPTY_UNICODE; use pyo3_ffi::*;