Skip to content

Commit 439c66f

Browse files
authored
Improvements to condarc search and parsing (#95)
1 parent 398e32a commit 439c66f

File tree

17 files changed

+455
-174
lines changed

17 files changed

+455
-174
lines changed

Cargo.lock

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/pet-conda/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ log = "0.4.21"
1717
regex = "1.10.4"
1818
pet-reporter = { path = "../pet-reporter" }
1919
env_logger = "0.10.2"
20+
yaml-rust2 = "0.8.1"
2021

2122
[features]
22-
ci = []
23+
ci = []

crates/pet-conda/src/conda_info.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ pub struct CondaInfo {
1212
pub conda_prefix: PathBuf,
1313
pub conda_version: String,
1414
pub envs_dirs: Vec<PathBuf>,
15+
pub envs_path: Vec<PathBuf>,
16+
pub config_files: Vec<PathBuf>,
17+
pub rc_path: Option<PathBuf>,
18+
pub sys_rc_path: Option<PathBuf>,
19+
pub user_rc_path: Option<PathBuf>,
1520
}
1621

1722
#[derive(Debug, serde::Deserialize)]
@@ -20,6 +25,11 @@ pub struct CondaInfoJson {
2025
pub conda_prefix: Option<PathBuf>,
2126
pub conda_version: Option<String>,
2227
pub envs_dirs: Option<Vec<PathBuf>>,
28+
pub envs_path: Option<Vec<PathBuf>>,
29+
pub config_files: Option<Vec<PathBuf>>,
30+
pub rc_path: Option<PathBuf>,
31+
pub user_rc_path: Option<PathBuf>,
32+
pub sys_rc_path: Option<PathBuf>,
2333
}
2434

2535
impl CondaInfo {
@@ -48,8 +58,17 @@ impl CondaInfo {
4858
executable: executable.clone(),
4959
envs: info.envs.unwrap_or_default().drain(..).collect(),
5060
conda_prefix: info.conda_prefix.unwrap_or_default(),
61+
rc_path: info.rc_path,
62+
sys_rc_path: info.sys_rc_path,
63+
user_rc_path: info.user_rc_path,
5164
conda_version: info.conda_version.unwrap_or_default(),
5265
envs_dirs: info.envs_dirs.unwrap_or_default().drain(..).collect(),
66+
envs_path: info.envs_path.unwrap_or_default().drain(..).collect(),
67+
config_files: info
68+
.config_files
69+
.unwrap_or_default()
70+
.drain(..)
71+
.collect(),
5372
};
5473
Some(info)
5574
}

0 commit comments

Comments
 (0)