Skip to content

Commit

Permalink
maturin 0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Jul 19, 2022
1 parent fb49340 commit 8512f7f
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 74 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/linux-cross.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
env:
PYO3_CROSS_LIB_DIR: /opt/python/${{ matrix.python.abi }}
with:
maturin-version: v0.12.19
maturin-version: v0.13.0
target: ${{ matrix.target }}
rust-toolchain: nightly-2022-06-22
manylinux: auto
args: -i python3.9 --release --strip --out dist --no-sdist
args: -i python3.9 --release --strip --out dist
- uses: uraimo/run-on-arch-action@v2.0.5
name: Install built wheel
with:
Expand Down Expand Up @@ -67,9 +67,8 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- run: pip install "maturin>=0.12.19,<0.13"
- run: pip install "maturin>=0.13,<0.14"
- name: deploy
run: maturin upload --skip-existing --username "$MATURIN_USERNAME" *.whl
env:
MATURIN_USERNAME: ${{ secrets.TWINE_USERNAME }}
MATURIN_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
7 changes: 3 additions & 4 deletions .github/workflows/manylinux2014.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
steps:
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2022-06-22 --profile minimal -y
- uses: actions/checkout@v2
- run: python3 -m pip install --user --upgrade pip "maturin>=0.12.19,<0.13" wheel
- run: python3 -m pip install --user --upgrade pip "maturin>=0.13,<0.14" wheel
- run: cargo fetch
- run: maturin build --no-sdist --release --strip --cargo-extra-args="--features=unstable-simd,yyjson" --compatibility manylinux2014 --interpreter python${{ matrix.python.version }}
- run: maturin build --release --strip --features=unstable-simd,yyjson --compatibility manylinux2014 --interpreter python${{ matrix.python.version }}
- run: python3 -m pip install --user target/wheels/orjson*.whl
- run: python3 -m pip install --user -r test/requirements.txt -r integration/requirements.txt
- run: pytest -s -rxX -v test
Expand All @@ -43,5 +43,4 @@ jobs:
run: maturin upload --skip-existing --username "$MATURIN_USERNAME" target/wheels/orjson-*.whl
if: "startsWith(github.ref, 'refs/tags/')"
env:
MATURIN_USERNAME: ${{ secrets.TWINE_USERNAME }}
MATURIN_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
16 changes: 7 additions & 9 deletions .github/workflows/manylinux_2_28.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ jobs:
]
env:
PATH: /github/home/.local/bin:/github/home/.cargo/bin:/opt/python/${{ matrix.python.abi }}/bin:/opt/rh/gcc-toolset-11/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
container:
image: quay.io/pypa/manylinux_2_28_x86_64:latest
options: --user 0
steps:
- run: yum update -y && yum install -y clang lld
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2022-06-22 --profile minimal -y
- uses: actions/checkout@v2
- run: python3 -m pip install --user --upgrade pip "maturin>=0.12.19,<0.13" wheel
- run: python3 -m pip install --user --upgrade pip "maturin>=0.13,<0.14" wheel
- run: cargo fetch
- run: maturin build --no-sdist --release --strip --cargo-extra-args="--features=unstable-simd,yyjson" --compatibility manylinux_2_28 --interpreter python${{ matrix.python.version }}
env:
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
- run: maturin build --release --strip --features=unstable-simd,yyjson --compatibility manylinux_2_28 --interpreter python${{ matrix.python.version }}
- run: python3 -m pip install --user target/wheels/orjson*.whl
- run: python3 -m pip install --user -r test/requirements.txt -r integration/requirements.txt
- run: pytest -s -rxX -v test
Expand All @@ -47,5 +46,4 @@ jobs:
run: maturin upload --skip-existing --username "$MATURIN_USERNAME" target/wheels/orjson-*.whl
if: "startsWith(github.ref, 'refs/tags/')"
env:
MATURIN_USERNAME: ${{ secrets.TWINE_USERNAME }}
MATURIN_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
9 changes: 4 additions & 5 deletions .github/workflows/musllinux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:
- name: Build wheels
uses: messense/maturin-action@v1
with:
maturin-version: v0.12.19
maturin-version: v0.13.0
rust-toolchain: nightly-2022-06-22
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_1
args: --release --strip --out dist --no-sdist --cargo-extra-args="--features=unstable-simd,yyjson" -i python${{ matrix.python.version }}
args: --release --strip --out dist --features=unstable-simd,yyjson -i python${{ matrix.python.version }}
- name: Set up QEMU
if: matrix.platform.arch != 'x86_64'
uses: docker/setup-qemu-action@v2
Expand Down Expand Up @@ -78,9 +78,8 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- run: pip install "maturin>=0.12.19,<0.13"
- run: pip install "maturin>=0.13,<0.14"
- name: deploy
run: maturin upload --skip-existing --username "$MATURIN_USERNAME" *.whl
env:
MATURIN_USERNAME: ${{ secrets.TWINE_USERNAME }}
MATURIN_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ and the [maturin](https://github.com/PyO3/maturin) build tool. It benefits
from also having `clang`. The recommended build command is:

```sh
maturin build --no-sdist --release --strip --cargo-extra-args="--features=yyjson"
maturin build --release --strip --features=yyjson
```

To build without use of `clang`, do not specify `--features=yyjson`.
Expand Down
4 changes: 2 additions & 2 deletions ci/azure-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ steps:
displayName: rustup
- bash: PATH=$(path) rustup default $(toolchain)
displayName: ensure toolchain
- bash: PATH=$(path) $(interpreter) -m pip install --user --upgrade pip "maturin>=0.12.19,<0.13" wheel
- bash: PATH=$(path) $(interpreter) -m pip install --user --upgrade pip "maturin>=0.13,<0.14" wheel
displayName: build dependencies
- bash: PATH=$(path) $(interpreter) -m pip install --user -r test/requirements.txt -r integration/requirements.txt
displayName: test dependencies
- bash: PATH=$(path) maturin build --no-sdist --strip $(extra) --compatibility $(compatibility) --interpreter $(interpreter)
- bash: PATH=$(path) maturin build --strip $(extra) --compatibility $(compatibility) --interpreter $(interpreter)
displayName: build debug
- bash: PATH=$(path) $(interpreter) -m pip install --user target/wheels/orjson*.whl
displayName: install
Expand Down
18 changes: 6 additions & 12 deletions ci/azure-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ steps:
displayName: rustup
- bash: rustup default $(toolchain)
displayName: ensure toolchain
- bash: pip install --upgrade pip "maturin>=0.12.19,<0.13" wheel
- bash: pip install --upgrade pip "maturin>=0.13,<0.14" wheel
displayName: build dependencies
- bash: pip install -r test/requirements.txt -r integration/requirements.txt
displayName: test dependencies
- bash: PATH=$HOME/.cargo/bin:$PATH cargo fetch
- bash: PATH=$HOME/.cargo/bin:$PATH maturin build --no-sdist --release --strip --cargo-extra-args="--features=unstable-simd,yyjson" --interpreter $(interpreter)
- bash: PATH=$HOME/.cargo/bin:$PATH maturin build --release --strip --features=unstable-simd,yyjson --interpreter $(interpreter)
env:
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
Expand All @@ -32,7 +32,7 @@ steps:
displayName: http
- bash: rustup target add aarch64-apple-darwin
displayName: rustup target
- bash: PATH=$HOME/.cargo/bin:$PATH PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") maturin build --no-sdist --release --strip --cargo-extra-args="--features=unstable-simd" --interpreter $(interpreter) --universal2
- bash: PATH=$HOME/.cargo/bin:$PATH PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") maturin build --release --strip --features=unstable-simd --interpreter $(interpreter) --universal2
env:
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
Expand All @@ -42,13 +42,7 @@ steps:
displayName: install universal2
- bash: pytest -s -rxX -v test
displayName: pytest universal2
- bash: ./ci/deploy target/wheels/*_x86_64.whl
displayName: deploy x86_64
- bash: ./ci/deploy target/wheels/*.whl
displayName: deploy
env:
MATURIN_PASSWORD: $(TWINE_PASSWORD)
MATURIN_USERNAME: $(TWINE_USERNAME)
- bash: ./ci/deploy target/wheels/*_universal2.whl
displayName: deploy universal2
env:
MATURIN_PASSWORD: $(TWINE_PASSWORD)
MATURIN_USERNAME: $(TWINE_USERNAME)
MATURIN_PYPI_TOKEN: $(PYPI_TOKEN)
5 changes: 2 additions & 3 deletions ci/azure-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.12.19,<0.13" wheel
- bash: PATH=$(path) $(interpreter) -m pip install --user --upgrade pip "maturin>=0.13,<0.14" wheel
displayName: build dependencies
- bash: PATH=$(path) $(interpreter) -m pip install --user -r test/requirements.txt -r integration/requirements.txt mypy==0.960
displayName: test dependencies
Expand All @@ -33,5 +33,4 @@ steps:
- bash: PATH=$(path) ./ci/deploy target/wheels/*.tar.gz
displayName: deploy
env:
MATURIN_PASSWORD: $(TWINE_PASSWORD)
MATURIN_USERNAME: $(TWINE_USERNAME)
MATURIN_PYPI_TOKEN: $(PYPI_TOKEN)
7 changes: 3 additions & 4 deletions ci/azure-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ 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.12.19,<0.13" wheel
- script: python.exe -m pip install --upgrade pip "maturin>=0.13,<0.14" wheel
displayName: build dependencies
- script: python.exe -m pip install -r test\requirements.txt -r integration\requirements.txt
displayName: test dependencies
- script: maturin.exe build --no-sdist --release --strip --interpreter $(interpreter)
- script: maturin.exe build --release --strip --interpreter $(interpreter)
displayName: build
- script: python.exe -m pip install orjson --no-index --find-links=D:\a\1\s\target\wheels
displayName: install
Expand All @@ -30,5 +30,4 @@ steps:
- bash: ./ci/deploy /d/a/1/s/target/wheels/*.whl
displayName: deploy
env:
MATURIN_PASSWORD: $(TWINE_PASSWORD)
MATURIN_USERNAME: $(TWINE_USERNAME)
MATURIN_PYPI_TOKEN: $(PYPI_TOKEN)
2 changes: 1 addition & 1 deletion ci/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ if [[ "$tag" == "undefined" ]]; then
exit 0
fi

maturin upload --skip-existing --username "$MATURIN_USERNAME" "$1"
maturin upload --skip-existing "$1"
42 changes: 16 additions & 26 deletions ci/drone.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# the repetition should be a function using jsonnet, but drone still
# expects YAML even with .jsonnet extension, yielding a parse error
kind: pipeline
name: linux_python310_aarch64
platform:
Expand All @@ -9,20 +7,18 @@ steps:
image: quay.io/pypa/manylinux_2_28_aarch64:latest
environment:
PATH: "/root/.local/bin:/root/.cargo/bin:/opt/python/cp310-cp310/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
MATURIN_USERNAME:
from_secret: twine_username
MATURIN_PASSWORD:
from_secret: twine_password
MATURIN_PYPI_TOKEN:
from_secret: pypi_token
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
commands:
- yum update -y && yum install -y clang lld
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2022-06-22 --profile minimal -y
- python3.10 -m pip install --user --upgrade pip "maturin>=0.12.19,<0.13" wheel
- python3.10 -m pip install --user --upgrade pip "maturin>=0.13,<0.14" wheel
- cargo fetch
- maturin build --no-sdist --release --strip --compatibility manylinux_2_28 --cargo-extra-args="--features=unstable-simd,yyjson" --interpreter python3.10
- maturin build --release --strip --compatibility manylinux_2_28 --features=unstable-simd,yyjson --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
- pytest -s -rxX -v test
Expand All @@ -39,20 +35,18 @@ steps:
image: quay.io/pypa/manylinux_2_28_aarch64:latest
environment:
PATH: "/root/.local/bin:/root/.cargo/bin:/opt/python/cp39-cp39/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
MATURIN_USERNAME:
from_secret: twine_username
MATURIN_PASSWORD:
from_secret: twine_password
MATURIN_PYPI_TOKEN:
from_secret: pypi_token
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
commands:
- yum update -y && yum install -y clang lld
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2022-06-22 --profile minimal -y
- python3.9 -m pip install --user --upgrade pip "maturin>=0.12.19,<0.13" wheel
- python3.9 -m pip install --user --upgrade pip "maturin>=0.13,<0.14" wheel
- cargo fetch
- maturin build --no-sdist --release --strip --compatibility manylinux_2_28 --cargo-extra-args="--features=unstable-simd,yyjson" --interpreter python3.9
- maturin build --release --strip --compatibility manylinux_2_28 --features=unstable-simd,yyjson --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
- pytest -s -rxX -v test
Expand All @@ -69,20 +63,18 @@ steps:
image: quay.io/pypa/manylinux_2_28_aarch64:latest
environment:
PATH: "/root/.local/bin:/root/.cargo/bin:/opt/python/cp38-cp38/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
MATURIN_USERNAME:
from_secret: twine_username
MATURIN_PASSWORD:
from_secret: twine_password
MATURIN_PYPI_TOKEN:
from_secret: pypi_token
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
commands:
- yum update -y && yum install -y clang lld
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2022-06-22 --profile minimal -y
- python3.8 -m pip install --user --upgrade pip "maturin>=0.12.19,<0.13" wheel
- python3.8 -m pip install --user --upgrade pip "maturin>=0.13,<0.14" wheel
- cargo fetch
- maturin build --no-sdist --release --strip --compatibility manylinux_2_28 --cargo-extra-args="--features=unstable-simd,yyjson" --interpreter python3.8
- maturin build --release --strip --compatibility manylinux_2_28 --features=unstable-simd,yyjson --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
- pytest -s -rxX -v test
Expand All @@ -99,20 +91,18 @@ steps:
image: quay.io/pypa/manylinux_2_28_aarch64:latest
environment:
PATH: "/root/.local/bin:/root/.cargo/bin:/opt/python/cp37-cp37m/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
MATURIN_USERNAME:
from_secret: twine_username
MATURIN_PASSWORD:
from_secret: twine_password
MATURIN_PYPI_TOKEN:
from_secret: pypi_token
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
commands:
- yum update -y && yum install -y clang lld
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2022-06-22 --profile minimal -y
- python3.7 -m pip install --user --upgrade pip "maturin>=0.12.19,<0.13" wheel
- python3.7 -m pip install --user --upgrade pip "maturin>=0.13,<0.14" wheel
- cargo fetch
- maturin build --no-sdist --release --strip --compatibility manylinux_2_28 --cargo-extra-args="--features=unstable-simd,yyjson" --interpreter python3.7
- maturin build --release --strip --compatibility manylinux_2_28 --features=unstable-simd,yyjson --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
- pytest -s -rxX -v test
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository = "https://github.com/ijl/orjson"

[build-system]
build-backend = "maturin"
requires = ["maturin>=0.12.19,<0.13"]
requires = ["maturin>=0.13,<0.14"]

[tool.maturin]
sdist-include = ["build.rs", "Cargo.lock", "include"]
Expand Down
2 changes: 1 addition & 1 deletion script/develop
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export CFLAGS="-O2 -fno-plt -flto=thin"
export LDFLAGS="-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
export RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=lld"

maturin build --no-sdist --compatibility off -i python3 --release "$@"
maturin build --compatibility off -i python3 --release "$@"

pip install --force $(find target/wheels -name "*cp3*")

0 comments on commit 8512f7f

Please sign in to comment.