Skip to content

Commit 1d11d3c

Browse files
authored
chore: Drop viz_hugr test utils. (#1789)
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
1 parent 3337aac commit 1d11d3c

File tree

6 files changed

+1
-25
lines changed

6 files changed

+1
-25
lines changed

Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ strum = "0.26.1"
6161
strum_macros = "0.26.1"
6262
thiserror = "2.0.6"
6363
typetag = "0.2.7"
64-
urlencoding = "2.1.2"
65-
webbrowser = "1.0.0"
6664
clap = { version = "4.5.4" }
6765
clio = "0.3.5"
6866
clap-verbosity-flag = "3.0.1"

hugr-cli/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ clap-verbosity-flag.workspace = true
2121
derive_more = { workspace = true, features = ["display", "error", "from"] }
2222
hugr = { path = "../hugr", version = "0.14.0" }
2323
serde_json.workspace = true
24-
serde.workspace = true
25-
thiserror.workspace = true
2624
clio = { workspace = true, features = ["clap-parse"] }
2725

2826
[lints]

hugr-core/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ bumpalo = { workspace = true, features = ["collections"] }
6060

6161
[dev-dependencies]
6262
rstest = { workspace = true }
63-
webbrowser = { workspace = true }
64-
urlencoding = { workspace = true }
6563
cool_asserts = { workspace = true }
6664
insta = { workspace = true, features = ["yaml"] }
6765
jsonschema = { workspace = true }

hugr-core/src/utils.rs

-16
Original file line numberDiff line numberDiff line change
@@ -266,22 +266,6 @@ pub(crate) mod test {
266266
Hugr,
267267
};
268268

269-
/// Open a browser page to render a dot string graph.
270-
///
271-
/// This can be used directly on the output of `Hugr::dot_string`
272-
#[cfg(not(ci_run))]
273-
pub(crate) fn viz_dotstr(dotstr: impl AsRef<str>) {
274-
let mut base: String = "https://dreampuf.github.io/GraphvizOnline/#".into();
275-
base.push_str(&urlencoding::encode(dotstr.as_ref()));
276-
webbrowser::open(&base).unwrap();
277-
}
278-
279-
/// Open a browser page to render a HugrView's dot string graph.
280-
#[cfg(not(ci_run))]
281-
pub(crate) fn viz_hugr(hugr: &impl HugrView) {
282-
viz_dotstr(hugr.dot_string());
283-
}
284-
285269
/// Check that a hugr just loads and returns a single expected constant.
286270
pub(crate) fn assert_fully_folded(h: &Hugr, expected_value: &Value) {
287271
assert_fully_folded_with(h, |v| v == expected_value)

hugr-llvm/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ itertools.workspace = true
3838
delegate.workspace = true
3939
petgraph.workspace = true
4040
lazy_static.workspace = true
41-
downcast-rs.workspace = true
4241
strum.workspace = true
4342

4443
insta = { workspace = true, optional = true }
@@ -50,4 +49,4 @@ serde = { workspace = true, optional = true }
5049
typetag = { workspace = true, optional = true }
5150

5251
[dev-dependencies]
53-
hugr-llvm = {"path" = ".", features = ["test-utils"]}
52+
hugr-llvm = { "path" = ".", features = ["test-utils"] }

hugr-passes/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@ extension_inference = ["hugr-core/extension_inference"]
3131
[dev-dependencies]
3232
rstest = { workspace = true }
3333
proptest = { workspace = true }
34-
proptest-derive = { workspace = true }
3534
proptest-recurse = { version = "0.5.0" }

0 commit comments

Comments
 (0)