Skip to content

Commit

Permalink
Reimplement import graph
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter554 committed Jan 21, 2025
1 parent fcd5c2f commit 939d292
Show file tree
Hide file tree
Showing 14 changed files with 1,057 additions and 3,416 deletions.
174 changes: 164 additions & 10 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ log = "0.4.19"
pyo3-log = "0.12.1"
serde_json = "1.0.103"
rayon = "1.10"
petgraph = "0.6.5"
bimap = "0.6.3"
rustc-hash = "2.1.0"
slotmap = "1.0.7"
getset = "0.1.3"
derive-new = "0.7.0"
lazy_static = "1.5.0"
pathfinding = "4.13.1"
string-interner = "0.18.0"
thiserror = "2.0.11"
itertools = "0.14.0"

[dependencies.pyo3]
version = "0.23.4"
Expand Down
17 changes: 17 additions & 0 deletions rust/src/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use crate::exceptions::ModuleNotPresent;
use pyo3::PyErr;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum GrimpError {
#[error("\"{0}\" not present in the graph")]
ModuleNotPresent(String),
}

impl From<GrimpError> for PyErr {
fn from(value: GrimpError) -> Self {
match value {
GrimpError::ModuleNotPresent(_) => ModuleNotPresent::new_err(value.to_string()),
}
}
}
3 changes: 3 additions & 0 deletions rust/src/exceptions.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
use pyo3::create_exception;

create_exception!(_rustgrimp, ModuleNotPresent, pyo3::exceptions::PyException);
Loading

0 comments on commit 939d292

Please sign in to comment.