Skip to content

Bugfix errors with data and json parameters when post a request #996

Bugfix errors with data and json parameters when post a request

Bugfix errors with data and json parameters when post a request #996

Workflow file for this run

# This file is autogenerated by maturin v1.7.4
# To update, run
#
# maturin generate-ci github -o .github/workflows/CI.yml --pytest
#
name: CI
on:
push:
branches:
- main
- '*'
tags:
- '*'
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
apt_packages: ''
custom_env: {}
- runner: ubuntu-latest
target: aarch64
apt_packages: crossbuild-essential-arm64
custom_env:
CFLAGS_aarch64_unknown_linux_gnu: -D__ARM_ARCH=8
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-g++
- runner: ubuntu-latest
target: armv7
apt_packages: crossbuild-essential-armhf
custom_env:
CC: arm-linux-gnueabihf-gcc
CXX: arm-linux-gnueabihf-g++
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-g++
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install target-specific APT dependencies
if: "matrix.platform.apt_packages != ''"
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.platform.apt_packages }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
target: ${{ matrix.platform.target }}
args: ${{ matrix.platform.target == 'x86_64' && '--release --out dist --zig' || '--release --out dist' }}
sccache: 'false'
manylinux: auto
container: 'off'
env: ${{ matrix.platform.custom_env }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist
- name: pytest x86_64
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
shell: bash
run: |
set -e
pip install uv
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
uv venv --preview --python $version
source .venv/bin/activate
uv pip install certifi pytest
uv pip install primp --no-index --find-links dist --force-reinstall
pytest
done
- name: pytest aarch64
if: ${{ startsWith(matrix.platform.target, 'aarch64') }}
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.platform.target }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip
run: |
set -e
pip install uv
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
uv venv --preview --python $version
source .venv/bin/activate
uv pip install certifi pytest
uv pip install primp --no-index --find-links dist --force-reinstall
pytest
done
- name: pytest armv7
if: ${{ startsWith(matrix.platform.target, 'armv7') }}
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.platform.target }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip python3-venv
run: |
set -e
python3 -m venv .venv
source .venv/bin/activate
pip install primp --no-index --find-links dist --force-reinstall
pip install certifi pytest
pytest
musllinux:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
package: x86_64-linux-musl-cross
apt_packages: ''
custom_env:
CC: x86_64-linux-musl-gcc
CXX: x86_64-linux-musl-gcc
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: x86_64-linux-musl-g++
- runner: ubuntu-latest
target: aarch64
package: aarch64-linux-musl-cross
apt_packages: crossbuild-essential-arm64
custom_env:
CC: aarch64-linux-musl-gcc
CXX: aarch64-linux-musl-gcc
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-musl-g++
#- runner: ubuntu-latest
# target: armv7
# package: armv7l-linux-musleabihf-cross
# apt_packages: crossbuild-essential-armhf
# custom_env:
# CC: armv7l-linux-musleabihf-gcc
# CXX: armv7l-linux-musleabihf-g++
# CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER: armv7l-linux-musleabihf-g++
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install target-specific APT dependencies
if: "matrix.platform.apt_packages != ''"
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.platform.apt_packages }}
- name: Prepare musl cross-compiler
run: |
curl -O http://musl.cc/${{ matrix.platform.package }}.tgz
tar xzf ${{ matrix.platform.package }}.tgz -C /opt
echo "/opt/${{ matrix.platform.package }}/bin/" >> $GITHUB_PATH
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
manylinux: musllinux_1_2
container: 'off'
env: ${{ matrix.platform.custom_env }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist
- name: QEMU
if: matrix.platform.target != 'x86_64'
uses: docker/setup-qemu-action@v3
- name: pytest
uses: addnab/docker-run-action@v3
with:
image: quay.io/pypa/musllinux_1_2_${{ matrix.platform.target }}:latest
options: -v ${{ github.workspace }}:/io -w /io
run: |
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
python$version -m venv .venv
source .venv/bin/activate
pip install certifi pytest
pip install primp --no-index --find-links dist --force-reinstall
pytest
done
windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: windows-latest
target: x64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
architecture: ${{ matrix.platform.target }}
- name: Install nasm
run: choco install nasm
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
shell: bash
run: |
set -e
pip install uv
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
uv venv --preview --python $version
source .venv/Scripts/activate
uv pip install certifi pytest
uv pip install primp --no-index --find-links dist --force-reinstall
pytest
done
macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: macos-13
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist
- name: pytest
run: |
set -e
pip install uv
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
uv venv --preview --python $version
source .venv/bin/activate
uv pip install certifi pytest
uv pip install primp --no-index --find-links dist --force-reinstall
pytest
done
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, musllinux, windows, macos, sdist]
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v4
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: 'wheels-*/*'
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
benchmark:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [linux]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: wheels-linux-x86_64
- name: Install dependencies
run: |
pip install -r benchmark/requirements.txt
pip install primp --no-index --find-links ./ --force-reinstall
- name: Start Uvicorn server
run: |
uvicorn benchmark.server:app --host 0.0.0.0 --port 8000 &
sleep 10
- name: Run benchmark
run: python benchmark/benchmark.py
- name: Generate image, commit to the temp branch, merge changes into main, delete temp branch
if: "startsWith(github.ref, 'refs/tags/')"
run: |
python benchmark/generate_image.py
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add \*.jpg
git diff --quiet && git diff --staged --quiet || git commit -m "Update generated image"
git checkout -b update-generated-image
git push https://${{ secrets.PUSH_TOKEN }}@github.com/deedy5/primp.git update-generated-image || echo "No changes to push"
git fetch origin
git checkout main
git merge update-generated-image
git push https://${{ secrets.PUSH_TOKEN }}@github.com/deedy5/primp.git main
git push origin --delete update-generated-image