Skip to content

Commit

Permalink
build maintenance, edition 2024 compatibility, MSRV 1.82
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Jan 7, 2025
1 parent 504a99b commit ccb4531
Show file tree
Hide file tree
Showing 66 changed files with 1,391 additions and 717 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: push
env:
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
PIP_DISABLE_PIP_VERSION_CHECK: "1"
RUST_TOOLCHAIN: "nightly-2024-11-22"
RUST_TOOLCHAIN: "nightly-2025-01-07"
UNSAFE_PYO3_BUILD_FREE_THREADED: "1"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
UV_LINK_MODE: "copy"
Expand All @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
env:
RUST_TOOLCHAIN: "1.72" # MSRV
RUST_TOOLCHAIN: "1.82" # MSRV
steps:
- name: rustup stable
run: |
Expand All @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4

- run: python3 -m pip install --user --upgrade pip "maturin==1.7.8" wheel
- run: python3 -m pip install --user --upgrade pip "maturin>=1,<2" wheel

- name: Vendor dependencies
run: |
Expand Down Expand Up @@ -287,7 +287,6 @@ jobs:
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-C lto=fat -Z mir-opt-level=4 -Z threads=2 -D warnings -C target-feature=-crt-static"
with:
maturin-version: 1.7.8
rust-toolchain: "${{ env.RUST_TOOLCHAIN }}"
rustup-components: rust-src
target: "${{ matrix.platform.target }}"
Expand Down Expand Up @@ -392,7 +391,6 @@ jobs:
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "${{ matrix.target.rustflags }}"
with:
maturin-version: 1.7.8
target: "${{ matrix.target.target }}"
rust-toolchain: "${{ env.RUST_TOOLCHAIN }}"
rustup-components: rust-src
Expand Down Expand Up @@ -450,7 +448,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python python${{ matrix.python.version }}
uv pip install --upgrade "maturin==1.7.8" -r test/requirements.txt -r integration/requirements.txt
uv pip install --upgrade "maturin>=1,<2" -r test/requirements.txt -r integration/requirements.txt
mkdir .cargo
cp ci/config.toml .cargo/config.toml
Expand Down Expand Up @@ -524,7 +522,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python python${{ matrix.python.version }}
uv pip install --upgrade "maturin==1.7.8" -r test/requirements.txt -r integration/requirements.txt
uv pip install --upgrade "maturin>=1,<2" -r test/requirements.txt -r integration/requirements.txt
mkdir .cargo
cp ci/config.toml .cargo/config.toml
Expand Down Expand Up @@ -599,7 +597,7 @@ jobs:
run: |
cargo fetch --target "${{ matrix.platform.target }}" &
python.exe -m pip install --upgrade pip "maturin==1.7.8" wheel
python.exe -m pip install --upgrade pip "maturin>=1,<2" wheel
python.exe -m pip install -r test\requirements.txt -r integration\requirements.txt
mkdir .cargo
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
fail-fast: false
matrix:
profile: [
{ rust: "1.72", features: "" },
{ rust: "1.72", features: "--features=yyjson" },
{ rust: "nightly-2024-11-22", features: "--features=avx512,yyjson,unstable-simd" },
{ rust: "1.82", features: "" },
{ rust: "1.82", features: "--features=yyjson" },
{ rust: "nightly-2025-01-07", features: "--features=avx512,yyjson,unstable-simd" },
]
python: [
{ version: '3.13' },
Expand All @@ -30,7 +30,7 @@ jobs:
with:
python-version: '${{ matrix.python.version }}'

- run: python -m pip install --user --upgrade pip "maturin==1.7.8" wheel
- run: python -m pip install --user --upgrade pip "maturin>=1,<2" wheel

- uses: actions/checkout@v4

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ permissions:

jobs:
stale:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@v9
with:
days-before-stale: 7
days-before-close: 1
exempt-assignees: ijl
80 changes: 50 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["ijl <[email protected]>"]
description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy"
edition = "2021"
resolver = "2"
rust-version = "1.72"
rust-version = "1.82"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/ijl/orjson"
homepage = "https://github.com/ijl/orjson"
Expand All @@ -14,8 +14,8 @@ keywords = ["fast", "json", "dataclass", "dataclasses", "datetime", "rfc", "8259
include = [
"Cargo.toml",
"CHANGELOG.md",
"data",
"include",
"include/pyo3",
"include/yyjson",
"LICENSE-APACHE",
"LICENSE-MIT",
"pyproject.toml",
Expand Down Expand Up @@ -71,7 +71,7 @@ uuid = { version = "1", default-features = false }
xxhash-rust = { version = "^0.8", default-features = false, features = ["xxh3"] }

[build-dependencies]
cc = { version = "1" }
cc = { version = "=1.2.4" } # aarch64-linux-musl link errors
pyo3-build-config = { path = "include/pyo3/pyo3-build-config" }
version_check = { version = "0.9" }

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ No, it supports RFC 8259.

## Packaging

To package orjson requires at least [Rust](https://www.rust-lang.org/) 1.72
To package orjson requires at least [Rust](https://www.rust-lang.org/) 1.82
and the [maturin](https://github.com/PyO3/maturin) build tool. The recommended
build command is:

Expand All @@ -1078,7 +1078,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-11-22` and stable 1.72. It
The project's own CI tests against `nightly-2025-01-07` and stable 1.72. It
is prudent to pin the nightly version because that channel can introduce
breaking changes. There is a significant performance benefit to using
nightly.
Expand All @@ -1101,5 +1101,5 @@ tests should be run as part of the build. It can be run with

## License

orjson was written by ijl <<[email protected]>>, copyright 2018 - 2024, available
orjson was written by ijl <<[email protected]>>, copyright 2018 - 2025, available
to you under either the Apache 2 license or MIT license at your choice.
6 changes: 4 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn main() {
}

#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
if let Some(64) = python_config.pointer_width {
if matches!(python_config.pointer_width, Some(64)) {
println!("cargo:rustc-cfg=feature=\"inline_int\"");
}

Expand All @@ -75,7 +75,9 @@ fn main() {
}
Err(_) => {
if env::var("CARGO_FEATURE_YYJSON").is_ok() {
panic!("yyjson was enabled but the build failed. To build with a different backend do not specify the feature.")
panic!(
"yyjson was enabled but the build failed. To build with a different backend do not specify the feature."
)
}
}
}
Expand Down
Loading

0 comments on commit ccb4531

Please sign in to comment.