From e3811ecfa1c05d31718d432196f1368e28ff6d83 Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Thu, 2 May 2024 14:45:00 +0300 Subject: [PATCH 1/4] CI: add `musllinux` builds --- .github/workflows/CI.yml | 56 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9415b48..5f35fc7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -59,7 +59,7 @@ jobs: pytest - name: pytest if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }} - uses: uraimo/run-on-arch-action@v2.5.0 + uses: uraimo/run-on-arch-action@v2.7.2 with: arch: ${{ matrix.platform.target }} distro: ubuntu22.04 @@ -73,6 +73,60 @@ jobs: pip3 install pyreqwest_impersonate --no-index --find-links dist --force-reinstall pytest + musllinux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + - runner: ubuntu-latest + target: aarch64 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --zig + sccache: 'true' + manylinux: musllinux_1_2 + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-linux-${{ matrix.platform.target }}-musllinux_1_2 + path: dist + - name: pytest + if: ${{ startsWith(matrix.platform.target, 'x86_64') }} + 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: | + python3 -m venv .venv + source .venv/bin/activate + python3 -m pip install -U pip wheel pytest + python3 -m pip install pyreqwest_impersonate --no-index --find-links dist/ --force-reinstall + python3 -m pytest + - name: pytest + if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }} + uses: uraimo/run-on-arch-action@v2.7.2 + with: + arch: ${{ matrix.platform.target }} + distro: alpine_latest + githubToken: ${{ github.token }} + install: | + apk add py3-pip + python3 -m venv /opt/venv + /opt/venv/bin/pip3 install -U pip pytest + run: | + source /opt/venv/bin/activate + pip3 install pyreqwest_impersonate --no-index --find-links dist --force-reinstall + pytest + windows: runs-on: ${{ matrix.platform.runner }} strategy: From 22e09665843a55de409625fcf108fd59bcf81160 Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Thu, 2 May 2024 14:45:38 +0300 Subject: [PATCH 2/4] CI: use python 3.12 for all steps --- .github/workflows/CI.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5f35fc7..ea9ca66 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -34,7 +34,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -86,7 +86,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -138,7 +138,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' architecture: ${{ matrix.platform.target }} - name: Install nasm run: choco install nasm @@ -175,7 +175,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -237,7 +237,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' - name: Install dependencies run: | sleep 30 # Wait for the package to be available on PyPI From e6a11011eb94ea424dc8344e8106bfbf48becdd1 Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Thu, 2 May 2024 14:46:35 +0300 Subject: [PATCH 3/4] CI: linux - change `manylinux` from `auto` to `2_28` --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ea9ca66..7d2312d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,7 +41,7 @@ jobs: target: ${{ matrix.platform.target }} args: --release --out dist --zig sccache: 'true' - manylinux: auto + manylinux: 2_28 env: CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8" - name: Upload wheels From 4f03efb4181f5a718a7e67b023e234ca81ba41ca Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Thu, 2 May 2024 14:48:20 +0300 Subject: [PATCH 4/4] README: add `musllinux` to precompiled wheels section --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 7170796..6873405 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The fastest python HTTP client that can impersonate web browsers by mimicking th Binding to the Rust [reqwest_impersonate](https://github.com/gngpp/reqwest-impersonate) library.
Provides precompiled wheels: -- [x] Linux: `amd64`, `aarch64`, `armv7`. +- [x] Linux: `amd64`, `aarch64`, `armv7`; musllinux: `amd64`, `aarch64`. - [x] Windows: `amd64`. - [x] MacOS: `amd64`, `aarch64`. @@ -17,7 +17,6 @@ Provides precompiled wheels: - [I. Client](#i-client) - [II. AsyncClient](#ii-asyncclient) - ## Installation ```python