Skip to content

Commit 18f0186

Browse files
committed
Compatibility and build misc
1 parent a4fdeb3 commit 18f0186

29 files changed

+217
-227
lines changed

.github/workflows/artifact.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ jobs:
273273
if: "matrix.target.arch == 's390x'"
274274
uses: sandervocke/setup-qemu-container@v1
275275
with:
276-
container: registry.fedoraproject.org/fedora:42
276+
container: registry.fedoraproject.org/fedora:43
277277
arch: ${{ matrix.target.arch }}
278278
podman_args: "-v .:/orjson -v /tmp:/tmp --workdir /orjson"
279279

.github/workflows/lint.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ jobs:
1010
- uses: actions/setup-python@v6
1111
with:
1212
python-version: "3.14"
13-
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=default -y
14-
- run: pip install -U "ruff>=0.14,<0.15" "mypy==1.18.2"
1513

1614
- uses: actions/checkout@v5
1715

16+
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=default -y
17+
- run: pip install -r requirements-lint.txt
18+
1819
- run: cargo fmt
1920
- run: ./script/lint
2021

Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bench/run_default

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
import sys
55
import os
66

7-
os.sched_setaffinity(os.getpid(), {0, 1})
7+
if hasattr(os, "sched_setaffinity"):
8+
os.sched_setaffinity(os.getpid(), {0, 1})
89

910
from orjson import dumps, OPT_SERIALIZE_NUMPY
1011

bench/run_func

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import lzma
66
import os
77
import gc
88

9-
os.sched_setaffinity(os.getpid(), {0, 1})
9+
if hasattr(os, "sched_setaffinity"):
10+
os.sched_setaffinity(os.getpid(), {0, 1})
1011

1112
from orjson import dumps, loads
1213

@@ -16,8 +17,10 @@ n = int(sys.argv[3]) if len(sys.argv) >= 4 else 1000
1617
with lzma.open(filename, "r") as fileh:
1718
file_bytes = fileh.read()
1819

19-
gc.freeze()
20-
gc.disable()
20+
if hasattr(gc, "freeze"):
21+
gc.freeze()
22+
if hasattr(gc, "disable"):
23+
gc.disable()
2124

2225
if sys.argv[2] == "dumps":
2326
file_obj = loads(file_bytes)

requirements-lint.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mypy==1.18.2
2+
ruff>=0.14,<0.15

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
-r bench/requirements.txt
22
-r integration/requirements.txt
3+
-r requirements-lint.txt
34
-r test/requirements.txt
45
maturin>=1,<2
5-
mypy==1.18.2
6-
ruff>=0.14,<0.15

script/debug

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ export CC="${CC:-clang}"
1212
export LD="${LD:-lld}"
1313
export TARGET="${TARGET:-x86_64-unknown-linux-gnu}"
1414
export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-target}"
15-
export ORJSON_FEATURES="${ORJSON_FEATURES:-yyjson}"
1615

1716
export CFLAGS="-Os -fstrict-aliasing"
1817

1918
export RUSTFLAGS="-C panic=unwind -C linker=${CC} -C link-arg=-fuse-ld=${LD}"
2019

21-
maturin build --profile=dev --target="${TARGET}" --features="${ORJSON_FEATURES}"
20+
maturin build --profile=dev --target="${TARGET}"
2221

2322
uv pip install ${CARGO_TARGET_DIR}/wheels/*.whl
2423

script/develop

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ rm -f target/wheels/*
55
export UNSAFE_PYO3_BUILD_FREE_THREADED=1
66
export UNSAFE_PYO3_SKIP_VERSION_CHECK=1
77

8+
mkdir -p .cargo
9+
cp ci/config.toml .cargo/config.toml
10+
811
export CC="${CC:-clang}"
912
export LD="${LD:-lld}"
1013
export TARGET="${TARGET:-x86_64-unknown-linux-gnu}"

script/pydataclass

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ from tabulate import tabulate
1111

1212
import orjson
1313

14-
os.sched_setaffinity(os.getpid(), {0, 1})
14+
if hasattr(os, "sched_setaffinity"):
15+
os.sched_setaffinity(os.getpid(), {0, 1})
1516

1617

1718
@dataclasses.dataclass

0 commit comments

Comments
 (0)