diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index a0202fec..5d55526b 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -68,8 +68,8 @@ jobs: options: --user 0 steps: - run: yum install -y clang lld - - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2023-05-31 --profile minimal -y - - run: rustup component add rust-src --toolchain nightly-2023-05-31-x86_64-unknown-linux-gnu + - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2023-06-30 --profile minimal -y + - run: rustup component add rust-src --toolchain nightly-2023-06-30-x86_64-unknown-linux-gnu - uses: actions/checkout@v3 - name: build-std @@ -139,7 +139,7 @@ jobs: RUSTFLAGS: "-C target-feature=-crt-static" CARGO_UNSTABLE_SPARSE_REGISTRY: "true" with: - rust-toolchain: nightly-2023-05-31 + rust-toolchain: nightly-2023-06-30 rustup-components: rust-src target: ${{ matrix.platform.target }} manylinux: musllinux_1_1 @@ -196,7 +196,7 @@ jobs: { arch: 'armv7', target: 'armv7-unknown-linux-gnueabihf', - cflags: '-Os', + cflags: '-Os -fstrict-aliasing', }, { arch: 'ppc64le', @@ -228,7 +228,7 @@ jobs: CARGO_FEATURE_YYJSON: "1" with: target: ${{ matrix.target.target }} - rust-toolchain: nightly-2023-05-31 + rust-toolchain: nightly-2023-06-30 rustup-components: rust-src manylinux: auto args: --release --strip --out=dist -i python${{ matrix.python.version }} diff --git a/.github/workflows/next.yaml b/.github/workflows/next.yaml index e34b39a5..a5018939 100644 --- a/.github/workflows/next.yaml +++ b/.github/workflows/next.yaml @@ -21,7 +21,7 @@ jobs: image: registry.hub.docker.com/library/python:3.12-rc-bullseye options: --user 0 steps: - - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2023-05-31 --profile minimal -y + - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2023-06-30 --profile minimal -y - run: python3 -m pip install --user --upgrade pip "maturin>=1,<2" wheel - uses: actions/checkout@v3 diff --git a/Cargo.lock b/Cargo.lock index 447e416b..878cbb9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,9 +21,9 @@ checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" dependencies = [ "serde", ] @@ -91,9 +91,9 @@ dependencies = [ [[package]] name = "compact_str" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff0805f79ecb1b35163f3957a6934ea8d04fcd36ef98b52e7316f63e72e73d1" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" dependencies = [ "castaway", "cfg-if", @@ -115,9 +115,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] name = "itoap" @@ -127,9 +127,9 @@ checksum = "9028f49264629065d057f340a86acb84867925865f73bbf8d47b4d149a7e88b8" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libm" @@ -148,9 +148,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.2" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "orjson" @@ -190,9 +190,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713eccf888fb05f1a96eb78c0dbc51907fee42b3377272dc902eb38985f418d5" +checksum = "554db24f0b3c180a9c0b1268f91287ab3f17c162e15b54caaae5a6b3773396b0" dependencies = [ "once_cell", "target-lexicon", @@ -200,9 +200,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b2ecbdcfb01cbbf56e179ce969a048fd7305a66d4cdf3303e0da09d69afe4c3" +checksum = "922ede8759e8600ad4da3195ae41259654b9c55da4f7eec84a0ccc7d067a70a4" dependencies = [ "libc", "pyo3-build-config", @@ -210,27 +210,27 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "7daf513456463b42aa1d94cff7e0c24d682b429f020b9afa4f5ba5c40a22b237" [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" dependencies = [ "itoa", "ryu", @@ -245,9 +245,9 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "static_assertions" @@ -257,9 +257,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "target-lexicon" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" +checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" [[package]] name = "version_check" diff --git a/Cargo.toml b/Cargo.toml index d9e790cd..c9d297f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ encoding_rs = { version = "0.8", default_features = false } itoa = { version = "1", default_features = false } itoap = { version = "1", features = ["std", "simd"] } once_cell = { version = "1", default_features = false, features = ["race"] } -pyo3-ffi = { version = "0.19", default_features = false, features = ["extension-module"]} +pyo3-ffi = { version = "^0.19.1", default_features = false, features = ["extension-module"]} ryu = { version = "1", default_features = false } serde = { version = "1", default_features = false } serde_json = { version = "1", default_features = false, features = ["std", "float_roundtrip"] } @@ -63,7 +63,7 @@ smallvec = { version = "^1.10", default_features = false, features = ["union", " [build-dependencies] cc = { version = "1" } -pyo3-build-config = { version = "0.19" } +pyo3-build-config = { version = "^0.19.1" } version_check = { version = "0.9" } [profile.release] diff --git a/README.md b/README.md index 1433e3e5..cb28c4be 100644 --- a/README.md +++ b/README.md @@ -576,7 +576,7 @@ b'"1970-01-01T00:00:00Z"' #### Fragment `orjson.Fragment` includes already-serialized JSON in a document. This is an -efficient way include JSON blobs from a cache, JSONB field, or separately +efficient way to include JSON blobs from a cache, JSONB field, or separately serialized object without first deserializing to Python objects via `loads()`. ```python @@ -1195,7 +1195,7 @@ It benefits from also having a C build environment to compile a faster deserialization backend. See this project's `manylinux_2_28` builds for an example using clang and LTO. -The project's own CI tests against `nightly-2023-05-31` and stable 1.60. It +The project's own CI tests against `nightly-2023-06-30` and stable 1.60. It is prudent to pin the nightly version because that channel can introduce breaking changes. diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 104bce71..942b4453 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -1,5 +1,5 @@ variables: - toolchain: nightly-2023-05-31 + toolchain: nightly-2023-06-30 jobs: diff --git a/script/develop b/script/develop index 787af480..84447b95 100755 --- a/script/develop +++ b/script/develop @@ -4,7 +4,7 @@ rm -f target/wheels/* export CC="clang" export CFLAGS="-O2 -fno-plt -flto=thin" -export LDFLAGS="-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed" +export LDFLAGS="${CFLAGS} -fuse-ld=lld -Wl,--as-needed" export RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=lld" maturin build -i python3 --release "$@" diff --git a/src/ffi/fragment.rs b/src/ffi/fragment.rs index 09b0ab1f..cbbe5000 100644 --- a/src/ffi/fragment.rs +++ b/src/ffi/fragment.rs @@ -129,6 +129,8 @@ pub unsafe extern "C" fn orjson_fragmenttype_new() -> *mut PyTypeObject { tp_descr_set: None, tp_dictoffset: 0, tp_alloc: None, + #[cfg(Py_3_12)] + tp_watched: 0, }); let ob_ptr = Box::into_raw(ob); PyType_Ready(ob_ptr); diff --git a/test/test_numpy.py b/test/test_numpy.py index fd2c1382..e1b60c5c 100644 --- a/test/test_numpy.py +++ b/test/test_numpy.py @@ -375,7 +375,7 @@ def test_numpy_array_non_contiguous_message(self): ) def test_numpy_array_unsupported_dtype(self): - array = numpy.array([[1, 2], [3, 4]], numpy.float16) + array = numpy.array([[1, 2], [3, 4]], numpy.float16) # type: ignore with pytest.raises(orjson.JSONEncodeError) as cm: orjson.dumps(array, option=orjson.OPT_SERIALIZE_NUMPY) assert "unsupported datatype in numpy array" in str(cm) @@ -708,7 +708,7 @@ def test_numpy_datetime_nat(self): orjson.dumps([numpy.datetime64("NaT")], option=orjson.OPT_SERIALIZE_NUMPY) def test_numpy_repeated(self): - data = numpy.array([[[1, 2], [3, 4], [5, 6], [7, 8]]], numpy.int64) + data = numpy.array([[[1, 2], [3, 4], [5, 6], [7, 8]]], numpy.int64) # type: ignore for _ in range(0, 3): assert ( orjson.dumps(