Skip to content

Commit

Permalink
chore: Drop viz_hugr test utils. (#1789)
Browse files Browse the repository at this point in the history
The method is not used that much, and its dependency `webbrowser` caused
a transitive dependency on `home` for linux targets, which started
requiring `rust 1.81` recently.

This fixes the errors seen on CI:
https://github.com/CQCL/hugr/actions/runs/12371264488/job/34526993767?pr=1788#step:7:308

drive-by: Use `cargo-machete` to find and cleanup other unused
dependencies
  • Loading branch information
aborgna-q authored Dec 17, 2024
1 parent 3337aac commit 1d11d3c
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 25 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ strum = "0.26.1"
strum_macros = "0.26.1"
thiserror = "2.0.6"
typetag = "0.2.7"
urlencoding = "2.1.2"
webbrowser = "1.0.0"
clap = { version = "4.5.4" }
clio = "0.3.5"
clap-verbosity-flag = "3.0.1"
Expand Down
2 changes: 0 additions & 2 deletions hugr-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ clap-verbosity-flag.workspace = true
derive_more = { workspace = true, features = ["display", "error", "from"] }
hugr = { path = "../hugr", version = "0.14.0" }
serde_json.workspace = true
serde.workspace = true
thiserror.workspace = true
clio = { workspace = true, features = ["clap-parse"] }

[lints]
Expand Down
2 changes: 0 additions & 2 deletions hugr-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ bumpalo = { workspace = true, features = ["collections"] }

[dev-dependencies]
rstest = { workspace = true }
webbrowser = { workspace = true }
urlencoding = { workspace = true }
cool_asserts = { workspace = true }
insta = { workspace = true, features = ["yaml"] }
jsonschema = { workspace = true }
Expand Down
16 changes: 0 additions & 16 deletions hugr-core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,22 +266,6 @@ pub(crate) mod test {
Hugr,
};

/// Open a browser page to render a dot string graph.
///
/// This can be used directly on the output of `Hugr::dot_string`
#[cfg(not(ci_run))]
pub(crate) fn viz_dotstr(dotstr: impl AsRef<str>) {
let mut base: String = "https://dreampuf.github.io/GraphvizOnline/#".into();
base.push_str(&urlencoding::encode(dotstr.as_ref()));
webbrowser::open(&base).unwrap();
}

/// Open a browser page to render a HugrView's dot string graph.
#[cfg(not(ci_run))]
pub(crate) fn viz_hugr(hugr: &impl HugrView) {
viz_dotstr(hugr.dot_string());
}

/// Check that a hugr just loads and returns a single expected constant.
pub(crate) fn assert_fully_folded(h: &Hugr, expected_value: &Value) {
assert_fully_folded_with(h, |v| v == expected_value)
Expand Down
3 changes: 1 addition & 2 deletions hugr-llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ itertools.workspace = true
delegate.workspace = true
petgraph.workspace = true
lazy_static.workspace = true
downcast-rs.workspace = true
strum.workspace = true

insta = { workspace = true, optional = true }
Expand All @@ -50,4 +49,4 @@ serde = { workspace = true, optional = true }
typetag = { workspace = true, optional = true }

[dev-dependencies]
hugr-llvm = {"path" = ".", features = ["test-utils"]}
hugr-llvm = { "path" = ".", features = ["test-utils"] }
1 change: 0 additions & 1 deletion hugr-passes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ extension_inference = ["hugr-core/extension_inference"]
[dev-dependencies]
rstest = { workspace = true }
proptest = { workspace = true }
proptest-derive = { workspace = true }
proptest-recurse = { version = "0.5.0" }

0 comments on commit 1d11d3c

Please sign in to comment.