python_check_updates/parsers/
mod.rs1pub mod conda;
2pub mod lockfiles;
3pub mod pyproject;
4pub mod requirements;
5
6pub use conda::CondaParser;
7pub use lockfiles::LockfileParser;
8pub use pyproject::PyProjectParser;
9pub use requirements::RequirementsParser;
10
11use crate::version::VersionSpec;
12use std::path::PathBuf;
13
14#[derive(Debug, Clone)]
16pub struct Dependency {
17 pub name: String,
19 pub version_spec: VersionSpec,
21 pub source_file: PathBuf,
23 pub line_number: usize,
25 pub original_line: String,
27}
28
29pub trait DependencyParser {
31 fn parse(&self, path: &PathBuf) -> anyhow::Result<Vec<Dependency>>;
33
34 fn can_parse(&self, path: &PathBuf) -> bool;
36}