diff --git a/Cargo.lock b/Cargo.lock index f6bdf025..6b41da97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -91,24 +91,24 @@ checksum = "3094308123a0e9fd59659ce45e22de9f53fc1d2ac6e1feb9fef988e4f76cad77" [[package]] name = "instant" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" +checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "itoa" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "libc" -version = "0.2.99" +version = "0.2.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" +checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" [[package]] name = "libm" @@ -118,9 +118,9 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "lock_api" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" dependencies = [ "scopeguard", ] @@ -172,9 +172,9 @@ dependencies = [ [[package]] name = "packed_simd_2" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e64858a2d3733fdd61adfdd6da89aa202f7ff0e741d2fc7ed1e452ba9dc99d7" +checksum = "71c0c06716cfc81616fa8e22b721ce92fecd594508bc0eb3d04ae3ef35ac10c5" dependencies = [ "cfg-if 0.1.10", "libm", @@ -182,9 +182,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ "cfg-if 1.0.0", "instant", @@ -207,9 +207,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af205762ba65eec9f27a2fa1a57a40644e8e3368784b8c8b2f2de48f6e8ddd96" +checksum = "35100f9347670a566a67aa623369293703322bb9db77d99d7df7313b575ae0c8" dependencies = [ "cfg-if 1.0.0", "libc", @@ -219,9 +219,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755944027ce803c7238e59c5a18e59c1d0a4553db50b23e9ba209a568353028d" +checksum = "d12961738cacbd7f91b7c43bc25cfeeaa2698ad07a04b3be0aa88b950865738f" dependencies = [ "once_cell", ] @@ -249,15 +249,15 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.127" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" [[package]] name = "serde_json" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127" +checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" dependencies = [ "itoa", "ryu", @@ -272,9 +272,9 @@ checksum = "c970da16e7c682fa90a261cf0724dee241c9f7831635ecc4e988ae8f3b505559" [[package]] name = "smallvec" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" [[package]] name = "version_check" diff --git a/Cargo.toml b/Cargo.toml index 9af15bb8..dc0e847a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,12 +69,12 @@ encoding_rs = { version = "0.8", default_features = false } inlinable_string = { version = "0.1" } itoa = { version = "0.4", default_features = false } once_cell = { version = "1", default_features = false } -pyo3 = { version = "^0.14.2", default_features = false, features = ["extension-module"]} +pyo3 = { version = "^0.14.5", default_features = false, features = ["extension-module"]} ryu = { version = "1", default_features = false } serde = { version = "1", default_features = false } -serde_json = { version = "^1.0.66", default_features = false, features = ["std", "float_roundtrip"] } +serde_json = { version = "^1.0.68", default_features = false, features = ["std", "float_roundtrip"] } simdutf8 = { version = "0.1", default_features = false, features = ["std"] } -smallvec = { version = "^1.6", default_features = false, features = ["union", "write"] } +smallvec = { version = "^1.7", default_features = false, features = ["union", "write"] } [profile.release] codegen-units = 1 @@ -83,3 +83,6 @@ incremental = false lto = "thin" opt-level = 3 panic = "abort" + +[profile.release.build-override] +opt-level = 0 diff --git a/README.md b/README.md index 831354db..eec7eb2a 100644 --- a/README.md +++ b/README.md @@ -1171,7 +1171,7 @@ maturin build --no-sdist --release --strip --cargo-extra-args="--features=unstab To build on the stable channel, do not specify `--features=unstable-simd`. -The project's own CI tests against `nightly-2021-08-17` and stable 1.54. It +The project's own CI tests against `nightly-2021-10-01` and stable 1.54. It is prudent to pin the nightly version because that channel can introduce breaking changes. diff --git a/build.rs b/build.rs new file mode 100644 index 00000000..5ac15b5a --- /dev/null +++ b/build.rs @@ -0,0 +1,13 @@ +use std::process::Command; + +fn main() { + let out = Command::new("python") + .args(&["-c", "import sys; print(sys.version_info[1])"]) + .output() + .expect("python version did not print"); + let version = u8::from_str_radix(String::from_utf8_lossy(&out.stdout).trim(), 10) + .expect("python version was not parsed"); + for each in 8..(version + 1) { + println!("cargo:rustc-cfg=Py_3_{}", each); + } +} diff --git a/ci/azure-debug.yml b/ci/azure-debug.yml index 2b2fbf52..e259a76b 100644 --- a/ci/azure-debug.yml +++ b/ci/azure-debug.yml @@ -20,7 +20,7 @@ steps: displayName: rustup - bash: PATH=$(path) rustup default $(toolchain) displayName: ensure toolchain -- bash: PATH=$(path) $(interpreter) -m pip install --user --upgrade pip maturin==0.11.2 +- bash: PATH=$(path) $(interpreter) -m pip install --user --upgrade pip maturin==0.11.4 displayName: build dependencies - bash: PATH=$(path) $(interpreter) -m pip install --user -r test/requirements.txt -r integration/requirements.txt displayName: test dependencies diff --git a/ci/azure-linux-container.yml b/ci/azure-linux-container.yml index 276c916b..a7f7cf21 100644 --- a/ci/azure-linux-container.yml +++ b/ci/azure-linux-container.yml @@ -20,7 +20,7 @@ steps: displayName: rustup - bash: PATH=$(path) rustup default $(toolchain) displayName: ensure toolchain -- bash: PATH=$(path) $(interpreter) -m pip install --user --upgrade pip maturin==0.11.2 auditwheel +- bash: PATH=$(path) $(interpreter) -m pip install --user --upgrade pip maturin==0.11.4 auditwheel displayName: build dependencies - bash: PATH=$(path) maturin build --no-sdist --release --strip $(extra) --compatibility $(manylinux) --interpreter $(interpreter) env: diff --git a/ci/azure-macos.yml b/ci/azure-macos.yml index 75f7d3db..ed8cd365 100644 --- a/ci/azure-macos.yml +++ b/ci/azure-macos.yml @@ -7,7 +7,7 @@ steps: displayName: rustup - bash: rustup default $(toolchain) displayName: ensure toolchain -- bash: pip install --upgrade pip maturin==0.11.2 +- bash: pip install --upgrade pip maturin==0.11.4 displayName: build dependencies - bash: pip install -r test/requirements.txt -r integration/requirements.txt displayName: test dependencies diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 4dce739a..ed9b3e1f 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -4,7 +4,7 @@ pr: - '*' variables: - toolchain: nightly-2021-08-17 + toolchain: nightly-2021-10-01 jobs: @@ -180,7 +180,7 @@ jobs: pool: vmImage: windows-2019 variables: - interpreter: C:\hostedtoolcache\windows\Python\3.9.6\x64\python.exe + interpreter: C:\hostedtoolcache\windows\Python\3.9.7\x64\python.exe target: x86_64-pc-windows-msvc steps: - task: UsePythonVersion@0 diff --git a/ci/azure-sdist.yml b/ci/azure-sdist.yml index 29790e23..1cf9cd9c 100644 --- a/ci/azure-sdist.yml +++ b/ci/azure-sdist.yml @@ -14,7 +14,7 @@ steps: displayName: rustup - bash: PATH=$(path) rustup default $(toolchain) displayName: ensure toolchain -- bash: PATH=$(path) $(interpreter) -m pip install --user --upgrade pip maturin==0.11.2 +- bash: PATH=$(path) $(interpreter) -m pip install --user --upgrade pip maturin==0.11.4 displayName: build dependencies - bash: PATH=$(path) $(interpreter) -m pip install --user -r test/requirements.txt -r integration/requirements.txt displayName: test dependencies diff --git a/ci/azure-win.yml b/ci/azure-win.yml index 4d0620dd..76d9717a 100644 --- a/ci/azure-win.yml +++ b/ci/azure-win.yml @@ -11,7 +11,7 @@ steps: rustup default $(toolchain) echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" displayName: rustup -- script: python.exe -m pip install --upgrade pip maturin==0.11.2 +- script: python.exe -m pip install --upgrade pip maturin==0.11.4 displayName: build dependencies - script: python.exe -m pip install -r test\requirements.txt -r integration\requirements.txt displayName: test dependencies diff --git a/ci/drone.yml b/ci/drone.yml index 3a724cfa..f3225522 100644 --- a/ci/drone.yml +++ b/ci/drone.yml @@ -14,8 +14,8 @@ steps: MATURIN_PASSWORD: from_secret: twine_password commands: - - curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-08-17 --profile minimal -y - - python3.10 -m pip install --user --upgrade pip maturin==0.11.2 + - curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-10-01 --profile minimal -y + - python3.10 -m pip install --user --upgrade pip maturin==0.11.4 - maturin build --no-sdist --release --strip --compatibility 2_24 --cargo-extra-args="--features=unstable-simd" --interpreter python3.10 - python3.10 -m pip install --user target/wheels/orjson*.whl - python3.10 -m pip install --user -r test/requirements.txt -r integration/requirements.txt @@ -38,8 +38,8 @@ steps: MATURIN_PASSWORD: from_secret: twine_password commands: - - curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-08-17 --profile minimal -y - - python3.9 -m pip install --user --upgrade pip maturin==0.11.2 + - curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-10-01 --profile minimal -y + - python3.9 -m pip install --user --upgrade pip maturin==0.11.4 - maturin build --no-sdist --release --strip --compatibility 2_24 --cargo-extra-args="--features=unstable-simd" --interpreter python3.9 - python3.9 -m pip install --user target/wheels/orjson*.whl - python3.9 -m pip install --user -r test/requirements.txt -r integration/requirements.txt @@ -62,8 +62,8 @@ steps: MATURIN_PASSWORD: from_secret: twine_password commands: - - curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-08-17 --profile minimal -y - - python3.8 -m pip install --user --upgrade pip maturin==0.11.2 + - curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-10-01 --profile minimal -y + - python3.8 -m pip install --user --upgrade pip maturin==0.11.4 - maturin build --no-sdist --release --strip --compatibility 2_24 --cargo-extra-args="--features=unstable-simd" --interpreter python3.8 - python3.8 -m pip install --user target/wheels/orjson*.whl - python3.8 -m pip install --user -r test/requirements.txt -r integration/requirements.txt @@ -86,8 +86,8 @@ steps: MATURIN_PASSWORD: from_secret: twine_password commands: - - curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-08-17 --profile minimal -y - - python3.7 -m pip install --user --upgrade pip maturin==0.11.2 + - curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-10-01 --profile minimal -y + - python3.7 -m pip install --user --upgrade pip maturin==0.11.4 - maturin build --no-sdist --release --strip --compatibility 2_24 --cargo-extra-args="--features=unstable-simd" --interpreter python3.7 - python3.7 -m pip install --user target/wheels/orjson*.whl - python3.7 -m pip install --user -r test/requirements.txt -r integration/requirements.txt diff --git a/pyproject.toml b/pyproject.toml index 3d061173..ae4a1139 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ repository = "https://github.com/ijl/orjson" [build-system] build-backend = "maturin" -requires = ["maturin>=0.11.2,<0.12"] +requires = ["maturin>=0.11.4,<0.12"] [tool.maturin] sdist-include = ["Cargo.lock"] @@ -12,5 +12,5 @@ strip = true [tool.black] line-length = 88 -target-version = ['py36', 'py37', 'py38'] +target-version = ['py37', 'py38', 'py39'] include = '\.pyi?$' diff --git a/test/test_transform.py b/test/test_transform.py index eab7848d..f39d9fa3 100644 --- a/test/test_transform.py +++ b/test/test_transform.py @@ -83,7 +83,7 @@ def test_object_same_key_unclear_values(self): """ object_same_key_unclear_values.json """ - self._pass_transform("object_same_key_unclear_values.json", b'{"a":0}') + self._pass_transform("object_same_key_unclear_values.json", b'{"a":-0.0}') def test_string_1_escaped_invalid_codepoint(self): """