From c825472198c20f40064af63d7ef7b21eb2e3aaef Mon Sep 17 00:00:00 2001 From: ijl Date: Wed, 14 Feb 2024 00:50:02 +0000 Subject: [PATCH] cargo update --- .github/workflows/debug.yaml | 6 +++--- .github/workflows/linux.yaml | 16 ++++++++-------- Cargo.lock | 12 ++++++------ Cargo.toml | 4 ++-- README.md | 4 ++-- ci/azure-macos.yml | 2 +- ci/azure-pipelines.yml | 2 +- ci/azure-win.yml | 4 +++- src/serialize/per_type/datetime.rs | 4 ---- src/serialize/per_type/datetimelike.rs | 2 -- src/serialize/per_type/numpy.rs | 4 ---- 11 files changed, 26 insertions(+), 34 deletions(-) diff --git a/.github/workflows/debug.yaml b/.github/workflows/debug.yaml index 84437d9d..30deba90 100644 --- a/.github/workflows/debug.yaml +++ b/.github/workflows/debug.yaml @@ -8,9 +8,9 @@ jobs: fail-fast: false matrix: profile: [ - { rust: "1.65", features: "" }, - { rust: "1.65", features: "--features=yyjson" }, - { rust: "nightly-2024-02-03", features: "--features=yyjson,unstable-simd" }, + { rust: "1.72", features: "" }, + { rust: "1.72", features: "--features=yyjson" }, + { rust: "nightly-2024-02-13", features: "--features=yyjson,unstable-simd" }, ] python: [ { version: '3.13' }, diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 11993300..b7ee3df9 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false env: - RUST_TOOLCHAIN: "1.65" # MSRV + RUST_TOOLCHAIN: "1.72" # MSRV steps: - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUST_TOOLCHAIN -y - run: rustup default $RUST_TOOLCHAIN @@ -71,8 +71,8 @@ jobs: options: --user 0 steps: - run: yum install -y clang lld - - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2024-02-03 --profile minimal -y - - run: rustup component add rust-src --toolchain nightly-2024-02-03-x86_64-unknown-linux-gnu + - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2024-02-13 --profile minimal -y + - run: rustup component add rust-src --toolchain nightly-2024-02-13-x86_64-unknown-linux-gnu - uses: actions/checkout@v4 - name: build-std @@ -84,7 +84,7 @@ jobs: - run: | maturin build --release --strip \ --out=dist \ - --features=encoding_rs/simd-accel,no-panic,unstable-simd,yyjson \ + --features=no-panic,unstable-simd,yyjson \ --compatibility manylinux_2_17 \ --interpreter python${{ matrix.python.version }} \ --target=x86_64-unknown-linux-gnu @@ -143,11 +143,11 @@ jobs: RUSTFLAGS: "-C target-feature=-crt-static -Z mir-opt-level=4" CARGO_UNSTABLE_SPARSE_REGISTRY: "true" with: - rust-toolchain: nightly-2024-02-03 + rust-toolchain: nightly-2024-02-13 rustup-components: rust-src target: ${{ matrix.platform.target }} manylinux: musllinux_1_2 - args: --release --strip --out=dist --features=encoding_rs/simd-accel,no-panic,unstable-simd,yyjson -i python${{ matrix.python.version }} + args: --release --strip --out=dist --features=no-panic,unstable-simd,yyjson -i python${{ matrix.python.version }} - name: Set up QEMU if: matrix.platform.arch != 'x86_64' @@ -196,7 +196,7 @@ jobs: { arch: 'aarch64', cflags: '-O2 -flto', - features: 'encoding_rs/simd-accel,no-panic,unstable-simd,yyjson', + features: 'no-panic,unstable-simd,yyjson', rustflags: '-Z mir-opt-level=4 -D warnings', target: 'aarch64-unknown-linux-gnu', }, @@ -239,7 +239,7 @@ jobs: RUSTFLAGS: "${{ matrix.target.rustflags }}" with: target: ${{ matrix.target.target }} - rust-toolchain: nightly-2024-02-03 + rust-toolchain: nightly-2024-02-13 rustup-components: rust-src manylinux: auto args: --release --strip --out=dist --features=${{ matrix.target.features }} -i python${{ matrix.python.version }} diff --git a/Cargo.lock b/Cargo.lock index 2f213d31..6785db8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ "cfg-if", "const-random", @@ -77,9 +77,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "num-traits", ] @@ -178,9 +178,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] diff --git a/Cargo.toml b/Cargo.toml index de3a43a7..526ec5fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["ijl "] description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" edition = "2021" resolver = "2" -rust-version = "1.65" +rust-version = "1.72" license = "Apache-2.0 OR MIT" repository = "https://github.com/ijl/orjson" homepage = "https://github.com/ijl/orjson" @@ -45,7 +45,7 @@ no-panic = [ yyjson = [] [dependencies] -ahash = { version = "=0.8.6", default_features = false, features = ["compile-time-rng"] } +ahash = { version = "^0.8.8", default_features = false, features = ["compile-time-rng"] } 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"] } diff --git a/README.md b/README.md index 1136540c..c35b8f50 100644 --- a/README.md +++ b/README.md @@ -1184,7 +1184,7 @@ No. `bytes` is the correct type for a serialized blob. ## Packaging -To package orjson requires at least [Rust](https://www.rust-lang.org/) 1.65 +To package orjson requires at least [Rust](https://www.rust-lang.org/) 1.72 and the [maturin](https://github.com/PyO3/maturin) build tool. The recommended build command is: @@ -1196,7 +1196,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-2024-02-03` and stable 1.65. It +The project's own CI tests against `nightly-2024-02-13` and stable 1.65. It is prudent to pin the nightly version because that channel can introduce breaking changes. diff --git a/ci/azure-macos.yml b/ci/azure-macos.yml index f490383f..2e1b65d2 100644 --- a/ci/azure-macos.yml +++ b/ci/azure-macos.yml @@ -23,7 +23,7 @@ steps: PATH=$HOME/.cargo/bin:$PATH \ MACOSX_DEPLOYMENT_TARGET=$(macosx_deployment_target) \ PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") \ - maturin build --release --strip --features=encoding_rs/simd-accel,no-panic,unstable-simd,yyjson --interpreter $(interpreter) --target=universal2-apple-darwin + maturin build --release --strip --features=no-panic,unstable-simd,yyjson --interpreter $(interpreter) --target=universal2-apple-darwin env: CC: "clang" CFLAGS: "-O2 -fstrict-aliasing -flto=full" diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index dd628412..352d7569 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -1,5 +1,5 @@ variables: - toolchain: nightly-2024-02-03 + toolchain: nightly-2024-02-13 jobs: diff --git a/ci/azure-win.yml b/ci/azure-win.yml index 15af67e1..19204451 100644 --- a/ci/azure-win.yml +++ b/ci/azure-win.yml @@ -19,8 +19,10 @@ steps: displayName: build dependencies - script: python.exe -m pip install -r test\requirements.txt -r integration\requirements.txt displayName: test dependencies -- script: maturin.exe build --release --features=encoding_rs/simd-accel,no-panic,yyjson --strip --interpreter $(interpreter) --target $(target) +- script: maturin.exe build --release --features=no-panic,unstable-simd,yyjson --strip --interpreter $(interpreter) --target $(target) displayName: build + env: + RUSTFLAGS: "-Z mir-opt-level=4" - script: python.exe -m pip install orjson --no-index --find-links=D:\a\1\s\target\wheels displayName: install - script: python.exe -m pytest -s -rxX -v test diff --git a/src/serialize/per_type/datetime.rs b/src/serialize/per_type/datetime.rs index 2434697b..859c92d5 100644 --- a/src/serialize/per_type/datetime.rs +++ b/src/serialize/per_type/datetime.rs @@ -161,10 +161,6 @@ impl DateTimeLike for DateTime { pydatetime_get!(second, PyDateTime_DATE_GET_SECOND, u8); pydatetime_get!(microsecond, PyDateTime_DATE_GET_MICROSECOND, u32); - fn millisecond(&self) -> u32 { - self.microsecond() / 1_000 - } - fn nanosecond(&self) -> u32 { self.microsecond() * 1_000 } diff --git a/src/serialize/per_type/datetimelike.rs b/src/serialize/per_type/datetimelike.rs index 5affde8e..97a3d270 100644 --- a/src/serialize/per_type/datetimelike.rs +++ b/src/serialize/per_type/datetimelike.rs @@ -76,8 +76,6 @@ pub trait DateTimeLike { fn minute(&self) -> u8; /// Returns the second component of the datetime. fn second(&self) -> u8; - /// Returns the number of milliseconds since the whole non-leap second. - fn millisecond(&self) -> u32; /// Returns the number of microseconds since the whole non-leap second. fn microsecond(&self) -> u32; /// Returns the number of nanoseconds since the whole non-leap second. diff --git a/src/serialize/per_type/numpy.rs b/src/serialize/per_type/numpy.rs index cdc74217..ee6bb599 100644 --- a/src/serialize/per_type/numpy.rs +++ b/src/serialize/per_type/numpy.rs @@ -1279,10 +1279,6 @@ impl DateTimeLike for NumpyDatetime64Repr { forward_inner!(second, u8); forward_inner!(nanosecond, u32); - fn millisecond(&self) -> u32 { - self.nanosecond() / 1_000_000 - } - fn microsecond(&self) -> u32 { self.nanosecond() / 1_000 }