Skip to content

Commit 19d4498

Browse files
committed
feat: Added other supported architectures - delvewheel, delocate packages
1 parent cda6391 commit 19d4498

File tree

5 files changed

+242
-101
lines changed

5 files changed

+242
-101
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ jobs:
143143
supported_python_versions: ${{ needs.get-supported-versions.outputs.supported_python }}
144144
oldest_supported_python: ${{ needs.get-supported-versions.outputs.oldest_supported_python }}
145145

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

152152
# TODO Uncomment this when we are ready to upload the wheels
153153
#upload-python-wheels:

.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

0 commit comments

Comments
 (0)