Skip to content

fix(sync_client): restore missing methods and mock logic #137

fix(sync_client): restore missing methods and mock logic

fix(sync_client): restore missing methods and mock logic #137

Workflow file for this run

# Based on maturin generate-ci and thomasht86/httpr reference
name: CI
on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.13t', '3.14', '3.14t']
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: py${{ matrix.python-version }}
- name: Cargo check
run: cargo check --all-targets
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build & install (maturin develop)
run: uv run maturin develop --release
- name: Run pytest
run: uv run pytest tests/ -q --timeout=120 -x --timeout_method=thread --ignore=tests/test_ssl.py
- name: Run ruff check
run: uv run ruff check .
- name: Run ruff format check
run: uv run ruff format --check .
- name: Run basedpyright
run: uv run basedpyright
linux:
runs-on: ${{ matrix.platform.runner }}
needs: [test]
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
platform:
- runner: ubuntu-24.04
target: x86_64
- runner: ubuntu-24.04-arm
target: aarch64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: true
manylinux: auto
before-script-linux: |
if command -v yum &> /dev/null; then
yum install -y openssl-devel perl-IPC-Cmd
elif command -v apk &> /dev/null; then
apk add openssl-dev
elif command -v apt-get &> /dev/null; then
apt-get update && apt-get install -y libssl-dev pkg-config
fi
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist
musllinux:
runs-on: ${{ matrix.platform.runner }}
needs: [test]
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
platform:
- runner: ubuntu-24.04
target: x86_64
- runner: ubuntu-24.04-arm
target: aarch64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: true
manylinux: musllinux_1_2
before-script-linux: |
if command -v yum &> /dev/null; then
yum install -y openssl-devel perl-IPC-Cmd
elif command -v apk &> /dev/null; then
apk add openssl-dev perl pkgconfig musl-dev
elif command -v apt-get &> /dev/null; then
apt-get update && apt-get install -y libssl-dev pkg-config
fi
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist
windows:
runs-on: ${{ matrix.platform.runner }}
needs: [test]
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
python_arch: x64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'
architecture: ${{ matrix.platform.python_arch }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: true
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist
macos:
runs-on: ${{ matrix.platform.runner }}
needs: [test]
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
platform:
- runner: macos-15
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: true
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist
sdist:
runs-on: ubuntu-latest
needs: [test]
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v6
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v6
with:
name: wheels-sdist
path: dist
release:
name: Release
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
needs: [test, linux, musllinux, windows, macos, sdist]
permissions:
id-token: write
contents: write
attestations: write
packages: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/download-artifact@v7
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v3
with:
subject-path: 'wheels-*/*'
- name: Collect all wheels
run: |
mkdir -p dist
cp wheels-*/* dist/
- name: Generate changelog
id: changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --latest --strip header
env:
OUTPUT: CHANGES.md
- name: Publish to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
skip-existing: true
- name: Create GitHub Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v2
with:
body_path: CHANGES.md
files: |
dist/*