Skip to content

feat!: Remove deprecated definitions - #1970

Merged
aborgna-q merged 5 commits into
mainfrom
ab/deprecations-0.22.0
Sep 3, 2026
Merged

aborgna-q merged 5 commits into
mainfrom
ab/deprecations-0.22.0

Conversation

@aborgna-q

@aborgna-q aborgna-q commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

Remove some deprecated definitions in preparation for tket-rs 0.22.0

BREAKING CHANGE: Removed NormalizeGuppy alias for Normalize pass.
BREAKING CHANGE: Removed legacy QSystemOp re-exports in tket-qsystem.
BREAKING CHANGE: Removed CommandsIterator

Not a breaking python change:
BEGIN_COMMIT_OVERRIDE
chore: Remove deprecated definitions in rust library (#1970)
END_COMMIT_OVERRIDE

@aborgna-q
aborgna-q requested a review from a team as a code owner September 3, 2026 16:17
Comment on lines -226 to -230
#[expect(deprecated)]
let phase = match hugr.get_metadata::<metadata::PytketPhaseExpr>(region) {
Some(p) => p.to_string(),
None => "0".to_string(),
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since this is encoded into the Python package, is removing the read for this metadata not breaking to the Python package in a bad way?

@aborgna-q aborgna-q Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We haven't been writing to this this metadata entry in a while.
We moved to exporting standalone GlobalPhase ops, but left the metadata read path in case someone had a pytket circuit encoded as a Hugr flying around that needed to be re-exported.

Those hugrs are are unlikely to be be stored, so we should be fine removing this now.

@codecov

codecov Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.04%. Comparing base (a469213) to head (1663bec).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1970      +/-   ##
==========================================
+ Coverage   86.71%   87.04%   +0.32%     
==========================================
  Files         203      201       -2     
  Lines       33116    32682     -434     
  Branches    31599    31165     -434     
==========================================
- Hits        28717    28447     -270     
+ Misses       3081     2930     -151     
+ Partials     1318     1305      -13     
Flag Coverage Δ
python 91.83% <100.00%> (ø)
qis-compiler 73.63% <ø> (ø)
rust 86.80% <100.00%> (+0.33%) ⬆️

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

☔ 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.

@aborgna-q
aborgna-q enabled auto-merge September 3, 2026 16:38
@hugrbot

hugrbot commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

This PR contains breaking changes to the public Rust API.

cargo-semver-checks summary
    Building tket v0.21.2 (current)
     Built [  47.634s] (current)
   Parsing tket v0.21.2 (current)
    Parsed [   0.129s] (current)
  Building tket v0.21.2 (baseline)
     Built [  46.337s] (baseline)
   Parsing tket v0.21.2 (baseline)
    Parsed [   0.121s] (baseline)
  Checking tket v0.21.2 -> v0.21.2 (assume minor change)
   Checked [   0.150s] 196 checks: 191 pass, 5 fail, 0 warn, 58 skip

--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_missing.ron

Failed in:
enum tket::passes::guppy::NormalizeGuppyErrors, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/passes/normalize.rs:197

--- failure function_missing: pub fn removed or renamed ---

Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_missing.ron

Failed in:
function tket::op_matches, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/ops.rs:248

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/inherent_method_missing.ron

Failed in:
Circuit::commands, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/circuit.rs:324
Circuit::operations, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/circuit.rs:345
Circuit::commands, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/circuit.rs:324
Circuit::operations, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/circuit.rs:345
EncodedCircuit::contains_circuit, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/serialize/pytket/circuit.rs:570
EncodedCircuit::get_circuit, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/serialize/pytket/circuit.rs:579
EncodedCircuit::get_circuit_mut, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/serialize/pytket/circuit.rs:588

--- failure module_missing: pub module removed or renamed ---

Description:
A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/module_missing.ron

Failed in:
mod tket::passes::guppy, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/passes/guppy.rs:1
mod tket::circuit::command, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/circuit/command.rs:1

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/struct_missing.ron

Failed in:
struct tket::circuit::command::CommandIterator, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/circuit/command.rs:238
struct tket::circuit::CommandIterator, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/circuit/command.rs:238
struct tket::metadata::MaxQubitsHint, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/metadata.rs:40
struct tket::circuit::command::Command, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/circuit/command.rs:24
struct tket::circuit::Command, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/circuit/command.rs:24
struct tket::passes::guppy::NormalizeGuppy, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/passes/normalize.rs:23
struct tket::passes::NormalizeGuppy, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/passes/normalize.rs:23

   Summary semver requires new major version: 5 major and 0 minor checks failed
  Finished [  96.540s] tket
  Building tket-qsystem v0.27.2 (current)
     Built [  47.611s] (current)
   Parsing tket-qsystem v0.27.2 (current)
    Parsed [   0.037s] (current)
  Building tket-qsystem v0.27.2 (baseline)
     Built [  48.813s] (baseline)
   Parsing tket-qsystem v0.27.2 (baseline)
    Parsed [   0.037s] (baseline)
  Checking tket-qsystem v0.27.2 -> v0.27.2 (assume minor change)
   Checked [   0.074s] 196 checks: 192 pass, 4 fail, 0 warn, 58 skip

--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_missing.ron

Failed in:
enum tket_qsystem::passes::QSystemPassError, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket-qsystem/src/passes/compat.rs:27
enum tket_qsystem::QSystemPassError, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket-qsystem/src/passes/compat.rs:27
enum tket_qsystem::extension::qsystem::QSystemOp, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket-qsystem/src/extension/qsystem/helios.rs:67

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_variant_missing.ron

Failed in:
variant LowerTk2Error::LegacyQSystemToSolUnsupported, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket-qsystem/src/extension/qsystem/lower.rs:98

--- failure pub_module_level_const_missing: pub module-level const is missing ---

Description:
A public const is missing or renamed
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/pub_module_level_const_missing.ron

Failed in:
RUNTIME_BARRIER_NAME in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket-qsystem/src/extension/qsystem/helios.rs:190

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/struct_missing.ron

Failed in:
struct tket_qsystem::passes::QSystemPass, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket-qsystem/src/passes/compat.rs:97
struct tket_qsystem::QSystemPass, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket-qsystem/src/passes/compat.rs:97
struct tket_qsystem::extension::qsystem::RuntimeBarrierDef, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket-qsystem/src/extension/qsystem/helios.rs:194

   Summary semver requires new major version: 4 major and 0 minor checks failed
  Finished [  97.941s] tket-qsystem

@aborgna-q
aborgna-q added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit 4591422 Sep 3, 2026
27 checks passed
@aborgna-q
aborgna-q deleted the ab/deprecations-0.22.0 branch September 3, 2026 17:07
nrdcid pushed a commit to nrdcid/tket2 that referenced this pull request Sep 28, 2026
## 🤖 New release

* `tket`: 0.21.2 -> 0.22.0 (✓ API compatible changes)
* `tket-qsystem`: 0.27.2 -> 0.28.0 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `tket`

<blockquote>

##
[0.22.0](Quantinuum/tket2@tket-v0.21.2...tket-v0.22.0)
- 2026-09-03

### Bug Fixes

- `wire_inout` port mapping with interleaved classical and quantum wires
under `dagger` modifier
([Quantinuum#1911](Quantinuum#1911))
- Wrong decomposition of `CnZ` gate
([Quantinuum#1948](Quantinuum#1948))

### New Features

- Extract multiple pytket circuits from a hugr region
([Quantinuum#1894](Quantinuum#1894))
- Preserving order edges during (non-dagger) modifier resolution
([Quantinuum#1840](Quantinuum#1840))
- Avoid panicking on badger optimization error
([Quantinuum#1940](Quantinuum#1940))
- Update Modifier pass to handle custom modifier and introduce new
metadata for custom implementation
([Quantinuum#1962](Quantinuum#1962))
- *(rs)* [**breaking**] Update hugr to 0.30.1
([Quantinuum#1965](Quantinuum#1965))
- [**breaking**] Remove deprecated definitions
([Quantinuum#1970](Quantinuum#1970))

### Refactor

- Move borrow array linearizer helper functions to `tket` and make them
public ([Quantinuum#1951](Quantinuum#1951))

### Testing

- Disable failing miri check
([Quantinuum#1922](Quantinuum#1922))
</blockquote>

## `tket-qsystem`

<blockquote>

##
[0.28.0](Quantinuum/tket2@tket-qsystem-v0.27.2...tket-qsystem-v0.28.0)
- 2026-09-03

### New Features

- Extract multiple pytket circuits from a hugr region
([Quantinuum#1894](Quantinuum#1894))
- Add missing tket1 extension to tket_exts
([Quantinuum#1961](Quantinuum#1961))
- *(rs)* [**breaking**] Update hugr to 0.30.1
([Quantinuum#1965](Quantinuum#1965))
- [**breaking**] Remove deprecated definitions
([Quantinuum#1970](Quantinuum#1970))

### Refactor

- Move borrow array linearizer helper functions to `tket` and make them
public ([Quantinuum#1951](Quantinuum#1951))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
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.

3 participants