Skip to content

Commit

Permalink
cargo update, build misc
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Jul 2, 2024
1 parent 7b081e1 commit 95c86e5
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 78 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/artifact.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: artifact
on: push
env:
RUST_TOOLCHAIN: "nightly-2024-06-10"
RUST_TOOLCHAIN: "nightly-2024-07-02"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
jobs:
Expand Down Expand Up @@ -101,22 +101,24 @@ jobs:
- name: maturin
run: |
source .venv/bin/activate
maturin build --release --strip \
--features=avx512,no-panic,unstable-simd,yyjson \
--compatibility manylinux_2_17 \
--interpreter python${{ matrix.python.version }} \
--target=x86_64-unknown-linux-gnu
uv pip install target/wheels/orjson*.whl
- run: pytest -s -rxX -v -n 2 test
- run: source .venv/bin/activate && pytest -s -rxX -v -n 2 test
env:
PYTHONMALLOC: "debug"

- run: ./integration/run thread
- run: ./integration/run http
- run: ./integration/run init
- run: source .venv/bin/activate && ./integration/run thread
- 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'
Expand Down Expand Up @@ -167,7 +169,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-06-10
rust-toolchain: nightly-2024-07-02
rustup-components: rust-src
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_2
Expand Down Expand Up @@ -225,6 +227,13 @@ jobs:
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings',
target: 'aarch64-unknown-linux-gnu',
},
{
arch: 'armv7',
cflags: '-Os -flto=full -fstrict-aliasing',
features: 'no-panic,yyjson', # no SIMD
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings -C opt-level=s',
target: 'armv7-unknown-linux-gnueabihf',
},
{
arch: 'ppc64le',
cflags: '-Os -flto=full -fstrict-aliasing',
Expand Down Expand Up @@ -256,7 +265,7 @@ jobs:
RUSTFLAGS: "${{ matrix.target.rustflags }}"
with:
target: ${{ matrix.target.target }}
rust-toolchain: nightly-2024-06-10
rust-toolchain: nightly-2024-07-02
rustup-components: rust-src
manylinux: auto
args: --release --strip --out=dist --features=${{ matrix.target.features }} -i python${{ matrix.python.version }}
Expand Down Expand Up @@ -319,7 +328,7 @@ jobs:

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

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

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

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-06-10", features: "--features=yyjson,unstable-simd"},
{ rust: "nightly-2024-06-10", features: "--features=avx512,yyjson,unstable-simd"},
{ rust: "nightly-2024-07-02", features: "--features=yyjson,unstable-simd"},
{ rust: "nightly-2024-07-02", features: "--features=avx512,yyjson,unstable-simd"},
]
python: [
{ version: '3.13' },
Expand Down
32 changes: 16 additions & 16 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ encoding_rs = { version = "0.8", default-features = false }
half = { version = "2", default-features = false, features = ["std"] }
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.21", default-features = false, features = ["extension-module"]}
once_cell = { version = "1", default-features = false, features = ["alloc", "race"] }
pyo3-ffi = { version = "^0.22", 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"] }
Expand All @@ -78,7 +78,7 @@ unwinding = { version = "0.2", features = ["unwinder"], optional = true }

[build-dependencies]
cc = { version = "1" }
pyo3-build-config = { version = "^0.21" }
pyo3-build-config = { version = "^0.22" }
version_check = { version = "0.9" }

[profile.dev]
Expand Down
80 changes: 40 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# orjson

orjson is a fast, correct JSON library for Python. It
[benchmarks](https://github.com/ijl/orjson#performance) as the fastest Python
[benchmarks](https://github.com/ijl/orjson?tab=readme-ov-file#performance) as the fastest Python
library for JSON and is more correct than the standard json library or other
third-party libraries. It serializes
[dataclass](https://github.com/ijl/orjson#dataclass),
[datetime](https://github.com/ijl/orjson#datetime),
[numpy](https://github.com/ijl/orjson#numpy), and
[UUID](https://github.com/ijl/orjson#uuid) instances natively.
[dataclass](https://github.com/ijl/orjson?tab=readme-ov-file#dataclass),
[datetime](https://github.com/ijl/orjson?tab=readme-ov-file#datetime),
[numpy](https://github.com/ijl/orjson?tab=readme-ov-file#numpy), and
[UUID](https://github.com/ijl/orjson?tab=readme-ov-file#uuid) instances natively.

Its features and drawbacks compared to other Python JSON libraries:

Expand All @@ -33,7 +33,7 @@ support for 64-bit
file-like objects

orjson supports CPython 3.8, 3.9, 3.10, 3.11, and 3.12. It distributes
amd64/x86_64, aarch64/armv8, POWER/ppc64le, and s390x wheels for Linux,
amd64/x86_64, aarch64/armv8, arm7, POWER/ppc64le, and s390x wheels for Linux,
amd64 and aarch64 wheels for macOS, and amd64 and i686/x86 wheels for Windows.
orjson does not and will not support PyPy. orjson does not and will not
support PEP 554 subinterpreters. Releases follow semantic versioning and
Expand All @@ -47,32 +47,32 @@ submitted there. There is a
[CHANGELOG](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
available in the repository.

1. [Usage](https://github.com/ijl/orjson#usage)
1. [Install](https://github.com/ijl/orjson#install)
2. [Quickstart](https://github.com/ijl/orjson#quickstart)
3. [Migrating](https://github.com/ijl/orjson#migrating)
4. [Serialize](https://github.com/ijl/orjson#serialize)
1. [default](https://github.com/ijl/orjson#default)
2. [option](https://github.com/ijl/orjson#option)
3. [Fragment](https://github.com/ijl/orjson#fragment)
5. [Deserialize](https://github.com/ijl/orjson#deserialize)
2. [Types](https://github.com/ijl/orjson#types)
1. [dataclass](https://github.com/ijl/orjson#dataclass)
2. [datetime](https://github.com/ijl/orjson#datetime)
3. [enum](https://github.com/ijl/orjson#enum)
4. [float](https://github.com/ijl/orjson#float)
5. [int](https://github.com/ijl/orjson#int)
6. [numpy](https://github.com/ijl/orjson#numpy)
7. [str](https://github.com/ijl/orjson#str)
8. [uuid](https://github.com/ijl/orjson#uuid)
3. [Testing](https://github.com/ijl/orjson#testing)
4. [Performance](https://github.com/ijl/orjson#performance)
1. [Latency](https://github.com/ijl/orjson#latency)
2. [Memory](https://github.com/ijl/orjson#memory)
3. [Reproducing](https://github.com/ijl/orjson#reproducing)
5. [Questions](https://github.com/ijl/orjson#questions)
6. [Packaging](https://github.com/ijl/orjson#packaging)
7. [License](https://github.com/ijl/orjson#license)
1. [Usage](https://github.com/ijl/orjson?tab=readme-ov-file#usage)
1. [Install](https://github.com/ijl/orjson?tab=readme-ov-file#install)
2. [Quickstart](https://github.com/ijl/orjson?tab=readme-ov-file#quickstart)
3. [Migrating](https://github.com/ijl/orjson?tab=readme-ov-file#migrating)
4. [Serialize](https://github.com/ijl/orjson?tab=readme-ov-file#serialize)
1. [default](https://github.com/ijl/orjson?tab=readme-ov-file#default)
2. [option](https://github.com/ijl/orjson?tab=readme-ov-file#option)
3. [Fragment](https://github.com/ijl/orjson?tab=readme-ov-file#fragment)
5. [Deserialize](https://github.com/ijl/orjson?tab=readme-ov-file#deserialize)
2. [Types](https://github.com/ijl/orjson?tab=readme-ov-file#types)
1. [dataclass](https://github.com/ijl/orjson?tab=readme-ov-file#dataclass)
2. [datetime](https://github.com/ijl/orjson?tab=readme-ov-file#datetime)
3. [enum](https://github.com/ijl/orjson?tab=readme-ov-file#enum)
4. [float](https://github.com/ijl/orjson?tab=readme-ov-file#float)
5. [int](https://github.com/ijl/orjson?tab=readme-ov-file#int)
6. [numpy](https://github.com/ijl/orjson?tab=readme-ov-file#numpy)
7. [str](https://github.com/ijl/orjson?tab=readme-ov-file#str)
8. [uuid](https://github.com/ijl/orjson?tab=readme-ov-file#uuid)
3. [Testing](https://github.com/ijl/orjson?tab=readme-ov-file#testing)
4. [Performance](https://github.com/ijl/orjson?tab=readme-ov-file#performance)
1. [Latency](https://github.com/ijl/orjson?tab=readme-ov-file#latency)
2. [Memory](https://github.com/ijl/orjson?tab=readme-ov-file#memory)
3. [Reproducing](https://github.com/ijl/orjson?tab=readme-ov-file#reproducing)
5. [Questions](https://github.com/ijl/orjson?tab=readme-ov-file#questions)
6. [Packaging](https://github.com/ijl/orjson?tab=readme-ov-file#packaging)
7. [License](https://github.com/ijl/orjson?tab=readme-ov-file#license)

## Usage

Expand All @@ -85,7 +85,7 @@ pip install --upgrade "pip>=20.3" # manylinux_x_y, universal2 wheel support
pip install --upgrade orjson
```

To build a wheel, see [packaging](https://github.com/ijl/orjson#packaging).
To build a wheel, see [packaging](https://github.com/ijl/orjson?tab=readme-ov-file#packaging).

### Quickstart

Expand Down Expand Up @@ -155,7 +155,7 @@ The global interpreter lock (GIL) is held for the duration of the call.
It raises `JSONEncodeError` on an unsupported type. This exception message
describes the invalid object with the error message
`Type is not JSON serializable: ...`. To fix this, specify
[default](https://github.com/ijl/orjson#default).
[default](https://github.com/ijl/orjson?tab=readme-ov-file#default).

It raises `JSONEncodeError` on a `str` that contains invalid UTF-8.

Expand Down Expand Up @@ -496,18 +496,18 @@ OPT_NON_STR_KEYS.

This is deprecated and has no effect in version 3. In version 2 this was
required to serialize `dataclasses.dataclass` instances. For more, see
[dataclass](https://github.com/ijl/orjson#dataclass).
[dataclass](https://github.com/ijl/orjson?tab=readme-ov-file#dataclass).

##### OPT_SERIALIZE_NUMPY

Serialize `numpy.ndarray` instances. For more, see
[numpy](https://github.com/ijl/orjson#numpy).
[numpy](https://github.com/ijl/orjson?tab=readme-ov-file#numpy).

##### OPT_SERIALIZE_UUID

This is deprecated and has no effect in version 3. In version 2 this was
required to serialize `uuid.UUID` instances. For more, see
[UUID](https://github.com/ijl/orjson#UUID).
[UUID](https://github.com/ijl/orjson?tab=readme-ov-file#UUID).

##### OPT_SORT_KEYS

Expand Down Expand Up @@ -554,7 +554,7 @@ simplejson, and ujson.
##### OPT_STRICT_INTEGER

Enforce 53-bit limit on integers. The limit is otherwise 64 bits, the same as
the Python standard library. For more, see [int](https://github.com/ijl/orjson#int).
the Python standard library. For more, see [int](https://github.com/ijl/orjson?tab=readme-ov-file#int).

##### OPT_UTC_Z

Expand Down Expand Up @@ -1205,11 +1205,11 @@ 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-06-10` and stable 1.72. It
The project's own CI tests against `nightly-2024-07-02` and stable 1.72. It
is prudent to pin the nightly version because that channel can introduce
breaking changes.

orjson is tested for amd64, aarch64, ppc64le, and s390x on Linux. It
orjson is tested for amd64, aarch64, arm7, ppc64le, and s390x on Linux. It
is tested for either aarch64 or amd64 on macOS and cross-compiles for the other,
depending on version. For Windows it is tested on amd64 and i686.

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-06-10
toolchain: nightly-2024-07-02

jobs:

Expand Down
Loading

0 comments on commit 95c86e5

Please sign in to comment.