From ff75a2f193d337fc05df5f9c92afac8b8dc15ee9 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Thu, 12 Dec 2024 12:23:42 +0000 Subject: [PATCH] refactor(cli)!: remove deprecations (#1777) BREAKING CHANGE: Deprecated `Package` re-export from hugr-cli removed. BREAKING CHANGE: Deprecated `HugrArgs::get_package` removed. --- hugr-cli/src/lib.rs | 18 +----------------- hugr-cli/tests/validate.rs | 3 ++- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/hugr-cli/src/lib.rs b/hugr-cli/src/lib.rs index 9ce393bb3..bfe8410c8 100644 --- a/hugr-cli/src/lib.rs +++ b/hugr-cli/src/lib.rs @@ -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)] @@ -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 { - let val: serde_json::Value = serde_json::from_reader(&mut self.input)?; - let pkg = serde_json::from_value::(val.clone())?; - Ok(pkg) - } } /// Load a package or hugr from a seekable input. diff --git a/hugr-cli/tests/validate.rs b/hugr-cli/tests/validate.rs index 54a8fa57d..303853392 100644 --- a/hugr-cli/tests/validate.rs +++ b/hugr-cli/tests/validate.rs @@ -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}, @@ -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};