Skip to content

refactor!: Remove deprecated reexports and leave custom import errors#1886

Merged
maximilianruesch merged 6 commits into
mainfrom
mr/refactor/deprecated-reexports
Jun 19, 2026
Merged

refactor!: Remove deprecated reexports and leave custom import errors#1886
maximilianruesch merged 6 commits into
mainfrom
mr/refactor/deprecated-reexports

Conversation

@maximilianruesch

@maximilianruesch maximilianruesch commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Removes deprecated reexports, leaving custom import errors as a convenience for migration. Also adds a test for those. We can remove this custom infrastructure once this change has been released for a couple of iterations of Guppy v1.

BREAKING CHANGE: Various symbols are not importable from reexports in guppylang.std.quantum_functional or guppylang.std.builtins anymore and can be imported from their appropriate varying paths.

Closes #1019

@hugrbot

hugrbot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

This PR contains breaking changes to the public Python API.

Breaking changes summary
guppylang/src/guppylang/std/builtins.py:110: ArrayIter:
Public object points to a different kind of object:
Old: class
New: attribute

guppylang/src/guppylang/std/builtins.py:111: FrozenarrayIter:
Public object points to a different kind of object:
Old: class
New: attribute

guppylang/src/guppylang/std/builtins.py:108: Range:
Public object points to a different kind of object:
Old: class
New: attribute

guppylang/src/guppylang/std/builtins.py:109: SizedIter:
Public object points to a different kind of object:
Old: class
New: attribute

guppylang/src/guppylang/std/builtins.py:100: mem_swap:
Public object points to a different kind of object:
Old: function
New: attribute

guppylang/src/guppylang/std/builtins.py:101: bytecast_float_to_nat:
Public object points to a different kind of object:
Old: function
New: attribute

guppylang/src/guppylang/std/builtins.py:104: bytecast_nat_to_float:
Public object points to a different kind of object:
Old: function
New: attribute

guppylang/src/guppylang/std/builtins.py:107: barrier:
Public object points to a different kind of object:
Old: function
New: attribute

guppylang/src/guppylang/std/quantum_functional.py:0: ch:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: crz:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: cx:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: cy:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: cz:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: h:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: project_z:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: reset:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: rx:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: ry:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: rz:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: s:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: sdg:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: t:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: tdg:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: toffoli:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: v:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: vdg:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: x:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: y:
Public object was removed

guppylang/src/guppylang/std/quantum_functional.py:0: z:
Public object was removed


@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchmr/refactor/deprecated-reexports
TestbedLinux
Click to view all benchmark results
Benchmarkhugr_bytesBenchmark Result
bytes x 1e3
(Result Δ%)
Upper Boundary
bytes x 1e3
(Limit %)
hugr_nodesBenchmark Result
nodes
(Result Δ%)
Upper Boundary
nodes
(Limit %)
tests/benchmarks/test_big_array.py::test_big_array_compile📈 view plot
🚷 view threshold
154.02 x 1e3
(0.00%)Baseline: 154.02 x 1e3
155.56 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
6,630.00
(0.00%)Baseline: 6,630.00
6,696.30
(99.01%)
tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile📈 view plot
🚷 view threshold
27.71 x 1e3
(0.00%)Baseline: 27.71 x 1e3
27.99 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
1,051.00
(0.00%)Baseline: 1,051.00
1,061.51
(99.01%)
tests/benchmarks/test_queue_push_pop.py::test_queue_push_benchmark_compile📈 view plot
🚷 view threshold
10.09 x 1e3
(0.00%)Baseline: 10.09 x 1e3
10.19 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
301.00
(0.00%)Baseline: 301.00
304.01
(99.01%)
tests/benchmarks/test_queue_push_pop.py::test_queue_push_pop_benchmark_compile📈 view plot
🚷 view threshold
13.70 x 1e3
(0.00%)Baseline: 13.70 x 1e3
13.83 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
420.00
(0.00%)Baseline: 420.00
424.20
(99.01%)
🐰 View full continuous benchmarking report in Bencher

@codecov-commenter

codecov-commenter commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.85%. Comparing base (487a8ac) to head (14c472e).

Files with missing lines Patch % Lines
...als/src/guppylang_internals/std/_internal/moved.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1886   +/-   ##
=======================================
  Coverage   92.84%   92.85%           
=======================================
  Files         146      148    +2     
  Lines       13822    13849   +27     
=======================================
+ Hits        12833    12859   +26     
- Misses        989      990    +1     

☔ View full report in Codecov by Harness.
📢 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.

@maximilianruesch maximilianruesch changed the title refactor!: Remove deprecated reexports and leave a custom import error refactor!: Remove deprecated reexports and leave custom import errors Jun 18, 2026
@maximilianruesch maximilianruesch requested a review from ss2165 June 18, 2026 17:07
@maximilianruesch maximilianruesch marked this pull request as ready for review June 18, 2026 17:07
@maximilianruesch maximilianruesch requested a review from a team as a code owner June 18, 2026 17:07
@codspeed-hq

codspeed-hq Bot commented Jun 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 11 untouched benchmarks


Comparing mr/refactor/deprecated-reexports (14c472e) with main (487a8ac)

Open in CodSpeed

@ss2165 ss2165 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think we should remove the moved symbols from all now

@maximilianruesch

maximilianruesch commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

Nice! I think we should remove the moved symbols from all now

Fair point, that gives another mode of warning through type checkers.

@maximilianruesch

Copy link
Copy Markdown
Collaborator Author

Also I forgot to nuke PriorityQueue from guppylang.std.collections.stack. Will do both.

@maximilianruesch maximilianruesch requested a review from ss2165 June 19, 2026 08:46

@ss2165 ss2165 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@maximilianruesch maximilianruesch added this pull request to the merge queue Jun 19, 2026
Merged via the queue into main with commit 3c19192 Jun 19, 2026
12 checks passed
@maximilianruesch maximilianruesch deleted the mr/refactor/deprecated-reexports branch June 19, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove deprecated standard library reexports

4 participants