Skip to content

Commit 637b1e4

Browse files
committed
feat: Added other supported architectures - delvewheel, delocate packages
1 parent 4ab9c55 commit 637b1e4

File tree

8 files changed

+309
-107
lines changed

8 files changed

+309
-107
lines changed

.github/workflows/build-wheels-defined.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ jobs:
157157
run: os_dependencies/macos.sh
158158

159159
- name: Build wheels
160+
env:
161+
ARCHFLAGS: "-arch x86_64" # Force x86_64-only wheels, not universal2
160162
run: |
161163
python build_wheels_from_file.py --requirements ${{ inputs.packages }}
162164
@@ -207,6 +209,8 @@ jobs:
207209
run: os_dependencies/macos.sh
208210

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

.github/workflows/build-wheels-platforms.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ jobs:
114114
. $HOME/.cargo/env
115115
fi
116116
117+
# Set ARCHFLAGS for macOS to prevent universal2 wheels
118+
if [ "${{ matrix.os }}" = "macOS ARM" ]; then
119+
export ARCHFLAGS="-arch arm64"
120+
elif [ "${{ matrix.os }}" = "macOS Intel" ]; then
121+
export ARCHFLAGS="-arch x86_64"
122+
fi
123+
117124
python build_wheels.py
118125
119126
- name: Build wheels for IDF - Windows
@@ -143,11 +150,11 @@ jobs:
143150
supported_python_versions: ${{ needs.get-supported-versions.outputs.supported_python }}
144151
oldest_supported_python: ${{ needs.get-supported-versions.outputs.oldest_supported_python }}
145152

146-
# Repair Linux wheels with auditwheel for manylinux compatibility
147-
repair-manylinux-wheels:
153+
# Repair wheels for all platforms (Windows, macOS, Linux)
154+
repair-wheels:
148155
needs: [build-wheels, build-python-version-dependent-wheels]
149-
name: Repair manylinux wheels
150-
uses: ./.github/workflows/manylinux-repair.yml
156+
name: Repair wheels
157+
uses: ./.github/workflows/wheels-repair.yml
151158

152159
# TODO Uncomment this when we are ready to upload the wheels
153160
#upload-python-wheels:

.github/workflows/build-wheels-python-dependent.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ jobs:
115115
. $HOME/.cargo/env
116116
fi
117117
118+
# Set ARCHFLAGS for macOS to prevent universal2 wheels
119+
if [ "${{ matrix.os }}" = "macOS ARM" ]; then
120+
export ARCHFLAGS="-arch arm64"
121+
elif [ "${{ matrix.os }}" = "macOS Intel" ]; then
122+
export ARCHFLAGS="-arch x86_64"
123+
fi
124+
118125
python build_wheels_from_file.py dependent_requirements_${{ matrix.runner}}
119126
120127
- name: Build Python dependent wheels for ${{ matrix.python-version }} - Windows

.github/workflows/manylinux-repair.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: repair-wheels
2+
3+
# Repairs wheels for all platforms (Windows, macOS, Linux)
4+
# - Windows: delvewheel (bundles DLLs)
5+
# - macOS: delocate (bundles dylibs)
6+
# - Linux: auditwheel (bundles SOs)
7+
8+
on:
9+
workflow_call:
10+
11+
jobs:
12+
repair-wheels:
13+
name: Repair ${{ matrix.platform }} wheels
14+
runs-on: ${{ matrix.runner }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
platform:
19+
- Windows
20+
- macOS ARM
21+
- macOS Intel
22+
- Linux x86_64
23+
- Linux ARM64
24+
- Linux ARMv7
25+
include:
26+
- platform: Windows
27+
runner: windows-latest
28+
tool: delvewheel
29+
- platform: macOS ARM
30+
runner: macos-latest
31+
tool: delocate
32+
- platform: macOS Intel
33+
runner: macos-15-intel
34+
tool: delocate
35+
- platform: Linux x86_64
36+
runner: ubuntu-latest
37+
tool: auditwheel
38+
manylinux_platform: manylinux_2_34_x86_64
39+
- platform: Linux ARM64
40+
runner: ubuntu-latest
41+
tool: auditwheel
42+
manylinux_platform: manylinux_2_34_aarch64
43+
setup_qemu: true
44+
qemu_platform: arm64
45+
- platform: Linux ARMv7
46+
runner: ubuntu-latest
47+
tool: auditwheel
48+
manylinux_platform: manylinux_2_34_armv7l
49+
setup_qemu: true
50+
qemu_platform: arm/v7
51+
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
56+
- name: Download wheel artifacts
57+
uses: actions/download-artifact@v4
58+
with:
59+
pattern: wheels-download-directory-*
60+
path: ./downloaded_wheels
61+
merge-multiple: true
62+
63+
- name: Setup Python
64+
uses: actions/setup-python@v5
65+
with:
66+
python-version: '3.11'
67+
68+
- name: Set up QEMU
69+
if: matrix.setup_qemu
70+
uses: docker/setup-qemu-action@v3
71+
with:
72+
platforms: ${{ matrix.qemu_platform }}
73+
74+
- name: Install repair tool - Windows
75+
if: matrix.tool == 'delvewheel'
76+
run: python -m pip install delvewheel
77+
78+
- name: Install repair tool - macOS
79+
if: matrix.tool == 'delocate'
80+
run: python -m pip install delocate
81+
82+
- name: Install OS dependencies - macOS
83+
if: matrix.tool == 'delocate'
84+
run: bash os_dependencies/macos.sh
85+
86+
- name: Install dependencies and repair - Windows/macOS
87+
if: matrix.tool != 'auditwheel'
88+
run: |
89+
python -m pip install -r build_requirements.txt
90+
python repair_wheels.py
91+
92+
- name: Repair Linux wheels in manylinux container
93+
if: matrix.tool == 'auditwheel'
94+
run: |
95+
docker run --rm \
96+
-v $(pwd):/work \
97+
-w /work \
98+
quay.io/pypa/${{ matrix.manylinux_platform }} \
99+
bash -c "
100+
# Install OS dependencies
101+
bash os_dependencies/manylinux.sh
102+
103+
# Install pip if not available
104+
python3 -m ensurepip --default-pip || curl -sS https://bootstrap.pypa.io/get-pip.py | python3
105+
python3 -m pip install --upgrade pip
106+
107+
# Install Python build requirements (ignore system packages to avoid conflicts)
108+
python3 -m pip install --ignore-installed -r build_requirements.txt
109+
110+
# Repair wheels
111+
python3 repair_wheels.py
112+
"
113+
114+
- name: Re-upload artifacts with repaired wheels
115+
uses: actions/upload-artifact@v4
116+
with:
117+
name: wheels-repaired-${{ matrix.platform }}
118+
path: ./downloaded_wheels
119+
overwrite: true
120+
retention-days: 1

os_dependencies/macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
arch=$(uname -m)
44

55
# PyGObject needs build dependecies https://pygobject.readthedocs.io/en/latest/getting_started.html
6-
brew install pygobject3 gtk4
6+
brew install pygobject3 gtk4 gobject-introspection
77

88

99
# Only MacOS x86_64 additional dependencies

os_dependencies/manylinux.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ yum install -y \
2222
openjpeg2-devel \
2323
fribidi-devel \
2424
harfbuzz-devel \
25-
libxcb-devel
25+
libxcb-devel \
26+
libXau-devel \
27+
brotli \
28+
brotli-devel
2629

2730
# Additional libraries that wheels might depend on
2831
yum install -y \
2932
gcc \
3033
gcc-c++ \
31-
make \
32-
brotli-devel
34+
make

0 commit comments

Comments
 (0)