Skip to content

Commit e48897f

Browse files
authored
✨ Cirrus CI (#192)
With this PR, Apple Silicon wheels are natively built on Cirrus CI and testing is enabled. In addition, Linux ARM wheels are built there. Furthermore, Qiskit now ships Python 3.11 wheels; so testing wheels under that Python is no longer skipped. 🔥 This PR drops `musllinux` wheels since `qiskit` also doesn't provide corresponding wheels. As a result, Qiskit has to be built from source under these systems anyway. Overall, this considerably simplifies the Python wheel setup. Solves #149 Signed-off-by: burgholzer <[email protected]>
1 parent a4e9ff1 commit e48897f

File tree

3 files changed

+63
-34
lines changed

3 files changed

+63
-34
lines changed

Diff for: .cirrus.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
build_and_store_wheels: &BUILD_AND_STORE_WHEELS
2+
install_cibuildwheel_script:
3+
- python -m pip install cibuildwheel==2.11.2
4+
run_cibuildwheel_script:
5+
- cibuildwheel
6+
wheels_artifacts:
7+
path: "wheelhouse/*"
8+
9+
.clone_script: &clone |
10+
if [ -z "$CIRRUS_PR" ]; then
11+
git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
12+
git reset --hard $CIRRUS_CHANGE_IN_REPO
13+
else
14+
git clone --recursive https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
15+
git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
16+
git reset --hard $CIRRUS_CHANGE_IN_REPO
17+
fi
18+
19+
linux_aarch64_task:
20+
name: Build Linux aarch64 wheels.
21+
clone_script: *clone
22+
compute_engine_instance:
23+
image_project: cirrus-images
24+
image: family/docker-builder-arm64
25+
architecture: arm64
26+
platform: linux
27+
cpu: 4
28+
env:
29+
CIBW_SKIP: "*-musllinux_*"
30+
31+
install_pre_requirements_script:
32+
- apt install -y python3-venv python-is-python3
33+
<<: *BUILD_AND_STORE_WHEELS
34+
35+
macos_arm64_task:
36+
name: Build macOS arm64 wheels.
37+
clone_script: *clone
38+
macos_instance:
39+
image: ghcr.io/cirruslabs/macos-monterey-xcode
40+
41+
env:
42+
PATH: /opt/homebrew/opt/[email protected]/bin:$PATH
43+
install_pre_requirements_script:
44+
- brew install [email protected]
45+
- ln -s python3 /opt/homebrew/opt/[email protected]/bin/python
46+
<<: *BUILD_AND_STORE_WHEELS
47+
48+
publish_task:
49+
name: Upload to PyPI
50+
container: { image: "python:3.10-bullseye" }
51+
depends_on: [linux_aarch64, macos_arm64]
52+
only_if: "$CIRRUS_RELEASE != ''"
53+
env:
54+
TWINE_REPOSITORY: pypi
55+
TWINE_USERNAME: __token__
56+
TWINE_PASSWORD: ENCRYPTED[963630b0d5f7e9ad0aba1e51f63d69ecc36ea550ccce3a382cee179da6b286ccc644aebd482f97a919f1f6a1810a0d25]
57+
install_script: pip install twine
58+
publish_script:
59+
- curl -L https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/wheels.zip | tar xvz -C dist
60+
- python -m twine check dist/*
61+
- python -m twine upload dist/*

Diff for: .github/workflows/deploy.yml

+1-33
Original file line numberDiff line numberDiff line change
@@ -14,52 +14,20 @@ concurrency:
1414

1515
jobs:
1616
build_wheels:
17-
name: ${{ matrix.os }}${{ matrix.archname }}${{ matrix.libc }} wheels
17+
name: ${{ matrix.os }} wheels
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
fail-fast: false
2121
matrix:
2222
os: [ubuntu-latest, windows-latest, macos-latest]
23-
arch: [x86_64]
24-
archname: [""]
25-
skip: ["*-musllinux_*"]
26-
libc: [""]
27-
include:
28-
- arch: arm64
29-
archname: "-arm64"
30-
os: macos-latest
31-
- arch: x86_64
32-
os: ubuntu-latest
33-
skip: "*-manylinux_*"
34-
libc: "-musl"
35-
# - arch: aarch64
36-
# archname: "-arm64"
37-
# os: ubuntu-latest
38-
# qemu: true
39-
# - arch: aarch64
40-
# archname: "-arm64"
41-
# os: ubuntu-latest
42-
# qemu: true
43-
# skip: "*-manylinux_*"
44-
# libc: "-musl"
45-
4623
steps:
4724
- uses: actions/checkout@v3
4825
with:
4926
fetch-depth: 0
5027
submodules: recursive
5128
- uses: ilammy/msvc-dev-cmd@v1
52-
# - name: Install QEMU
53-
# uses: docker/setup-qemu-action@v1
54-
# if: matrix.qemu
55-
# with:
56-
# platforms: arm64
5729
- name: Build wheels
5830
uses: pypa/[email protected]
59-
env:
60-
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
61-
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
62-
CIBW_SKIP: ${{ matrix.skip }}
6331
- uses: actions/upload-artifact@v3
6432
with:
6533
path: ./wheelhouse/*.whl

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ include = ["mqt.*"]
7474

7575
[tool.cibuildwheel]
7676
build = "cp3*"
77+
skip = "*-musllinux_*"
7778
archs = "auto64"
78-
test-skip = "cp311-* *-macosx_arm64 *-musllinux* *aarch64"
7979
test-extras = ["test"]
8080
test-command = "python -c \"from mqt import qcec\""
8181
environment = { DEPLOY = "ON" }

0 commit comments

Comments
 (0)