Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/python-qis-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
release:
types:
- published
pull_request:
# check builds work if qis-compiler build config changes
paths:
- 'qis-compiler/pyproject.toml'
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -95,6 +99,7 @@ jobs:
contents: write
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
if: ${{ github.event_name != 'pull_request' }}
steps:
# note: we can't use if: on the entire job, as if statements are evaluated
# before matrix expansion, so we follow the convention of guppylang and
Expand Down
28 changes: 12 additions & 16 deletions qis-compiler/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ build-backend = "maturin"
[dependency-groups]
dev = [
"guppylang~=0.21.0",
"pytest>=8.4.2",
"pytest-snapshot~=0.9.0",
"cibuildwheel>=2.23.2",
"pytket~=2.9",
"tket",
"tket-exts", # remove after next guppy-internals release
]

[project]
Expand Down Expand Up @@ -82,21 +82,17 @@ cache-keys = [
]

[tool.uv.sources]
tket = { workspace = true }
guppylang = { git = "https://github.com/cqcl/guppylang.git", rev = "025880d648d3", subdirectory = "guppylang" }
guppylang = { git = "https://github.com/cqcl/guppylang.git", rev = "d5b4ca6", subdirectory = "guppylang" }
tket-exts = { workspace = true }

[tool.cibuildwheel]
build = "cp310-*"
build-frontend = "build[uv]"
skip = "*-win32 *-manylinux_i686 *-musllinux*"
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
test-requires = [
"pytest",
"pytest-snapshot",
"guppylang @ git+https://github.com/cqcl/guppylang.git#subdirectory=guppylang@ts/borrow-arrays",
"pytket~=2.9.1",
"tket~=0.12.7",
]

before-test = "uv sync --only-dev --active"
test-command = "pytest -vv {package}"

[tool.cibuildwheel.linux.environment]
Expand Down Expand Up @@ -151,10 +147,11 @@ before-test = '''
# make sure the cache is readable by the host
chmod -R a+rX /host/tmp/ci-cache/hugr-qis
fi
uv sync --only-dev --active
'''
repair-wheel-command = [
'auditwheel repair -w {dest_dir} {wheel}',
'pipx run abi3audit --strict --report {wheel}',
'uvx abi3audit --strict --report {wheel}',
]

[tool.cibuildwheel.macos.environment]
Expand All @@ -171,7 +168,7 @@ before-all = [
]
repair-wheel-command = [
'DYLD_LIBRARY_PATH=/tmp/llvm/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}',
'pipx run abi3audit --strict --report {wheel}',
'uvx abi3audit --strict --report {wheel}',
]

[tool.cibuildwheel.windows.environment]
Expand All @@ -183,8 +180,7 @@ before-all = [
'curl -LO https://github.com/PLC-lang/llvm-package-windows/releases/download/v14.0.6/LLVM-14.0.6-win64.7z',
'7z x LLVM-14.0.6-win64.7z "-oC:\LLVM" -y',
]
before-build = ['pip install delvewheel']
repair-wheel-command = [
'delvewheel repair -w {dest_dir} {wheel}',
'pipx run abi3audit --strict --report {wheel}',
'uvx delvewheel repair -w {dest_dir} {wheel}',
'uvx abi3audit --strict --report {wheel}',
]
7 changes: 6 additions & 1 deletion qis-compiler/python/tests/test_basic_generation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import importlib
import importlib.util

import pytest
from guppylang import guppy
from guppylang.std.builtins import array, exit, panic, result
Expand All @@ -18,7 +21,6 @@
)
from hugr.ops import CFG
from pytest_snapshot.plugin import Snapshot
from pytket._tket.circuit import Circuit
from selene_hugr_qis_compiler import HugrReadError, check_hugr, compile_to_llvm_ir

triples = [
Expand Down Expand Up @@ -58,6 +60,9 @@ def foo() -> None:

def test_unsupported_pytket_ops() -> None:
"""Test the check_hugr function to ensure it flags unsupported pytket ops."""
if importlib.util.find_spec("tket") is None:
pytest.skip("tket not installed; skipping test of unsupported pytket ops")
from pytket._tket.circuit import Circuit

# A pytket circuit with an unsupported op.
circ = Circuit(2).CSXdg(0, 1)
Expand Down
15 changes: 7 additions & 8 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading