Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ karva_runner = { path = "crates/karva_runner" }
karva_snapshot = { path = "crates/karva_snapshot" }
karva_static = { path = "crates/karva_static" }
karva_test_semantic = { path = "crates/karva_test_semantic" }
karva_version = { path = "crates/karva_version" }
karva_worker = { path = "crates/karva_worker" }

anyhow = { version = "1.0.102" }
Expand Down
1 change: 1 addition & 0 deletions crates/karva/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ karva_python_semantic = { workspace = true }
karva_runner = { workspace = true }
karva_snapshot = { workspace = true }
karva_static = { workspace = true }
karva_version = { workspace = true }

anyhow = { workspace = true }
argfile = { workspace = true }
Expand Down
6 changes: 1 addition & 5 deletions crates/karva/src/commands/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ use karva_logging::Printer;

pub fn version() -> Result<()> {
let mut stdout = Printer::default().stream_for_requested_summary().lock();
if let Some(version_info) = crate::version::version() {
writeln!(stdout, "karva {}", &version_info)?;
} else {
writeln!(stdout, "Failed to get karva version")?;
}
writeln!(stdout, "karva {}", karva_version::version())?;

Ok(())
}
1 change: 0 additions & 1 deletion crates/karva/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use karva_cli::{Args, Command};

mod commands;
mod utils;
mod version;

pub fn karva_main(f: impl FnOnce(Vec<OsString>) -> Vec<OsString>) -> ExitStatus {
run(f).unwrap_or_else(|error| {
Expand Down
19 changes: 0 additions & 19 deletions crates/karva/src/version.rs

This file was deleted.

1 change: 1 addition & 0 deletions crates/karva_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ license.workspace = true
[dependencies]
karva_logging = { workspace = true }
karva_metadata = { workspace = true }
karva_version = { workspace = true }

camino = { workspace = true }
clap = { workspace = true, features = ["wrap_help", "string", "env"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/karva_cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Verbosity {

#[derive(Debug, Parser)]
#[command(author, name = "karva", about = "A Python test runner.")]
#[command(version)]
#[command(version = karva_version::version())]
#[command(styles = STYLES)]
pub struct Args {
#[command(subcommand)]
Expand Down
15 changes: 15 additions & 0 deletions crates/karva_version/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "karva_version"
version = "0.0.1-alpha.4"
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
documentation.workspace = true
repository.workspace = true
authors.workspace = true
license.workspace = true

[dependencies]

[lints]
workspace = true
16 changes: 16 additions & 0 deletions crates/karva_version/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// Return the application version.
///
/// This should be in sync with the release version based on the crate version.
pub fn version() -> &'static str {
env!("CARGO_PKG_VERSION")
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_get_version() {
assert_eq!(version().to_string(), env!("CARGO_PKG_VERSION").to_string());
}
}
1 change: 1 addition & 0 deletions seal.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ current-version = "0.0.1-alpha.4"
version-files = [
"README.md",
"crates/karva/Cargo.toml",
"crates/karva_version/Cargo.toml",
"crates/karva_python/Cargo.toml",
"pyproject.toml",
"python/karva/__init__.py",
Expand Down
Loading