Skip to content

Commit 3abd80c

Browse files
authored
chore: update HUGR version and re-enable downloading the HUGR Package (#290)
1 parent facc8f1 commit 3abd80c

File tree

6 files changed

+174
-137
lines changed

6 files changed

+174
-137
lines changed

DEPENDENCIES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
| `websockets` | `>11, <16` | An implementation of the WebSocket Protocol (RFC 6455 & 7692) | [https://pypi.org/project/websockets/](https://pypi.org/project/websockets/) |
1414
| `pydantic-settings` | `>=2, <3.0` | Settings management using Pydantic | [https://pypi.org/project/pydantic-settings/](https://pypi.org/project/pydantic-settings/) |
1515
| `quantinuum-schemas` | `>=7.3, <8.0` | Shared data models for Quantinuum. | [https://github.com/CQCL/quantinuum-schemas](https://github.com/CQCL/quantinuum-schemas) |
16-
| `hugr` | `>=0.12.5, <1.0.0` | Quantinuum's common representation for quantum programs | [https://github.com/CQCL/hugr/tree/main/hugr-py](https://github.com/CQCL/hugr/tree/main/hugr-py) |
16+
| `hugr` | `>=0.14.0, <1.0.0` | Quantinuum's common representation for quantum programs | [https://github.com/CQCL/hugr/tree/main/hugr-py](https://github.com/CQCL/hugr/tree/main/hugr-py) |

integration/test_hugr.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
from typing import Callable, ContextManager
44

5-
import pytest
65
from hugr.package import Package
76

87
import qnexus as qnx
9-
import qnexus.exceptions as qnx_exc
108
from qnexus.models.annotations import PropertiesDict
119
from qnexus.models.references import HUGRRef, ProjectRef, Ref
1210

@@ -56,11 +54,12 @@ def test_hugr_download(
5654
hugr_name,
5755
qa_hugr_package,
5856
) as hugr_ref:
59-
with pytest.raises(qnx_exc.ResourceFetchFailed):
60-
# Temporarily disabled due to missing functionality in hugr
61-
downloaded_hugr_package = hugr_ref.download_hugr()
62-
assert isinstance(downloaded_hugr_package, Package)
63-
assert qa_hugr_package == downloaded_hugr_package
57+
# Temporarily disabled due to missing functionality in hugr
58+
downloaded_hugr_package = hugr_ref.download_hugr()
59+
assert isinstance(downloaded_hugr_package, Package)
60+
# Direct equality comparison not supported
61+
assert qa_hugr_package.to_bytes() == downloaded_hugr_package.to_bytes()
62+
6463
downloaded_hugr_bytes = hugr_ref.download_hugr_bytes()
6564
assert isinstance(downloaded_hugr_bytes, bytes)
6665
assert qa_hugr_package.to_bytes() == downloaded_hugr_bytes

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies = [
2222
"websockets >11, <16",
2323
"pydantic-settings >=2, <3.0",
2424
"quantinuum-schemas>=7.3, <8.0",
25-
"hugr >=0.12.5, <1.0.0",
25+
"hugr >=0.14.0, <1.0.0",
2626
]
2727

2828
[project.optional-dependencies]

qnexus/client/hugr.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,6 @@ def _fetch_hugr_package(
338338
"""Utility method for fetching a HUGR Package from a HUGRRef."""
339339

340340
hugr_bytes = _fetch_hugr_bytes(handle=handle, scope=scope)
341-
342-
raise qnx_exc.ResourceFetchFailed(
343-
message="Converting to HUGR Package is currently unavailable.",
344-
status_code=400,
345-
)
346341
return Package.from_bytes(envelope=hugr_bytes)
347342

348343

tests/data/example.hugr

-31.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)