Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 123 additions & 11 deletions .github/workflows/build-wheels-defined.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ on:
type: string
required: true

platform:
description: Build only for this architecture (or "all" to use checkboxes below)
type: choice
required: false
default: all
options:
- all
- linux_x86_64
- windows
- macos_x86_64
- macos_arm64
- linux_arm64
- linux_armv7
- linux_armv7_legacy

os_ubuntu_latest:
description: Build on ubuntu-latest(x86_64)
type: boolean
Expand Down Expand Up @@ -40,6 +55,11 @@ on:
type: boolean
required: false
default: true
os_linux_armv7_legacy:
description: Build on linux armv7 legacy (bullseye, glibc 2.31)
type: boolean
required: false
default: false

env:
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -53,7 +73,7 @@ jobs:
ubuntu-latest:
needs: get-supported-versions
name: linux x86_64
if: ${{ inputs.os_ubuntu_latest }}
if: ${{ inputs.platform == 'all' && inputs.os_ubuntu_latest || inputs.platform == 'linux_x86_64' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -86,7 +106,7 @@ jobs:
- name: Upload artifacts of downloaded_wheels directory
uses: actions/upload-artifact@v4
with:
name: wheels-download-directory-ubuntu-${{ matrix.python-version }}
name: wheels-download-directory-linux-x86_64-${{ matrix.python-version }}
path: ./downloaded_wheels


Expand Down Expand Up @@ -116,21 +136,24 @@ jobs:
- name: Install build dependencies
run: python -m pip install -r build_requirements.txt

- name: Install additional OS dependencies - Windows
run: powershell -ExecutionPolicy Bypass -File os_dependencies/windows.ps1

- name: Build wheels
run: |
python build_wheels_from_file.py --requirements ${{ inputs.packages }}

- name: Upload artifacts of downloaded_wheels directory
uses: actions/upload-artifact@v4
with:
name: wheels-download-directory-windows-${{ matrix.python-version }}
name: wheels-download-directory-windows-x86_64-${{ matrix.python-version }}
path: ./downloaded_wheels


macos-latest:
needs: get-supported-versions
name: macos x86_64
if: ${{ inputs.os_macos_latest }}
if: ${{ inputs.platform == 'all' && inputs.os_macos_latest || inputs.platform == 'macos_x86_64' }}
runs-on: macos-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -165,7 +188,7 @@ jobs:
- name: Upload artifacts of downloaded_wheels directory
uses: actions/upload-artifact@v4
with:
name: wheels-download-directory-macos-x86-${{ matrix.python-version }}
name: wheels-download-directory-macos-x86_64-${{ matrix.python-version }}
path: ./downloaded_wheels


Expand Down Expand Up @@ -224,7 +247,7 @@ jobs:
linux-armv7:
needs: get-supported-versions
name: linux aarch32 (armv7)
if: ${{ inputs.os_linux_armv7 }}
if: ${{ inputs.platform == 'all' && inputs.os_linux_armv7 || inputs.platform == 'linux_armv7' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -246,6 +269,7 @@ jobs:
-w /work \
-e GH_TOKEN="${GH_TOKEN}" \
-e PIP_NO_CACHE_DIR=1 \
-e LDFLAGS="-Wl,-z,max-page-size=0x1000" \
python:${{ matrix.python-version }}-bookworm \
bash -c "
set -e
Expand All @@ -262,7 +286,7 @@ jobs:
- name: Upload artifacts of downloaded_wheels directory
uses: actions/upload-artifact@v4
with:
name: wheels-download-directory-linux-arm7-${{ matrix.python-version }}
name: wheels-download-directory-linux-armv7-${{ matrix.python-version }}
path: ./downloaded_wheels


Expand Down Expand Up @@ -301,17 +325,105 @@ jobs:
name: wheels-download-directory-linux-arm64-${{ matrix.python-version }}
path: ./downloaded_wheels


linux-armv7-legacy:
needs: get-supported-versions
name: linux aarch32 (armv7 legacy)
if: ${{ inputs.platform == 'all' && inputs.os_linux_armv7_legacy || inputs.platform == 'linux_armv7_legacy' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(needs.get-supported-versions.outputs.supported_python) }}
exclude:
# Python 3.14 doesn't have bullseye images for ARM
- python-version: '3.14'
steps:
- name: Set up QEMU for ARMv7
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm/v7

- name: Checkout repository
uses: actions/checkout@v4

- name: Build wheels - ARMv7 Legacy (in Docker)
# Build on Bullseye (glibc 2.31) for compatibility with older systems
run: |
docker run --rm --platform linux/arm/v7 \
-v $(pwd):/work \
-w /work \
-e GH_TOKEN="${GH_TOKEN}" \
-e PIP_NO_CACHE_DIR=1 \
-e LDFLAGS="-Wl,-z,max-page-size=0x1000" \
python:${{ matrix.python-version }}-bullseye \
bash -c "
set -e
python --version
# Install pip packages without cache to reduce memory usage
python -m pip install --no-cache-dir --upgrade pip
python -m pip install --no-cache-dir -r build_requirements.txt
bash os_dependencies/linux_arm.sh
# Source Rust environment after installation
. \$HOME/.cargo/env
python build_wheels_from_file.py --requirements '${{ inputs.packages }}'
"

- name: Upload artifacts of downloaded_wheels directory
uses: actions/upload-artifact@v4
with:
name: wheels-download-directory-linux-armv7legacy-${{ matrix.python-version }}
path: ./downloaded_wheels

# Repair wheels for dynamically linked libraries on all platforms
# https://github.com/espressif/idf-python-wheels/blob/main/README.md#universal-wheel-tag---linking-of-dynamic-libraries
repair-wheels:
if: ${{ always() }}
needs: [get-supported-versions, ubuntu-latest, windows-latest, macos-latest, macos-m1, linux-armv7, linux-arm64]
needs: [get-supported-versions, ubuntu-latest, windows-latest, macos-latest, macos-m1, linux-armv7, linux-arm64, linux-armv7-legacy]
name: Repair wheels
uses: ./.github/workflows/wheels-repair.yml

upload-python-wheels:
# Test that all wheels can be installed on all supported platforms
test-wheels:
if: ${{ always() }}
needs: [repair-wheels]
needs: [get-supported-versions, repair-wheels]
name: Test wheels installation
uses: ./.github/workflows/test-wheels-install.yml
with:
supported_python_versions: ${{ needs.get-supported-versions.outputs.supported_python }}

upload-python-wheels:
needs: [test-wheels]
name: Upload Python wheels
uses: espressif/idf-python-wheels/.github/workflows/upload-python-wheels.yml@main
uses: ./.github/workflows/upload-python-wheels.yml
secrets: inherit

verify-s3-wheels:
needs: [get-supported-versions, upload-python-wheels]
name: Verify S3 wheels against exclude list
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get oldest Python version
id: python-version
run: |
echo "version=${{ needs.get-supported-versions.outputs.oldest_supported_python }}" >> $GITHUB_OUTPUT

- name: Setup Python ${{ steps.python-version.outputs.version }}
uses: actions/setup-python@v5
with:
python-version: ${{ steps.python-version.outputs.version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r build_requirements.txt

- name: Verify S3 wheels
run: python verify_s3_wheels.py ${{ secrets.DL_BUCKET }} ${{ needs.get-supported-versions.outputs.oldest_supported_python }}
40 changes: 39 additions & 1 deletion .github/workflows/build-wheels-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,46 @@ jobs:
name: Repair wheels
uses: ./.github/workflows/wheels-repair.yml

# Test that all wheels can be installed on all supported platforms
test-wheels:
needs: [get-supported-versions, repair-wheels]
name: Test wheels installation
uses: ./.github/workflows/test-wheels-install.yml
with:
supported_python_versions: ${{ needs.get-supported-versions.outputs.supported_python }}

upload-python-wheels:
needs: [repair-wheels]
needs: [test-wheels]
name: Upload Python wheels
uses: ./.github/workflows/upload-python-wheels.yml
secrets: inherit

verify-s3-wheels:
needs: [get-supported-versions, upload-python-wheels]
name: Verify S3 wheels against exclude list
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get oldest Python version
id: python-version
run: |
echo "version=${{ needs.get-supported-versions.outputs.oldest_supported_python }}" >> $GITHUB_OUTPUT

- name: Setup Python ${{ steps.python-version.outputs.version }}
uses: actions/setup-python@v5
with:
python-version: ${{ steps.python-version.outputs.version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r build_requirements.txt

- name: Verify S3 wheels
run: python verify_s3_wheels.py ${{ secrets.DL_BUCKET }} ${{ needs.get-supported-versions.outputs.oldest_supported_python }}
4 changes: 4 additions & 0 deletions .github/workflows/build-wheels-python-dependent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ jobs:
if: matrix.os == 'Linux ARM64'
run: os_dependencies/linux_arm.sh

- name: Install additional OS dependencies - Windows
if: matrix.os == 'Windows'
run: powershell -ExecutionPolicy Bypass -File os_dependencies/windows.ps1

- name: Download artifacts
uses: actions/download-artifact@v4
with:
Expand Down
Loading
Loading