Skip to content

Commit

Permalink
refactor(cli)!: remove deprecations (#1777)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Deprecated `Package` re-export from hugr-cli removed.
BREAKING CHANGE: Deprecated `HugrArgs::get_package` removed.
  • Loading branch information
ss2165 authored Dec 12, 2024
1 parent 6f035d6 commit ff75a2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
18 changes: 1 addition & 17 deletions hugr-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ pub mod extensions;
pub mod mermaid;
pub mod validate;

// TODO: Deprecated re-export. Remove on a breaking release.
#[doc(inline)]
#[deprecated(since = "0.13.2", note = "Use `hugr::package::Package` instead.")]
pub use hugr::package::Package;
use hugr::package::Package;

/// CLI arguments.
#[derive(Parser, Debug)]
Expand Down Expand Up @@ -135,19 +132,6 @@ impl HugrArgs {
}
}
}

/// Read either a package from the input.
///
/// deprecated: use [HugrArgs::get_package_or_hugr] instead.
#[deprecated(
since = "0.13.2",
note = "Use `HugrArgs::get_package_or_hugr` instead."
)]
pub fn get_package(&mut self) -> Result<Package, CliError> {
let val: serde_json::Value = serde_json::from_reader(&mut self.input)?;
let pkg = serde_json::from_value::<Package>(val.clone())?;
Ok(pkg)
}
}

/// Load a package or hugr from a seekable input.
Expand Down
3 changes: 2 additions & 1 deletion hugr-cli/tests/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use assert_cmd::Command;
use assert_fs::{fixture::FileWriteStr, NamedTempFile};
use hugr::builder::{DFGBuilder, DataflowSubContainer, ModuleBuilder};
use hugr::package::Package;
use hugr::types::Type;
use hugr::{
builder::{Container, Dataflow},
Expand All @@ -15,7 +16,7 @@ use hugr::{
types::Signature,
Hugr,
};
use hugr_cli::{validate::VALID_PRINT, Package};
use hugr_cli::validate::VALID_PRINT;
use predicates::{prelude::*, str::contains};
use rstest::{fixture, rstest};

Expand Down

0 comments on commit ff75a2f

Please sign in to comment.