1pub mod config;
7pub mod error;
8pub mod path;
9pub mod version;
10
11pub use error::{Error, Result};
12pub use path::{normalize, normalize_for_key, normalize_msys_path, NormalizedPath};
13
14pub const VERSION: &str = env!("CARGO_PKG_VERSION");
20
21#[cfg(test)]
22mod tests {
23 #[test]
27 fn pyproject_version_is_dynamic() {
28 let workspace_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
29 .parent()
30 .expect("crates/ dir")
31 .parent()
32 .expect("workspace root");
33
34 let pyproject = std::fs::read_to_string(workspace_root.join("pyproject.toml"))
35 .expect("failed to read pyproject.toml");
36
37 assert!(
38 pyproject
39 .lines()
40 .any(|line| line.trim().contains("dynamic") && line.contains("version")),
41 "pyproject.toml must use dynamic = [\"version\"] (derived from Cargo.toml)"
42 );
43 assert!(
44 !pyproject.lines().any(|line| {
45 let t = line.trim();
46 t.starts_with("version")
47 && t.contains('=')
48 && t.contains('"')
49 && !t.contains("dynamic")
50 }),
51 "pyproject.toml must not have a hardcoded version field"
52 );
53 }
54}