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
4 changes: 4 additions & 0 deletions .github/workflows/build-wheels-defined.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ jobs:
run: os_dependencies/macos.sh

- name: Build wheels
env:
ARCHFLAGS: "-arch x86_64" # Force x86_64-only wheels, not universal2
run: |
python build_wheels_from_file.py --requirements ${{ inputs.packages }}

Expand Down Expand Up @@ -207,6 +209,8 @@ jobs:
run: os_dependencies/macos.sh

- name: Build wheels
env:
ARCHFLAGS: "-arch arm64" # Force arm64-only wheels, not universal2
run: |
python build_wheels_from_file.py --requirements ${{ inputs.packages }}

Expand Down
72 changes: 49 additions & 23 deletions .github/workflows/build-wheels-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,30 @@ jobs:
build-wheels:
needs: get-supported-versions
name: Build for ${{ matrix.os }} (Python ${{matrix.python-version}})
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
- windows-latest
- ubuntu-latest
- macos-15-intel # MacOS x86_64
- macos-latest # MacOS arm64 (M1)
- ubuntu-24.04-arm
- linux-armv7-self-hosted
os: # Platform names for identification
- Windows
- Linux x86_64
- macOS Intel
- macOS ARM
- Linux ARM64
- Linux ARMv7
include:
- os: linux-armv7-self-hosted
- os: Windows
runner: windows-latest
- os: Linux x86_64
runner: ubuntu-latest
- os: macOS Intel
runner: macos-15-intel
- os: macOS ARM
runner: macos-latest
- os: Linux ARM64
runner: ubuntu-24.04-arm
- os: Linux ARMv7
runner: linux-armv7-self-hosted # Self-hosted ARMv7 runner
CONTAINER: python:${{ needs.get-supported-versions.outputs.oldest_supported_python }}-bookworm
python-version: ['${{ needs.get-supported-versions.outputs.oldest_supported_python }}']

Expand All @@ -38,12 +49,12 @@ jobs:

steps:
- name: OS info
if: matrix.os != 'windows-latest'
if: matrix.os != 'Windows'
run: |
echo "Operating System: ${{ runner.os }}"
echo "Architecture: $(uname -m)"
- name: OS info
if: matrix.os == 'windows-latest'
if: matrix.os == 'Windows'
run: |
echo "Operating System: ${{ runner.os }}"
echo "Architecture: $env:PROCESSOR_ARCHITECTURE"
Expand All @@ -60,7 +71,7 @@ jobs:

- name: Setup Python
# Skip setting python on ARM because of missing compatibility: https://github.com/actions/setup-python/issues/108
if: matrix.os != 'linux-armv7-self-hosted'
if: matrix.os != 'Linux ARMv7'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -79,47 +90,56 @@ jobs:


- name: Install additional OS dependencies - Ubuntu
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'Linux x86_64'
run: os_dependencies/ubuntu.sh

- name: Install additional OS dependencies - MacOS
if: matrix.os == 'macos-latest' || matrix.os == 'macos-15-intel'
if: matrix.os == 'macOS ARM' || matrix.os == 'macOS Intel'
run: os_dependencies/macos.sh

- name: Install additional OS dependencies - Linux ARM
if: matrix.os == 'linux-armv7-self-hosted' || matrix.os == 'ubuntu-24.04-arm'
if: matrix.os == 'Linux ARMv7' || matrix.os == 'Linux ARM64'
run: os_dependencies/linux_arm.sh

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


- name: Build wheels for IDF
if: matrix.os != 'windows-latest'
if: matrix.os != 'Windows'
run: |
# Source Rust environment for self-hosted ARMv7 runner
if [ "${{ matrix.os }}" = "linux-armv7-self-hosted" ]; then
# Source Rust environment for ARMv7
if [ "${{ matrix.os }}" = "Linux ARMv7" ]; then
. $HOME/.cargo/env
fi

# Set ARCHFLAGS for macOS to prevent universal2 wheels
if [ "${{ matrix.os }}" = "macOS ARM" ]; then
export ARCHFLAGS="-arch arm64"
elif [ "${{ matrix.os }}" = "macOS Intel" ]; then
export ARCHFLAGS="-arch x86_64"
fi

python build_wheels.py

- name: Build wheels for IDF - Windows
if: matrix.os == 'windows-latest'
if: matrix.os == 'Windows'
run: python build_wheels.py

- name: Upload artifacts of downloaded_wheels directory
uses: actions/upload-artifact@v4
with:
name: wheels-download-directory-${{ matrix.os}}-${{ matrix.python-version }}
name: wheels-download-directory-${{ matrix.runner}}-${{ matrix.python-version }}
path: ./downloaded_wheels
retention-days: 1

- name: Upload artifacts of Python version dependent wheels
uses: actions/upload-artifact@v4
with:
name: dependent_requirements_${{ matrix.os}}
name: dependent_requirements_${{ matrix.runner}}
path: ./dependent_requirements.txt
retention-days: 1


build-python-version-dependent-wheels:
Expand All @@ -130,9 +150,15 @@ jobs:
supported_python_versions: ${{ needs.get-supported-versions.outputs.supported_python }}
oldest_supported_python: ${{ needs.get-supported-versions.outputs.oldest_supported_python }}

# Repair wheels for all platforms (Windows, macOS, Linux)
repair-wheels:
needs: [build-wheels, build-python-version-dependent-wheels]
name: Repair wheels
uses: ./.github/workflows/wheels-repair.yml

# TODO Uncomment this when we are ready to upload the wheels
#upload-python-wheels:
# needs: [build-wheels, build-python-version-dependent-wheels]
# needs: [repair-manylinux-wheels] # Changed to depend on repaired wheels
# name: Upload Python wheels
# uses: ./.github/workflows/upload-python-wheels.yml
# secrets: inherit
82 changes: 51 additions & 31 deletions .github/workflows/build-wheels-python-dependent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,56 @@ on:
jobs:
triage:
name: ${{ matrix.os }} - ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-15-intel # MacOS x86_64
- macos-latest # MacOS arm64 (M1)
- ubuntu-24.04-arm
- linux-armv7-self-hosted
- Windows
- Linux x86_64
- macOS Intel
- macOS ARM
- Linux ARM64
- Linux ARMv7
include:
- os: Windows
runner: windows-latest
- os: Linux x86_64
runner: ubuntu-latest
- os: macOS Intel
runner: macos-15-intel
- os: macOS ARM
runner: macos-latest
- os: Linux ARM64
runner: ubuntu-24.04-arm
- os: Linux ARMv7
runner: linux-armv7-self-hosted # Self-hosted ARMv7 runner
python-version: ${{ fromJson(inputs.supported_python_versions) }}
exclude:
# Exclude oldest supported Python since it's already built in the platform builds
- python-version: ${{ inputs.oldest_supported_python }}
os: windows-latest
os: Windows
- python-version: ${{ inputs.oldest_supported_python }}
os: ubuntu-latest
os: Linux x86_64
- python-version: ${{ inputs.oldest_supported_python }}
os: macos-15-intel
os: macOS Intel
- python-version: ${{ inputs.oldest_supported_python }}
os: macos-latest
os: macOS ARM
- python-version: ${{ inputs.oldest_supported_python }}
os: ubuntu-24.04-arm
os: Linux ARM64
- python-version: ${{ inputs.oldest_supported_python }}
os: linux-armv7-self-hosted
os: Linux ARMv7

# Use python container on ARM - dynamically constructed with bookworm (Debian 12)
container: ${{matrix.os == 'linux-armv7-self-hosted' && format('python:{0}-bookworm', matrix.python-version) || null}}
container: ${{matrix.os == 'Linux ARMv7' && format('python:{0}-bookworm', matrix.python-version) || null}}

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

- name: Setup Python
# Skip setting python on ARM because of missing compatibility: https://github.com/actions/setup-python/issues/108
if: matrix.os != 'linux-armv7-self-hosted'
if: matrix.os != 'Linux ARMv7'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -67,52 +80,59 @@ jobs:
run: python -m pip install -r build_requirements.txt

- name: Install additional OS dependencies - Ubuntu
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'Linux x86_64'
run: os_dependencies/ubuntu.sh

- name: Install additional OS dependencies - MacOS
if: matrix.os == 'macos-latest' || matrix.os == 'macos-15-intel'
if: matrix.os == 'macOS ARM' || matrix.os == 'macOS Intel'
run: os_dependencies/macos.sh


- name: Install additional OS dependencies - Linux ARM7
if: matrix.os == 'linux-armv7-self-hosted' || matrix.os == 'ubuntu-24.04-arm'
if: matrix.os == 'Linux ARMv7' || matrix.os == 'Linux ARM64'
run: os_dependencies/linux_arm.sh

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dependent_requirements_${{ matrix.os}}
path: dependent_requirements_${{ matrix.os}}
name: dependent_requirements_${{ matrix.runner}}
path: dependent_requirements_${{ matrix.runner}}

- name: Print requirements
if: matrix.os != 'windows-latest'
run: cat dependent_requirements_${{ matrix.os}}/dependent_requirements.txt
if: matrix.os != 'Windows'
run: cat dependent_requirements_${{ matrix.runner}}/dependent_requirements.txt

- name: Print requirements - Windows
if: matrix.os == 'windows-latest'
run: type dependent_requirements_${{ matrix.os}}\\dependent_requirements.txt
if: matrix.os == 'Windows'
run: type dependent_requirements_${{ matrix.runner}}\\dependent_requirements.txt

- name: Build Python dependent wheels for ${{ matrix.python-version }}
if: matrix.os != 'windows-latest'
if: matrix.os != 'Windows'
run: |
# Source Rust environment for self-hosted ARMv7 runner
if [ "${{ matrix.os }}" = "linux-armv7-self-hosted" ]; then
# Source Rust environment for ARMv7
if [ "${{ matrix.os }}" = "Linux ARMv7" ]; then
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
. $HOME/.cargo/env
fi

python build_wheels_from_file.py dependent_requirements_${{ matrix.os}}
# Set ARCHFLAGS for macOS to prevent universal2 wheels
if [ "${{ matrix.os }}" = "macOS ARM" ]; then
export ARCHFLAGS="-arch arm64"
elif [ "${{ matrix.os }}" = "macOS Intel" ]; then
export ARCHFLAGS="-arch x86_64"
fi

python build_wheels_from_file.py dependent_requirements_${{ matrix.runner}}

- name: Build Python dependent wheels for ${{ matrix.python-version }} - Windows
if: matrix.os == 'windows-latest'
run: python build_wheels_from_file.py dependent_requirements_${{ matrix.os}}
if: matrix.os == 'Windows'
run: python build_wheels_from_file.py dependent_requirements_${{ matrix.runner}}


- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-download-directory-${{ matrix.os }}-${{ matrix.python-version }}
name: wheels-download-directory-${{ matrix.runner }}-${{ matrix.python-version }}
if-no-files-found: ignore
path: ./downloaded_wheels
retention-days: 1
Loading
Loading