Skip to content

feat: Add ptr extension and cleanup hugr.std module#2842

Merged
aborgna-q merged 1 commit intomainfrom
ab/cleanup-std
Jan 29, 2026
Merged

feat: Add ptr extension and cleanup hugr.std module#2842
aborgna-q merged 1 commit intomainfrom
ab/cleanup-std

Conversation

@aborgna-q
Copy link
Copy Markdown
Collaborator

Adds the missing ptr extension to hugr.std, cleanups the exports, and some other drive-bys:

  • Adds a ExtensionRegistry.from_extensions(Iterable[Extension]) -> Self helper and __contains__ method.
  • Adds a std._std_extensions method listing all extensions. We'll use this for Hugr.to_bytes should include required extensions #2841.
  • Moves the extension loader utility method to hugr.std._util, so we can list the extension submodules in __all__, making them easier to access.

@aborgna-q aborgna-q requested a review from a team as a code owner January 29, 2026 13:19
@aborgna-q aborgna-q requested a review from cqc-alec January 29, 2026 13:19
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 73.58491% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.67%. Comparing base (a21e818) to head (d57dbcc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hugr-py/src/hugr/std/ptr.py 54.16% 11 Missing ⚠️
hugr-py/src/hugr/ext.py 60.00% 2 Missing ⚠️
hugr-py/src/hugr/std/__init__.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2842      +/-   ##
==========================================
- Coverage   83.69%   83.67%   -0.02%     
==========================================
  Files         261      264       +3     
  Lines       53047    53083      +36     
  Branches    47374    47374              
==========================================
+ Hits        44397    44419      +22     
- Misses       6261     6275      +14     
  Partials     2389     2389              
Flag Coverage Δ
python 88.10% <73.58%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aborgna-q aborgna-q added the A-python Area: Python code label Jan 29, 2026
@aborgna-q aborgna-q added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit 0871b82 Jan 29, 2026
29 of 30 checks passed
@aborgna-q aborgna-q deleted the ab/cleanup-std branch January 29, 2026 14:02
cqc-alec pushed a commit that referenced this pull request Feb 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.15.2](hugr-py-v0.15.1...hugr-py-v0.15.2)
(2026-02-06)


### Features

* Add ptr extension and cleanup `hugr.std` module
([#2842](#2842))
([0871b82](0871b82))
* Add s expression format to envelope formats
([#2864](#2864))
([2da5e8e](2da5e8e))
* Auto-embed extensions in stored hugrs
([#2843](#2843))
([36408d4](36408d4))
* Replace pyzstd dependency with rust bindings
([#2846](#2846))
([5047c81](5047c81))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Agustín Borgna <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-python Area: Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants