Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore empty paths in windows registry search #156

Merged
merged 3 commits into from
Oct 1, 2024
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
2 changes: 1 addition & 1 deletion .devcontainer/linux-x64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amd64/ubuntu
FROM amd64/ubuntu:24.04

# Setup Python
RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
run: |
pyenv install --list
pyenv install 3.12.5 3.8.19
pyenv install 3.12.6 3.8.19
shell: bash

# pyenv-win install list has not updated for a while
Expand Down
7 changes: 7 additions & 0 deletions crates/pet-windows-registry/src/environments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ 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();
if env_path.is_empty() {
warn!(
"Install path is empty {}\\Software\\Python\\{}\\{}",
key_container, company, installed_python
);
continue;
}
let env_path = norm_case(PathBuf::from(env_path));
if is_windows_app_folder_in_program_files(&env_path) {
trace!(
Expand Down
8 changes: 4 additions & 4 deletions crates/pet/tests/ci_homebrew_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn verify_python_in_homebrew_contaner() {
let python3_12 = PythonEnvironment {
kind: Some(PythonEnvironmentKind::Homebrew),
executable: Some(PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3")),
version: Some("3.12.5".to_string()), // This can change on CI, so we don't check it
version: Some("3.12.6".to_string()), // This can change on CI, so we don't check it
symlinks: Some(vec![
PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3"),
PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.12"),
Expand All @@ -61,19 +61,19 @@ fn verify_python_in_homebrew_contaner() {
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3.12/bin/python3"),
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3.12/bin/python3.12"),
// On CI the Python version can change with minor updates, so we don't check the full version.
// PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/python@3.12/3.12.5/bin/python3.12"),
// PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/python@3.12/3.12.6/bin/python3.12"),
]),
..Default::default()
};
let python3_11 = PythonEnvironment {
kind: Some(PythonEnvironmentKind::Homebrew),
executable: Some(PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.11")),
version: Some("3.11.9".to_string()), // This can change on CI, so we don't check it
version: Some("3.11.10".to_string()), // This can change on CI, so we don't check it
symlinks: Some(vec![
PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.11"),
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3.11/bin/python3.11"),
// On CI the Python version can change with minor updates, so we don't check the full version.
// PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.9/bin/python3.11"),
// PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.10/bin/python3.11"),
]),
..Default::default()
};
Expand Down
Loading