Skip to content

feat(node): stream request bodies #967

feat(node): stream request bodies

feat(node): stream request bodies #967

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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ inputs.commit_sha }}
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: |
3.10
3.11
3.12
3.13
3.14
- name: Build wheels
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1
with:
working-directory: impit-python
target: ${{ matrix.target }}
args: --release --out dist --interpreter '3.10 3.11 3.12 3.13 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ inputs.commit_sha }}
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: 3.14
- name: Download wheels
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ inputs.commit_sha }}
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: |
3.10
3.11
3.12
3.13
3.14
- name: Build wheels
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1
with:
working-directory: impit-python
target: ${{ matrix.platform.target }}
args: --release --out dist --interpreter '3.10 3.11 3.12 3.13 3.14 3.14t'
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 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@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # 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@40b42d17c62e10fdf2ddf38bd8734352ecef4b2f # 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ inputs.commit_sha }}
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: |
3.10
3.11
3.12
3.13
3.14
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ inputs.commit_sha }}
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: |
3.10
3.11
3.12
3.13
3.14
- name: Build wheels
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1
with:
working-directory: impit-python
target: ${{ matrix.platform.target }}
args: --release --out dist --interpreter '3.10 3.11 3.12 3.13 3.14 3.14t'
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload wheels
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 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