Skip to content

Commit

Permalink
feat: Make tracing-subscriber a dependency of pywr-cli only.
Browse files Browse the repository at this point in the history
Move the setup_tracing function to the CLI crate. Addresses
part of isssue #41.
  • Loading branch information
jetuk committed Feb 18, 2024
1 parent 0d53c1e commit 6cb77e2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pywr-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ categories = ["science", "simulation"]
[dependencies]
clap = { version="4.0", features=["derive"] }
anyhow = "1.0.69"

tracing = { workspace = true }
tracing-subscriber = { version ="0.3.17", features=["env-filter"] }
rand = "0.8.5"
rand_chacha = "0.3.1"
time = { workspace = true, features = ["serde", "serde-well-known", "serde-human-readable", "macros"] }
Expand Down
4 changes: 3 additions & 1 deletion pywr-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
mod tracing;

use crate::tracing::setup_tracing;
use anyhow::{Context, Result};
use clap::{Parser, Subcommand, ValueEnum};
#[cfg(feature = "ipm-ocl")]
Expand All @@ -8,7 +11,6 @@ use pywr_core::solvers::{HighsSolver, HighsSolverSettings};
#[cfg(feature = "ipm-simd")]
use pywr_core::solvers::{SimdIpmF64Solver, SimdIpmSolverSettings};
use pywr_core::test_utils::make_random_model;
use pywr_core::tracing::setup_tracing;
use pywr_schema::model::{PywrModel, PywrMultiNetworkModel};
use pywr_schema::ConversionError;
use rand::SeedableRng;
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion pywr-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ ipm-ocl = { path = "../ipm-ocl", optional = true }
ipm-simd = { path = "../ipm-simd", optional = true }
time = { workspace = true, features = ["macros"] }
tracing = { workspace = true }
tracing-subscriber = { version ="0.3.17", features=["env-filter"] }
highs-sys = { git = "https://github.com/jetuk/highs-sys", branch="fix-build-libz-linking", optional = true }
# highs-sys = { path = "../../highs-sys" }
nalgebra = "0.32.3"
Expand Down
1 change: 0 additions & 1 deletion pywr-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub mod solvers;
pub mod state;
pub mod test_utils;
pub mod timestep;
pub mod tracing;
pub mod virtual_storage;

#[derive(Error, Debug, PartialEq, Eq)]
Expand Down

0 comments on commit 6cb77e2

Please sign in to comment.