Skip to content

Commit

Permalink
cargo update, misc
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Aug 5, 2024
1 parent 4c05bfa commit ecf11a0
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 83 deletions.
48 changes: 25 additions & 23 deletions .github/workflows/artifact.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: artifact
on: push
env:
RUST_TOOLCHAIN: "nightly-2024-07-02"
RUST_TOOLCHAIN: "nightly-2024-08-05"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
UNSAFE_PYO3_BUILD_FREE_THREADED: "1"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
jobs:

Expand Down Expand Up @@ -57,16 +58,17 @@ jobs:
retention-days: 1

manylinux_2_17_amd64:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.12' },
{ version: '3.11' },
{ version: '3.10' },
{ version: '3.9' },
{ version: '3.8' },
{ interpreter: 'python3.13', package: 'python3.13' },
{ interpreter: 'python3.12', package: 'python3.12' },
{ 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:
CC: "clang"
Expand All @@ -83,7 +85,8 @@ jobs:

- name: Build environment pre-clone
run: |
dnf install -y rustup clang lld python${{ matrix.python.version }} git
dnf copr enable -y @fedora-llvm-team/llvm19
dnf install -y rustup clang lld ${{ matrix.python.package }} git
rustup-init --default-toolchain "${RUST_TOOLCHAIN}-x86_64-unknown-linux-gnu" --profile minimal --component rust-src -y
- uses: actions/checkout@v4
Expand All @@ -96,7 +99,7 @@ jobs:
cp ci/config.toml .cargo/config.toml
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python python${{ matrix.python.version }}
uv venv --python ${{ matrix.python.interpreter }}
uv pip install --upgrade "maturin>=1,<2" -r test/requirements.txt -r integration/requirements.txt
- name: maturin
Expand All @@ -105,7 +108,7 @@ jobs:
maturin build --release --strip \
--features=avx512,no-panic,unstable-simd,yyjson \
--compatibility manylinux_2_17 \
--interpreter python${{ matrix.python.version }} \
--interpreter ${{ matrix.python.interpreter }} \
--target=x86_64-unknown-linux-gnu
uv pip install target/wheels/orjson*.whl
Expand All @@ -117,12 +120,6 @@ jobs:
- run: source .venv/bin/activate && ./integration/run http
- run: source .venv/bin/activate && ./integration/run init

- run: |
source .venv/bin/activate
uv pip install -U --pre "numpy>=2.0.0rc1"
pytest -s test/test_numpy.py
if: matrix.python.version != '3.8'
- name: Store wheels
if: "startsWith(github.ref, 'refs/tags/')"
uses: actions/upload-artifact@v4
Expand All @@ -133,11 +130,12 @@ jobs:
retention-days: 1

musllinux_1_2:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.13' },
{ version: '3.12' },
{ version: '3.11' },
{ version: '3.10' },
Expand Down Expand Up @@ -169,7 +167,7 @@ jobs:
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-C lto=fat -Z mir-opt-level=4 -Z virtual-function-elimination -Z threads=2 -D warnings -C target-feature=-crt-static"
with:
rust-toolchain: nightly-2024-07-02
rust-toolchain: nightly-2024-08-05
rustup-components: rust-src
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_2
Expand Down Expand Up @@ -208,11 +206,12 @@ jobs:
retention-days: 1

manylinux_2_17_non_amd64:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.13', abi: 'cp313-cp313g' },
{ version: '3.12', abi: 'cp312-cp312' },
{ version: '3.11', abi: 'cp311-cp311' },
{ version: '3.10', abi: 'cp310-cp310' },
Expand Down Expand Up @@ -265,10 +264,11 @@ jobs:
RUSTFLAGS: "${{ matrix.target.rustflags }}"
with:
target: ${{ matrix.target.target }}
rust-toolchain: nightly-2024-07-02
rust-toolchain: nightly-2024-08-05
rustup-components: rust-src
manylinux: auto
args: --release --strip --out=dist --features=${{ matrix.target.features }} -i python${{ matrix.python.version }}
before-script-linux: apt-get update && apt-get install -y python${{ matrix.python.version }}-dev python${{ matrix.python.version }}-venv # 3.13

- uses: uraimo/run-on-arch-action@v2
name: Test
Expand Down Expand Up @@ -306,6 +306,7 @@ jobs:
fail-fast: false
matrix:
python: [
{ version: '3.13', macosx_target: "10.15" },
{ version: '3.12', macosx_target: "10.15" },
{ version: '3.11', macosx_target: "10.15" },
{ version: '3.10', macosx_target: "10.15" },
Expand All @@ -325,10 +326,11 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python.version }}"
allow-preleases: true

- uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2024-07-02"
toolchain: "nightly-2024-08-05"
targets: "aarch64-apple-darwin, x86_64-apple-darwin"
components: "rust-src"

Expand Down Expand Up @@ -398,7 +400,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2024-07-02"
toolchain: "nightly-2024-08-05"
targets: "aarch64-apple-darwin, x86_64-apple-darwin"
components: "rust-src"

Expand Down Expand Up @@ -443,7 +445,7 @@ jobs:

pypi:
name: PyPI
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: "startsWith(github.ref, 'refs/tags/')"
needs: [
sdist,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
profile: [
{ rust: "1.72", features: "" },
{ rust: "1.72", features: "--features=yyjson" },
{ rust: "nightly-2024-07-02", features: "--features=yyjson,unstable-simd"},
{ rust: "nightly-2024-07-02", features: "--features=avx512,yyjson,unstable-simd"},
{ rust: "nightly-2024-08-05", features: "--features=yyjson,unstable-simd"},
{ rust: "nightly-2024-08-05", features: "--features=avx512,yyjson,unstable-simd"},
]
python: [
{ version: '3.13' },
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: lint
on: push
jobs:
lint:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/setup-python@v5
with:
Expand Down
56 changes: 32 additions & 24 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ associative-cache = { version = "2", default-features = false }
beef = { version = "0.5", default-features = false, features = ["impl_serde"] }
bytecount = { version = "^0.6.7", default-features = false, features = ["runtime-dispatch-simd"] }
chrono = { version = "=0.4.34", default-features = false }
compact_str = { version = "0.7", default-features = false, features = ["serde"] }
compact_str = { version = "0.8", default-features = false, features = ["serde"] }
encoding_rs = { version = "0.8", default-features = false }
half = { version = "2", default-features = false, features = ["std"] }
itoa = { version = "1", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,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-07-02` and stable 1.72. It
The project's own CI tests against `nightly-2024-08-05` and stable 1.72. It
is prudent to pin the nightly version because that channel can introduce
breaking changes.

Expand Down
2 changes: 1 addition & 1 deletion ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variables:
toolchain: nightly-2024-07-02
toolchain: nightly-2024-08-05

jobs:

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-r test/requirements.txt
maturin
mypy==1.10.0
ruff==0.4.8
ruff==0.5.5
types-python-dateutil
types-pytz
types-simplejson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use smallvec::SmallVec;
use std::borrow::Cow;
use std::fmt;

pub fn deserialize_json(
pub(crate) fn deserialize(
data: &'static str,
) -> Result<NonNull<pyo3_ffi::PyObject>, DeserializeError<'static>> {
let mut deserializer = serde_json::Deserializer::from_str(data);
Expand Down
13 changes: 13 additions & 0 deletions src/deserialize/backend/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: (Apache-2.0 OR MIT)

#[cfg(not(feature = "yyjson"))]
mod json;

#[cfg(feature = "yyjson")]
mod yyjson;

#[cfg(feature = "yyjson")]
pub(crate) use yyjson::deserialize;

#[cfg(not(feature = "yyjson"))]
pub(crate) use json::deserialize;
Loading

0 comments on commit ecf11a0

Please sign in to comment.