Skip to content

Commit 2ac3914

Browse files
authored
Restore MacOS x86 support (#2052)
1 parent 71116c2 commit 2ac3914

File tree

5 files changed

+92
-8
lines changed

5 files changed

+92
-8
lines changed

.github/workflows/build_and_test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
if: needs.check_changes.outputs.tket_or_c_api_changed == 'true'
106106
strategy:
107107
matrix:
108-
os: ['ubuntu-24.04', 'macos-26']
108+
os: ['ubuntu-24.04', 'macos-15-intel', 'macos-26']
109109
runs-on: ${{ matrix.os }}
110110
steps:
111111
- uses: actions/checkout@v5
@@ -355,7 +355,10 @@ jobs:
355355
name: Build and test pytket (macos)
356356
needs: check_changes
357357
if: needs.check_changes.outputs.tket_or_workflow_changed == 'true' || needs.check_changes.outputs.pytket_or_workflow_changed == 'true'
358-
runs-on: macos-26
358+
strategy:
359+
matrix:
360+
os: ['macos-15-intel', 'macos-26']
361+
runs-on: ${{ matrix.os }}
359362
steps:
360363
- uses: actions/checkout@v5
361364
- name: Select Python 3.12
@@ -368,7 +371,7 @@ jobs:
368371
run: |
369372
conan profile detect
370373
DEFAULT_PROFILE_PATH=`conan profile path default`
371-
PROFILE_PATH=./conan-profiles/macos-26
374+
PROFILE_PATH=./conan-profiles/${{ matrix.os }}
372375
diff ${DEFAULT_PROFILE_PATH} ${PROFILE_PATH} || true
373376
cp ${PROFILE_PATH} ${DEFAULT_PROFILE_PATH}
374377
conan remote add tket-libs https://quantinuumsw.jfrog.io/artifactory/api/conan/tket1-libs --index 0

.github/workflows/release.yml

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,46 @@ jobs:
6161
name: Linux_aarch64_3.${{ matrix.python3-version }}_wheel
6262
path: wheelhouse/
6363

64+
build_macos_x86_wheels:
65+
name: Build macos x86 wheels
66+
runs-on: macos-15-intel
67+
strategy:
68+
matrix:
69+
python-version: ['3.10', '3.11', '3.12']
70+
steps:
71+
- uses: actions/checkout@v5
72+
with:
73+
fetch-depth: '0'
74+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
75+
- name: Set up Python ${{ matrix.python-version }}
76+
uses: actions/setup-python@v6
77+
with:
78+
python-version: ${{ matrix.python-version }}
79+
- name: Install conan
80+
uses: turtlebrowser/[email protected]
81+
- name: Set up conan
82+
run: |
83+
conan profile detect
84+
DEFAULT_PROFILE_PATH=`conan profile path default`
85+
PROFILE_PATH=./conan-profiles/macos-15-intel
86+
diff ${DEFAULT_PROFILE_PATH} ${PROFILE_PATH} || true
87+
cp ${PROFILE_PATH} ${DEFAULT_PROFILE_PATH}
88+
conan remote add tket-libs https://quantinuumsw.jfrog.io/artifactory/api/conan/tket1-libs --index 0
89+
- name: Build tket C++
90+
run: conan create tket --user tket --channel stable --build=missing -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True -tf ""
91+
- name: Build wheel
92+
run: |
93+
cd pytket
94+
# Ensure wheels are compatible with MacOS 13.0 and later:
95+
export WHEEL_PLAT_NAME=macosx_13_0_x86_64
96+
pip install -U pip build delocate
97+
TKET_VERSION=`cat ../TKET_VERSION` python -m build
98+
delocate-wheel -v -w "$GITHUB_WORKSPACE/wheelhouse/" "dist/pytket-"*".whl"
99+
- uses: actions/upload-artifact@v4
100+
with:
101+
name: MacOS_x86_${{ matrix.python-version }}_wheel
102+
path: wheelhouse/
103+
64104
build_macos_arm64_wheels:
65105
name: Build macos arm64 wheels
66106
runs-on: macos-26
@@ -217,6 +257,43 @@ jobs:
217257
- name: Run tests
218258
run: cd tket/pytket/tests && pytest --ignore=simulator/
219259

260+
test_macos_x86_wheels:
261+
name: Test macos x86 wheels
262+
needs: build_macos_x86_wheels
263+
strategy:
264+
matrix:
265+
os: ['macos-15-intel']
266+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
267+
runs-on: ${{ matrix.os }}
268+
steps:
269+
- name: Set up Python ${{ matrix.python-version }}
270+
uses: actions/setup-python@v6
271+
with:
272+
python-version: ${{ matrix.python-version }}
273+
- name: Download wheel (non-stable-ABI)
274+
if: matrix.python-version == '3.10' || matrix.python-version == '3.11'
275+
uses: actions/download-artifact@v5
276+
with:
277+
name: MacOS_x86_${{ matrix.python-version }}_wheel
278+
path: wheelhouse/
279+
- name: Download wheel (stable-ABI)
280+
if: matrix.python-version == '3.12' || matrix.python-version == '3.13' || matrix.python-version == '3.14'
281+
uses: actions/download-artifact@v5
282+
with:
283+
name: MacOS_x86_3.12_wheel
284+
path: wheelhouse/
285+
- uses: actions/checkout@v5
286+
with:
287+
path: tket
288+
- name: Install wheel
289+
run: |
290+
pip install $GITHUB_WORKSPACE/wheelhouse/pytket-*.whl
291+
- name: Run tests
292+
run: |
293+
cd tket/pytket/tests
294+
pip install -r requirements.txt
295+
pytest --ignore=simulator/
296+
220297
test_macos_arm64_wheels:
221298
name: Test macos arm64 wheels
222299
needs: build_macos_arm64_wheels
@@ -294,7 +371,7 @@ jobs:
294371
publish_to_pypi:
295372
name: Publish to pypi
296373
if: github.event_name == 'release'
297-
needs: [test_linux_wheels, test_linux_aarch64_wheels, test_macos_arm64_wheels, test_Windows_wheels]
374+
needs: [test_linux_wheels, test_linux_aarch64_wheels, test_macos_x86_wheels, test_macos_arm64_wheels, test_Windows_wheels]
298375
runs-on: ubuntu-latest
299376
environment:
300377
name: release

TKET_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.56
1+
2.1.57

pytket/docs/changelog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# Changelog
22

3-
## Unreleased
3+
## 2.10.2 (October 2025)
44

55
Fixes:
66

77
- Fix `circuit_dict_from_pytket1_dict()` when circuit contains `CustomGate`.
88

9+
General:
10+
11+
- Restore support for MacOS on x86 architecture.
12+
913
## 2.10.1 (October 2025)
1014

1115
Fixes:

pytket/pytket/circuit/decompose_classical.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ def __init__(self) -> None:
5555

5656
def pop(self) -> T:
5757
"""Pop from top of heap."""
58-
return heappop(self._heap)
58+
return heappop(self._heap) # type: ignore
5959

6060
def push(self, var: T) -> None:
6161
"""Push var to heap."""
62-
heappush(self._heap, var)
62+
heappush(self._heap, var) # type: ignore
6363
self._heap_vars.add(var)
6464

6565
def is_heap_var(self, var: T) -> bool:

0 commit comments

Comments
 (0)