Skip to content

Commit

Permalink
Cleanup and fixes (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig authored Sep 6, 2024
1 parent 202c526 commit 8a79c63
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion crates/pet-core/src/os_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ impl Environment for EnvironmentApi {
if self.global_search_locations.lock().unwrap().is_empty() {
let mut paths =
env::split_paths(&self.get_env_var("PATH".to_string()).unwrap_or_default())
.into_iter()
.filter(|p| p.exists())
.collect::<Vec<PathBuf>>();
trace!("Env PATH: {:?}", paths);
Expand Down
4 changes: 2 additions & 2 deletions crates/pet-windows-registry/src/environments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn get_registry_pythons_from_key_for_company(
Ok(install_path_key) => {
let env_path: String =
install_path_key.get_value("").ok().unwrap_or_default();
let env_path = norm_case(&PathBuf::from(env_path));
let env_path = norm_case(PathBuf::from(env_path));
if is_windows_app_folder_in_program_files(&env_path) {
trace!(
"Found Python ({}) in {}\\Software\\Python\\{}\\{}, but skipping as this is a Windows Store Python",
Expand Down Expand Up @@ -144,7 +144,7 @@ fn get_registry_pythons_from_key_for_company(
);
continue;
}
let executable = norm_case(&PathBuf::from(executable));
let executable = norm_case(PathBuf::from(executable));
if !executable.exists() {
warn!(
"Python executable ({}) file not found for {}\\Software\\Python\\{}\\{}",
Expand Down
1 change: 1 addition & 0 deletions crates/pet-windows-store/src/environments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ lazy_static! {
}

#[derive(Default)]
#[allow(dead_code)]
struct PotentialPython {
#[allow(dead_code)]
path: Option<PathBuf>,
Expand Down
2 changes: 1 addition & 1 deletion crates/pet-windows-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl Locator for WindowsStore {
}
let list_of_possible_exes = vec![env.executable.clone()]
.into_iter()
.chain(env.symlinks.clone().unwrap_or_default().into_iter())
.chain(env.symlinks.clone().unwrap_or_default())
.collect::<Vec<PathBuf>>();
if let Some(environments) = self.find_with_cache() {
for found_env in environments {
Expand Down
1 change: 1 addition & 0 deletions crates/pet/src/locators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ fn find_symlinks(executable: &PathBuf) -> Option<Vec<PathBuf>> {
}

#[cfg(windows)]
#[allow(clippy::ptr_arg)]
fn find_symlinks(_executable: &PathBuf) -> Option<Vec<PathBuf>> {
// In windows we will need to spawn the Python exe and then get the exes.
// Lets wait and see if this is necessary.
Expand Down

0 comments on commit 8a79c63

Please sign in to comment.