Skip to content

feat(python): support timeout=None to disable timeout #823

feat(python): support timeout=None to disable timeout

feat(python): support timeout=None to disable timeout #823

Workflow file for this run

name: "[impit-python] Test & Build"
on:
push:
branches:
- "master"
tags:
- "py-*"
paths:
- "impit-python/**"
- "impit/**"
- 'Cargo.*'
pull_request:
paths:
- 'impit-python/**'
- 'impit/**'
- 'Cargo.*'
workflow_dispatch:
workflow_call:
inputs:
commit_sha:
required: false
type: string
default: ${{ github.sha }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
code_checks:
name: Code checks
uses: ./.github/workflows/python-code-checks.yaml
secrets: inherit
linux-build:
needs: code_checks
runs-on: ubuntu-24.04
strategy:
matrix:
target:
- x86_64
- aarch64
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.commit_sha }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- uses: actions/setup-python@v6
with:
python-version: |
3.10
3.11
3.12
3.13
3.14
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: impit-python
target: ${{ matrix.target }}
args: --release --out dist --interpreter '3.10 3.11 3.12 3.13 3.13t 3.14 3.14t' ${{ matrix.target == 'x86_64' && '--sdist' || '' }}
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: ${{ matrix.target == 'x86_64' && 'auto' || matrix.target == 'aarch64' && '2_28' }}
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels-linux-${{ matrix.target }}
path: impit-python/dist
linux-test:
needs: linux-build
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-24.04
target: x86_64
- runner: ubuntu-24.04-arm
target: aarch64
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.commit_sha }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.14
- name: Download wheels
uses: actions/download-artifact@v8
with:
name: wheels-linux-${{ matrix.platform.target }}
path: impit-python/dist
- name: pytest
shell: bash
working-directory: impit-python
env:
APIFY_HTTPBIN_TOKEN: ${{ secrets.APIFY_HTTPBIN_TOKEN }}
run: |
set -e
uv venv
source .venv/bin/activate
uv sync --no-group docs --frozen --no-install-package impit -v
uv pip install --no-index --find-links dist --force-reinstall impit -v
python -m pytest
musllinux:
needs: code_checks
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-22.04
target: aarch64
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.commit_sha }}
- uses: actions/setup-python@v6
with:
python-version: |
3.10
3.11
3.12
3.13
3.14
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: impit-python
target: ${{ matrix.platform.target }}
args: --release --out dist --interpreter '3.10 3.11 3.12 3.13 3.13t 3.14 3.14t'
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: impit-python/dist
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
uses: addnab/docker-run-action@v3
with:
image: alpine:latest
options: -v ${{ github.workspace }}:/io -w /io/impit-python -e APIFY_HTTPBIN_TOKEN=${{ secrets.APIFY_HTTPBIN_TOKEN }}
run: |
set -e
apk add py3-pip py3-virtualenv
python3 -m virtualenv .venv
source .venv/bin/activate
pip install -U uv
uv sync --no-group docs --frozen --no-install-package impit -v
uv pip install --no-index --find-links dist --force-reinstall impit -v
python -m pytest
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
uses: uraimo/run-on-arch-action@v3
with:
arch: ${{ matrix.platform.target }}
distro: alpine_latest
githubToken: ${{ github.token }}
dockerRunArgs: -v ${{ github.workspace }}:/io -w /io/impit-python
env: |
APIFY_HTTPBIN_TOKEN: ${{ secrets.APIFY_HTTPBIN_TOKEN }}
install: |
apk add py3-virtualenv
run: |
set -e
python3 -m virtualenv .venv
source .venv/bin/activate
pip install -U uv
uv sync --no-group docs --frozen --no-install-package impit -v
uv pip install --no-index --find-links dist --force-reinstall impit -v
python -m pytest
windows:
needs: code_checks
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.commit_sha }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- uses: actions/setup-python@v6
with:
python-version: |
3.10
3.11
3.12
3.13
3.14
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: impit-python
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels-windows-${{ matrix.platform.target }}
path: impit-python/dist
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
shell: bash
working-directory: impit-python
env:
APIFY_HTTPBIN_TOKEN: ${{ secrets.APIFY_HTTPBIN_TOKEN }}
run: |
uv venv
source .venv/Scripts/activate
uv sync --no-group docs --frozen --no-install-package impit -v
uv pip install --no-index --find-links dist --force-reinstall impit -v
python -m pytest
macos:
needs: code_checks
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-14-large
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.commit_sha }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: |
3.10
3.11
3.12
3.13
3.14
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: impit-python
target: ${{ matrix.platform.target }}
args: --release --out dist --interpreter '3.10 3.11 3.12 3.13 3.13t 3.14 3.14t'
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels-macos-${{ matrix.platform.target }}
path: impit-python/dist
- name: pytest
working-directory: impit-python
env:
APIFY_HTTPBIN_TOKEN: ${{ secrets.APIFY_HTTPBIN_TOKEN }}
run: |
uv venv
source .venv/bin/activate
uv sync --no-group docs --frozen --no-install-package impit -v
uv pip install --no-index --find-links dist --force-reinstall impit -v
python -m pytest