#validation #graph #dependencies

depper

Library for basic dependency validation

4 releases (breaking)

0.4.0 Sep 27, 2023
0.3.0 Aug 16, 2022
0.2.0 Aug 16, 2022
0.1.0 Aug 14, 2022

#657 in Algorithms

Download history 3/week @ 2023-12-03 37/week @ 2023-12-10 8/week @ 2023-12-31 17/week @ 2024-01-07 8/week @ 2024-01-14 32/week @ 2024-01-21 20/week @ 2024-01-28 12/week @ 2024-02-04 14/week @ 2024-02-11 50/week @ 2024-02-18 79/week @ 2024-02-25 30/week @ 2024-03-03 17/week @ 2024-03-10 5/week @ 2024-03-17

138 downloads per month
Used in sdl-parser

MIT license

14KB
217 lines

Depper

Library for detecting dependency cycles and finding missing dependencies. It also allows to sort dependencies into tranches, which can be used as a hierarchy dependency resolution. API documentation can be found here.


lib.rs:

githubcrates-iodocs-rs


Library for detecting dependency cycles and finding missing dependencies. It also allows to sort dependencies into tranches, which can be used as a hierarchy dependency resolution.


Details

  • It exposes two structs DependencyBuilder and Dependencies. First is for building up the list of dependencies and building (calling the .build() function also validates the entire list) the second struct. Second is for generating tranches of dependencies for deployment hierarchies.

    use depper::Dependencies;
    
    let mut dependencies_builder = Dependencies::builder()
      .add_element("b".to_string(), vec!["d".to_string()])
      .add_element("c".to_string(), vec!["d".to_string()])
      .add_element("a".to_string(), vec!["d".to_string(), "e".to_string(), "y".to_string()])
      .add_element("d".to_string(), vec!["e".to_string()])
      .add_element("e".to_string(), vec![])
      .add_element("y".to_string(), vec![]);
      
    // Calling the `.build()` function validates the list of dependencies.
    let dependencies = dependencies_builder.build().unwrap();
     
    // The `.tranches()` function returns a list of tranches.
    println!("{:?}", dependencies.generate_tranches().unwrap());
    
    [["e", "y"], ["d"], ["b", "c", "a"]]
    

Dependencies

~2.5MB
~46K SLoC