Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Petgraph dependency version #1350

Open
chingiztob opened this issue Jan 1, 2025 · 1 comment · May be fixed by #1351
Open

Petgraph dependency version #1350

chingiztob opened this issue Jan 1, 2025 · 1 comment · May be fixed by #1351
Labels
dependencies Pull requests that update a dependency file

Comments

@chingiztob
Copy link

Description

The rustworkx depends on petgraph version 0.6.5, but the release of petgraph 0.7.0 causes a version mismatch in the dependency graph. This leads to compilation errors like:

error[E0277]: the trait bound `petgraph::Graph<graph::GraphNode, graph::GraphEdge>: rustworkx_core::petgraph::visit::GraphBase` is not satisfied
   --> cascade-core/src/streets.rs:60:29
    |
60  |     let largest_component = connected_components(&graph)
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rustworkx_core::petgraph::visit::GraphBase` is not implemented for `petgraph::Graph<graph::GraphNode, graph::GraphEdge>`, which is required by `&petgraph::Graph<graph::GraphNode, graph::GraphEdge>: rustworkx_core::petgraph::visit::GraphBase`
    |
help: there are multiple different versions of crate `petgraph` in the dependency graph
   --> cascade-core/src/algo/dijkstra.rs:12:5
    |
12  | use petgraph::graph::NodeIndex;
    |     ^^^^^^^^ one version of crate `petgraph` is used here, as a direct dependency of the current crate
    |
   ::: cascade-core/src/streets.rs:6:5
    |
6   | use rustworkx_core::connectivity::connected_components;
    |     ^^^^^^^^^^^^^^ one version of crate `petgraph` is used here, as a dependency of crate `rustworkx_core`
note: two types coming from two different versions of the same crate are different types even if they look the same

What is the expected enhancement?

Bump petgraph to 0.7.0

@IvanIsCoding
Copy link
Collaborator

We can bump petgraph in the next release of rustworkx-core.

In the meantime, you should still be able to compile your code if you use the petgraph we re-export: https://docs.rs/rustworkx-core/0.15.1/rustworkx_core/#reexports

@IvanIsCoding IvanIsCoding added the dependencies Pull requests that update a dependency file label Jan 1, 2025
@IvanIsCoding IvanIsCoding linked a pull request Jan 1, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants