Skip to content

Commit 5cf3fff

Browse files
fix: build wheels in better tailored environments (#532)
1 parent 450831a commit 5cf3fff

File tree

3 files changed

+50
-14
lines changed

3 files changed

+50
-14
lines changed

.github/action-common-python-release/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ inputs:
1919
description: "Additional maturin command arguments"
2020
maturin-target:
2121
description: "Rust target used for maturin compilation"
22+
maturin-container:
23+
description: "Docker container used for maturin compilation"
2224

2325
runs:
2426
using: "composite"
@@ -43,6 +45,7 @@ runs:
4345
manylinux: '2_28'
4446
command: ${{ inputs.maturin-command }}
4547
target: ${{ inputs.maturin-target }}
48+
container: ${{ inputs.maturin-container }}
4649
args: -i 3.8 3.9 3.10 3.11 3.12 --release --manifest-path crates/python/Cargo.toml --out dist ${{ inputs.package-name == 'qcs-sdk-python-grpc-web' && '-F grpc-web' || '' }}
4750
docker-options: -e CI
4851
- if: inputs.maturin-command == 'sdist'
@@ -52,6 +55,7 @@ runs:
5255
manylinux: '2_28'
5356
command: ${{ inputs.maturin-command }}
5457
target: ${{ inputs.maturin-target }}
58+
container: ${{ inputs.maturin-container }}
5559
args: --manifest-path crates/python/Cargo.toml --out dist
5660

5761
# host will not be able to install wheel in this case

.github/workflows/release-python.yml

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,13 @@ jobs:
4343
artifact-key: macos
4444
package-name: ${{ matrix.package-name }}
4545
maturin-target: universal2-apple-darwin
46+
maturin-container: ghcr.io/rust-cross/manylinux_2_28-cross:aarch64
4647

47-
linux:
48+
linux-x86_64:
4849
runs-on: ubuntu-latest
4950
needs: [is-python-release, should-publish-wheels]
5051
env:
5152
CXXFLAGS: "-std=c++11"
52-
strategy:
53-
matrix:
54-
target: [x86_64, aarch64]
5553
steps:
5654
- uses: actions/checkout@v4
5755
- name: Install protoc
@@ -61,18 +59,51 @@ jobs:
6159
version: '3.20.1'
6260
- uses: ./.github/action-common-python-release
6361
with:
64-
artifact-key: linux-${{ matrix.target }}
62+
artifact-key: linux-x86_64
6563
package-name: qcs-sdk-python
66-
maturin-target: ${{ matrix.target }}
64+
maturin-target: x86_64
6765

68-
linux-grpc-web:
66+
linux-aarch64:
67+
runs-on: ubuntu-24.04-arm
68+
needs: [is-python-release, should-publish-wheels]
69+
env:
70+
CXXFLAGS: "-std=c++11"
71+
steps:
72+
- uses: actions/checkout@v4
73+
- name: Install protoc
74+
uses: arduino/setup-protoc@v1
75+
with:
76+
repo-token: ${{ secrets.GITHUB_TOKEN }}
77+
version: '3.20.1'
78+
- uses: ./.github/action-common-python-release
79+
with:
80+
artifact-key: linux-aarch64
81+
package-name: qcs-sdk-python
82+
maturin-target: aarch64
83+
84+
linux-grpc-web-x86_64:
85+
runs-on: ubuntu-latest
86+
needs: [is-python-release, should-publish-wheels]
87+
env:
88+
CXXFLAGS: "-std=c++11"
89+
steps:
90+
- uses: actions/checkout@v4
91+
- name: Install protoc
92+
uses: arduino/setup-protoc@v1
93+
with:
94+
repo-token: ${{ secrets.GITHUB_TOKEN }}
95+
version: '3.20.1'
96+
- uses: ./.github/action-common-python-release
97+
with:
98+
artifact-key: linux-grpc-web-x86_64
99+
package-name: qcs-sdk-python-grpc-web
100+
maturin-target: x86_64
101+
102+
linux-grpc-web-ppc64le:
69103
runs-on: ubuntu-latest
70104
needs: [is-python-release, should-publish-wheels]
71105
env:
72106
CXXFLAGS: "-std=c++11"
73-
strategy:
74-
matrix:
75-
target: [x86_64, ppc64le]
76107
steps:
77108
- uses: actions/checkout@v4
78109
- name: Install protoc
@@ -82,9 +113,10 @@ jobs:
82113
version: '3.20.1'
83114
- uses: ./.github/action-common-python-release
84115
with:
85-
artifact-key: linux-${{ matrix.target }}
116+
artifact-key: linux-grpc-web-ppc64le
86117
package-name: qcs-sdk-python-grpc-web
87-
maturin-target: ${{ matrix.target }}
118+
maturin-target: ppc64le
119+
maturin-container: ghcr.io/rust-cross/manylinux_2_28-cross:ppc64le
88120

89121
windows:
90122
runs-on: windows-latest
@@ -140,7 +172,7 @@ jobs:
140172
# finish, regardless of their outcome. In this case, we
141173
# still make sure that at least a source distribution
142174
# can be published.
143-
needs: [ macos, linux, linux-grpc-web, windows, sdist ]
175+
needs: [ macos, linux-x86_64, linux-aarch64, linux-grpc-web-x86_64, linux-grpc-web-ppc64le, windows, sdist ]
144176
if: always() && needs.sdist.result == 'success'
145177
permissions:
146178
id-token: write

crates/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ classifiers = [
2121
"Operating System :: OS Independent",
2222
]
2323

24-
dependencies = ["quil>=0.11.2", "qcs-api-client-common>=0.10.0"]
24+
dependencies = ["quil>=0.15.2", "qcs-api-client-common>=0.11.8"]
2525

2626
[tool.maturin]
2727
features = ["pyo3/extension-module"]

0 commit comments

Comments
 (0)