Skip to content

Commit d630136

Browse files
committed
manylinux_2_24, maturin 0.11, RUSTFLAGS
1 parent bf7aebb commit d630136

16 files changed

+130
-134
lines changed

.cargo/config

Lines changed: 0 additions & 23 deletions
This file was deleted.

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ version = "3.6.0"
44
authors = ["ijl <[email protected]>"]
55
description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy"
66
edition = "2018"
7+
resolver = "2"
78
license = "Apache-2.0 OR MIT"
89
repository = "https://github.com/ijl/orjson"
910
homepage = "https://github.com/ijl/orjson"
1011
readme = "README.md"
1112
keywords = ["fast", "json", "dataclass", "dataclasses", "datetime", "rfc", "8259", "3339"]
1213
include = [
1314
"build.rs",
14-
".cargo",
1515
"Cargo.toml",
1616
"CHANGELOG.md",
1717
"data/*",
@@ -60,10 +60,10 @@ inlinable_string = { version = "0.1" }
6060
itoa = { version = "0.4", default_features = false }
6161
once_cell = { version = "1", default_features = false }
6262
pyo3 = { version = "^0.13.2", default_features = false, features = ["extension-module"]}
63-
ryu = { version = "1" }
63+
ryu = { version = "1", default_features = false }
6464
serde = { version = "1", default_features = false }
6565
serde_json = { path = "./json", default_features = false, features = ["std"] }
66-
smallvec = { version = "^1.6", default_features = false, features = ["const_generics", "union", "specialization", "write"] }
66+
smallvec = { version = "^1.6", default_features = false, features = ["union", "write"] }
6767

6868
[target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "i686", target_arch = "armv7"))'.dependencies]
6969
encoding_rs = { version = "0.8", default_features = false, features = ["simd-accel"] }

README.md

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,10 @@ available in the repository.
7878
To install a wheel from PyPI:
7979

8080
```sh
81-
pip install --upgrade "pip>=19.3" # manylinux2014 support
81+
pip install --upgrade "pip>=20.3" # manylinux_x_y, universal2 wheel support
8282
pip install --upgrade orjson
8383
```
8484

85-
Notice that Linux environments with a `pip` version shipped in 2018 or earlier
86-
must first upgrade `pip` to support `manylinux2014` wheels.
87-
8885
To build a wheel, see [packaging](https://github.com/ijl/orjson#packaging).
8986

9087
### Quickstart
@@ -1142,8 +1139,9 @@ scripts. The memory results can be reproduced using the `pymem` script.
11421139

11431140
### Why can't I install it from PyPI?
11441141

1145-
Probably `pip` needs to be upgraded. `pip` added support for `manylinux2014`
1146-
in 2019.
1142+
1143+
Probably `pip` needs to be upgraded to version 20.3 or later to support
1144+
the latest manylinux_x_y or universal2 wheel formats.
11471145

11481146
### Will it deserialize to dataclasses, UUIDs, decimals, etc or support object_hook?
11491147

@@ -1161,49 +1159,30 @@ If someone implements it well.
11611159

11621160
## Packaging
11631161

1164-
To package orjson requires [Rust](https://www.rust-lang.org/) on the
1165-
nightly channel and the [maturin](https://github.com/PyO3/maturin)
1166-
build tool. maturin can be installed from PyPI or packaged as
1167-
well. This is the simplest and recommended way of installing
1168-
from source, assuming `rustup` is available from a
1169-
package manager:
1170-
1171-
```sh
1172-
rustup default nightly
1173-
pip wheel --no-binary=orjson orjson
1174-
```
1162+
To package orjson requires [Rust](https://www.rust-lang.org/) and the
1163+
[maturin](https://github.com/PyO3/maturin) build tool.
11751164

1176-
This is an example of building a wheel using the repository as source,
1177-
`rustup` installed from upstream, and a pinned version of Rust:
1165+
This is an example for the x86_64-unknown-linux-gnu target:
11781166

11791167
```sh
1180-
pip install maturin
1181-
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-06-24 --profile minimal -y
1182-
maturin build --no-sdist --release --strip --manylinux off
1183-
ls -1 target/wheels
1184-
```
1168+
RUSTFLAGS="-C target-cpu=k8" maturin build --no-sdist --release --strip
1169+
````
11851170

1186-
Problems with the Rust nightly channel may require pinning a version.
1187-
`nightly-2021-06-24` is known to be ok.
1171+
The explicit `RUSTFLAGS` enables SSE2 on amd64. aarch64 does not need any
1172+
`target-feature` specified.
11881173

1189-
orjson is tested for amd64 and aarch64 on Linux, macOS, and Windows. It
1190-
may not work on 32-bit targets. It has recommended `RUSTFLAGS`
1191-
specified in `.cargo/config` so it is recommended to either not set
1192-
`RUSTFLAGS` or include these options.
1174+
The project's own CI tests against `nightly-2021-08-04`. It is prudent to
1175+
pin this version because Rust nightly can introduce breaking changes.
11931176
1194-
There are no runtime dependencies other than libc.
1195-
1196-
orjson's tests are included in the source distribution on PyPI. It is
1197-
necessarily to install dependencies from PyPI specified in
1198-
`test/requirements.txt`. These require a C compiler. The tests do not
1199-
make network requests.
1177+
orjson is tested for amd64 and aarch64 on Linux and amd64 on macOS and
1178+
Windows. It may not work on 32-bit targets.
12001179
1201-
The tests should be run as part of the build. It can be run like this:
1180+
There are no runtime dependencies other than libc.
12021181
1203-
```sh
1204-
pip install -r test/requirements.txt
1205-
pytest -q test
1206-
```
1182+
orjson's tests are included in the source distribution on PyPI. The
1183+
requirements to run the tests are specified in `test/requirements.txt`. The
1184+
tests should be run as part of the build. It can be run with
1185+
`pytest -q test`.
12071186

12081187
## License
12091188

ci/azure-debug.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ steps:
1010
displayName: rustup
1111
- bash: PATH=$(path) rustup default $(toolchain)
1212
displayName: ensure toolchain
13-
- bash: PATH=$(path) pip install --user --upgrade pip maturin==0.10.6
13+
- bash: PATH=$(path) pip install --user --upgrade pip maturin==0.11.2
1414
displayName: build dependencies
1515
- bash: PATH=$(path) $(interpreter) -m pip install --user -r test/requirements.txt -r integration/requirements.txt
1616
displayName: test dependencies
1717
- bash: PATH=$(path) maturin build --no-sdist --strip --manylinux $(manylinux) --interpreter $(interpreter) --target $(target)
18+
env:
19+
RUSTFLAGS: "-C target-cpu=k8"
1820
displayName: build debug
1921
- bash: PATH=$(path) $(interpreter) -m pip install --user target/wheels/orjson*.whl
2022
displayName: install

ci/azure-linux-container.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ steps:
1111
displayName: rustup
1212
- bash: PATH=$(path) rustup default $(toolchain)
1313
displayName: ensure toolchain
14-
- bash: PATH=$(path) pip install --user --upgrade pip maturin==0.10.6 auditwheel
14+
- bash: PATH=$(path) pip install --user --upgrade pip maturin==0.11.2 auditwheel
1515
displayName: build dependencies
1616
- bash: PATH=$(path) maturin build --no-sdist --release --strip --manylinux $(manylinux) --interpreter $(interpreter) --target $(target)
17+
env:
18+
RUSTFLAGS: "-C target-cpu=k8"
1719
displayName: build
1820
- bash: PATH=$(path) $(interpreter) -m auditwheel repair target/wheels/orjson*.whl
1921
displayName: verify that wheel conforms to manylinux tag

ci/azure-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ steps:
99
displayName: rustup
1010
- bash: rustup default $(toolchain)
1111
displayName: ensure toolchain
12-
- bash: pip install --upgrade pip maturin==0.10.6
12+
- bash: pip install --upgrade pip maturin==0.11.2
1313
displayName: build dependencies
1414
- bash: pip install -r test/requirements.txt -r integration/requirements.txt
1515
displayName: test dependencies

ci/azure-pipelines.yml

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@ pr:
44
- '*'
55

66
variables:
7-
toolchain: nightly-2021-06-24
7+
toolchain: nightly-2021-08-04
88

99
jobs:
1010

1111
- job: linux_sdist
1212
pool:
1313
vmImage: ubuntu-20.04
1414
variables:
15-
interpreter: python3.8
15+
interpreter: python3.9
1616
target: x86_64-unknown-linux-gnu
1717
steps:
1818
- task: UsePythonVersion@0
1919
inputs:
20-
versionSpec: '3.8'
20+
versionSpec: '3.9'
2121
addToPath: true
2222
- checkout: self
2323
- template: ./azure-sdist.yml
2424

2525
- job: linux_debug
2626
pool:
2727
vmImage: ubuntu-20.04
28-
container: quay.io/pypa/manylinux2014_x86_64:latest
28+
container: quay.io/pypa/manylinux_2_24_x86_64:latest
2929
variables:
30-
interpreter: python3.8
30+
interpreter: python3.9
3131
manylinux: off
32-
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp38-cp38/bin:/opt/rh/devtoolset-9/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
32+
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp39-cp39/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin
3333
target: x86_64-unknown-linux-gnu
3434
verifyManylinux: false
3535
steps:
@@ -64,56 +64,42 @@ jobs:
6464
- checkout: self
6565
- template: ./azure-linux-container.yml
6666

67-
- job: linux_python39_amd64_manylinux2014
68-
pool:
69-
vmImage: ubuntu-20.04
70-
container: quay.io/pypa/manylinux2014_x86_64:latest
71-
variables:
72-
interpreter: python3.9
73-
manylinux: 2014
74-
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp39-cp39/bin:/opt/rh/devtoolset-9/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
75-
target: x86_64-unknown-linux-gnu
76-
verifyManylinux: true
77-
steps:
78-
- checkout: self
79-
- template: ./azure-linux-container.yml
80-
81-
- job: linux_python38_amd64_manylinux2014
67+
- job: linux_python38_amd64_manylinux_2_24
8268
pool:
8369
vmImage: ubuntu-20.04
84-
container: quay.io/pypa/manylinux2014_x86_64:latest
70+
container: quay.io/pypa/manylinux_2_24_x86_64:latest
8571
variables:
8672
interpreter: python3.8
87-
manylinux: 2014
88-
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp38-cp38/bin:/opt/rh/devtoolset-9/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
73+
manylinux: 2_24
74+
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp38-cp38/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin
8975
target: x86_64-unknown-linux-gnu
9076
verifyManylinux: true
9177
steps:
9278
- checkout: self
9379
- template: ./azure-linux-container.yml
9480

95-
- job: linux_python37_amd64_manylinux2014
81+
- job: linux_python37_amd64_manylinux_2_24
9682
pool:
9783
vmImage: ubuntu-20.04
98-
container: quay.io/pypa/manylinux2014_x86_64:latest
84+
container: quay.io/pypa/manylinux_2_24_x86_64:latest
9985
variables:
10086
interpreter: python3.7
101-
manylinux: 2014
102-
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp37-cp37m/bin:/opt/rh/devtoolset-9/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
87+
manylinux: 2_24
88+
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp37-cp37m/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin
10389
target: x86_64-unknown-linux-gnu
10490
verifyManylinux: true
10591
steps:
10692
- checkout: self
10793
- template: ./azure-linux-container.yml
10894

109-
- job: linux_python36_amd64_manylinux2014
95+
- job: linux_python36_amd64_manylinux_2_24
11096
pool:
11197
vmImage: ubuntu-20.04
112-
container: quay.io/pypa/manylinux2014_x86_64:latest
98+
container: quay.io/pypa/manylinux_2_24_x86_64:latest
11399
variables:
114100
interpreter: python3.6
115-
manylinux: 2014
116-
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp36-cp36m/bin:/opt/rh/devtoolset-9/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
101+
manylinux: 2_24
102+
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp36-cp36m/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin
117103
target: x86_64-unknown-linux-gnu
118104
verifyManylinux: true
119105
steps:
@@ -184,7 +170,7 @@ jobs:
184170
pool:
185171
vmImage: windows-2019
186172
variables:
187-
interpreter: C:\hostedtoolcache\windows\Python\3.9.5\x64\python.exe
173+
interpreter: C:\hostedtoolcache\windows\Python\3.9.6\x64\python.exe
188174
target: x86_64-pc-windows-msvc
189175
steps:
190176
- task: UsePythonVersion@0

ci/azure-sdist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ steps:
88
displayName: rustup
99
- bash: rustup default $(toolchain)
1010
displayName: ensure toolchain
11-
- bash: pip install --upgrade pip maturin==0.10.6
11+
- bash: pip install --upgrade pip maturin==0.11.2
1212
displayName: build dependencies
1313
- bash: python3 -m pip install -r test/requirements.txt -r integration/requirements.txt
1414
displayName: test dependencies

ci/azure-win.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ steps:
1111
rustup default $(toolchain)
1212
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
1313
displayName: rustup
14-
- script: python.exe -m pip install --upgrade pip maturin==0.10.6
14+
- script: python.exe -m pip install --upgrade pip maturin==0.11.2
1515
displayName: build dependencies
1616
- script: python.exe -m pip install -r test\requirements.txt -r integration\requirements.txt
1717
displayName: test dependencies
1818
- script: maturin.exe build --no-sdist --release --strip --interpreter $(interpreter)
19+
env:
20+
RUSTFLAGS: "-C target-cpu=k8"
1921
displayName: build
2022
- script: python.exe -m pip install orjson --no-index --find-links=D:\a\1\s\target\wheels
2123
displayName: install

0 commit comments

Comments
 (0)