From 3958077930e04ffff9783138dfeb8ca5dae7540c Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 5 Jun 2024 20:52:37 +1000 Subject: [PATCH 01/11] Preserve case for paths on disc --- crates/pet-conda/src/environment_locations.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/pet-conda/src/environment_locations.rs b/crates/pet-conda/src/environment_locations.rs index 6d26a29e..261aff42 100644 --- a/crates/pet-conda/src/environment_locations.rs +++ b/crates/pet-conda/src/environment_locations.rs @@ -200,6 +200,20 @@ pub fn get_known_conda_install_locations(env_vars: &EnvVariables) -> Vec Vec Date: Wed, 5 Jun 2024 20:52:52 +1000 Subject: [PATCH 02/11] Faster PR --- .github/workflows/pr-check.yml | 108 ++++++++++++++++----------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 032123b8..7e53dc23 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -66,60 +66,60 @@ jobs: - name: Check Conda version run: conda info --all - - name: Install pipenv - run: pip install pipenv - - - name: Check pipenv version - run: pipenv --version - - - name: Install virtualenvwrapper - if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') - run: | - pip install virtualenvwrapper - echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV - shell: bash - - - name: Install virtualenvwrapper-win - if: startsWith( matrix.os, 'windows') - run: | - pip install virtualenvwrapper-win - echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV - shell: bash - - - name: Install pyenv - if: startsWith( matrix.os, 'windows') - run: | - choco install pyenv-win -y - echo "PATH=$PATH;$HOME/.pyenv/pyenv-win/bin;$HOME/.pyenv/pyenv-win/shims" >> $GITHUB_ENV - echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV - shell: bash - - - name: Install pyenv and pyenv-virtualenv - if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') - run: | - curl https://pyenv.run | bash - echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV - echo "PATH=$HOME/.pyenv/bin:$PATH" >> $GITHUB_ENV - shell: bash - - - name: Check Pyenv version - run: pyenv --version - shell: bash - - - name: Install Pyenv Python(s) - if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') - run: | - pyenv install --list - pyenv install 3.12.3 3.11.9 3.10.14 3.9.19 3.8.19 - shell: bash - - # pyenv-win install list has not updated for a while - - name: Install Pyenv Python(s) - if: startsWith( matrix.os, 'windows') - run: | - pyenv install --list - pyenv install 3.10.5 3.9.13 3.8.10 - shell: bash + # - name: Install pipenv + # run: pip install pipenv + + # - name: Check pipenv version + # run: pipenv --version + + # - name: Install virtualenvwrapper + # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') + # run: | + # pip install virtualenvwrapper + # echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV + # shell: bash + + # - name: Install virtualenvwrapper-win + # if: startsWith( matrix.os, 'windows') + # run: | + # pip install virtualenvwrapper-win + # echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV + # shell: bash + + # - name: Install pyenv + # if: startsWith( matrix.os, 'windows') + # run: | + # choco install pyenv-win -y + # echo "PATH=$PATH;$HOME/.pyenv/pyenv-win/bin;$HOME/.pyenv/pyenv-win/shims" >> $GITHUB_ENV + # echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV + # shell: bash + + # - name: Install pyenv and pyenv-virtualenv + # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') + # run: | + # curl https://pyenv.run | bash + # echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV + # echo "PATH=$HOME/.pyenv/bin:$PATH" >> $GITHUB_ENV + # shell: bash + + # - name: Check Pyenv version + # run: pyenv --version + # shell: bash + + # - name: Install Pyenv Python(s) + # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') + # run: | + # pyenv install --list + # pyenv install 3.12.3 3.11.9 3.10.14 3.9.19 3.8.19 + # shell: bash + + # # pyenv-win install list has not updated for a while + # - name: Install Pyenv Python(s) + # if: startsWith( matrix.os, 'windows') + # run: | + # pyenv install --list + # pyenv install 3.10.5 3.9.13 3.8.10 + # shell: bash - name: Rust Tool Chain setup uses: dtolnay/rust-toolchain@stable From 062906205dfddb7b169fbcc575525fecefeb2505 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 5 Jun 2024 21:39:40 +1000 Subject: [PATCH 03/11] More fixes --- crates/pet-conda/src/environment_locations.rs | 8 +++--- crates/pet-conda/src/environments.rs | 16 +++++++++--- crates/pet-utils/src/lib.rs | 1 + crates/pet-utils/src/path.rs | 26 +++++++++++++++++++ 4 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 crates/pet-utils/src/path.rs diff --git a/crates/pet-conda/src/environment_locations.rs b/crates/pet-conda/src/environment_locations.rs index 261aff42..f4152726 100644 --- a/crates/pet-conda/src/environment_locations.rs +++ b/crates/pet-conda/src/environment_locations.rs @@ -155,6 +155,8 @@ pub fn get_conda_envs_from_environment_txt(env_vars: &EnvVariables) -> Vec Vec { + use pet_utils::path::get_absolute_path; + let user_profile = env_vars.userprofile.clone().unwrap_or_default(); let program_data = env_vars.programdata.clone().unwrap_or_default(); let all_user_profile = env_vars.allusersprofile.clone().unwrap_or_default(); @@ -206,11 +208,7 @@ pub fn get_known_conda_install_locations(env_vars: &EnvVariables) -> Vec Option { || conda_dir.to_ascii_lowercase() == "scripts" { if let Some(conda_dir) = cmd_line.parent() { - return Some(conda_dir.to_path_buf()); + // Ensure the casing of the paths are correct. + // Its possible the actual path is in a different case. + // The casing in history might not be same as that on disc + // We do not want to have duplicates in different cases. + // & we'd like to preserve the case of the original path as on disc. + return Some(get_absolute_path(conda_dir).to_path_buf()); } } // Sometimes we can have paths like @@ -202,7 +207,12 @@ fn get_conda_dir_from_cmd(cmd_line: String) -> Option { let _ = cmd_line.pop(); } } - return Some(cmd_line.to_path_buf()); + // Ensure the casing of the paths are correct. + // Its possible the actual path is in a different case. + // The casing in history might not be same as that on disc + // We do not want to have duplicates in different cases. + // & we'd like to preserve the case of the original path as on disc. + return Some(get_absolute_path(cmd_line).to_path_buf()); } } None diff --git a/crates/pet-utils/src/lib.rs b/crates/pet-utils/src/lib.rs index ad2dcfdf..c95152f1 100644 --- a/crates/pet-utils/src/lib.rs +++ b/crates/pet-utils/src/lib.rs @@ -6,3 +6,4 @@ pub mod executable; pub mod headers; pub mod pyvenv_cfg; pub mod sys_prefix; +pub mod path; \ No newline at end of file diff --git a/crates/pet-utils/src/path.rs b/crates/pet-utils/src/path.rs new file mode 100644 index 00000000..f0dba71a --- /dev/null +++ b/crates/pet-utils/src/path.rs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +use std::{ + fs, + path::{Path, PathBuf}, +}; + +pub fn get_absolute_path(path: &Path) -> PathBuf { + // Return the path as is. + if cfg!(unix) { + return path.to_path_buf(); + } + let has_unc_prefix = path.to_string_lossy().starts_with(r"\\?\"); + if let Ok(resolved) = fs::canonicalize(path) { + if resolved.to_string_lossy().starts_with(r"\\?\") && !has_unc_prefix { + // If the resolved path has a UNC prefix, but the original path did not, + // we need to remove the UNC prefix. + PathBuf::from(resolved.to_string_lossy().trim_start_matches(r"\\?\")) + } else { + resolved + } + } else { + path.to_path_buf() + } +} From 08761ad23ab7e74e1538e6fd07f1e2dd29da22d4 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 5 Jun 2024 21:43:10 +1000 Subject: [PATCH 04/11] Fixes --- crates/pet-conda/src/environment_locations.rs | 2 +- crates/pet-conda/src/environments.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/pet-conda/src/environment_locations.rs b/crates/pet-conda/src/environment_locations.rs index f4152726..70ed3823 100644 --- a/crates/pet-conda/src/environment_locations.rs +++ b/crates/pet-conda/src/environment_locations.rs @@ -208,7 +208,7 @@ pub fn get_known_conda_install_locations(env_vars: &EnvVariables) -> Vec Option { // The casing in history might not be same as that on disc // We do not want to have duplicates in different cases. // & we'd like to preserve the case of the original path as on disc. - return Some(get_absolute_path(cmd_line).to_path_buf()); + return Some(get_absolute_path(&cmd_line).to_path_buf()); } } None From 59cda0babfde41fb0e146627d1a5269dede140d1 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 5 Jun 2024 21:46:06 +1000 Subject: [PATCH 05/11] More fixes --- crates/pet-conda/src/environment_locations.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/pet-conda/src/environment_locations.rs b/crates/pet-conda/src/environment_locations.rs index 70ed3823..a542dcae 100644 --- a/crates/pet-conda/src/environment_locations.rs +++ b/crates/pet-conda/src/environment_locations.rs @@ -7,6 +7,7 @@ use crate::{ utils::{is_conda_env, is_conda_install}, }; use log::trace; +use pet_utils::path::get_absolute_path; use std::{ fs, path::{Path, PathBuf}, @@ -145,7 +146,7 @@ pub fn get_conda_envs_from_environment_txt(env_vars: &EnvVariables) -> Vec Date: Wed, 5 Jun 2024 21:52:54 +1000 Subject: [PATCH 06/11] Better name --- crates/pet-conda/src/environment_locations.rs | 8 ++++---- crates/pet-conda/src/environments.rs | 6 +++--- crates/pet-utils/src/path.rs | 6 +++++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/crates/pet-conda/src/environment_locations.rs b/crates/pet-conda/src/environment_locations.rs index a542dcae..88ccccdf 100644 --- a/crates/pet-conda/src/environment_locations.rs +++ b/crates/pet-conda/src/environment_locations.rs @@ -7,7 +7,7 @@ use crate::{ utils::{is_conda_env, is_conda_install}, }; use log::trace; -use pet_utils::path::get_absolute_path; +use pet_utils::path::fix_file_path_casing; use std::{ fs, path::{Path, PathBuf}, @@ -146,7 +146,7 @@ pub fn get_conda_envs_from_environment_txt(env_vars: &EnvVariables) -> Vec Vec Vec { - use pet_utils::path::get_absolute_path; + use pet_utils::path::fix_file_path_casing; let user_profile = env_vars.userprofile.clone().unwrap_or_default(); let program_data = env_vars.programdata.clone().unwrap_or_default(); @@ -209,7 +209,7 @@ pub fn get_known_conda_install_locations(env_vars: &EnvVariables) -> Vec Option { // The casing in history might not be same as that on disc // We do not want to have duplicates in different cases. // & we'd like to preserve the case of the original path as on disc. - return Some(get_absolute_path(conda_dir).to_path_buf()); + return Some(fix_file_path_casing(conda_dir).to_path_buf()); } } // Sometimes we can have paths like @@ -212,7 +212,7 @@ fn get_conda_dir_from_cmd(cmd_line: String) -> Option { // The casing in history might not be same as that on disc // We do not want to have duplicates in different cases. // & we'd like to preserve the case of the original path as on disc. - return Some(get_absolute_path(&cmd_line).to_path_buf()); + return Some(fix_file_path_casing(&cmd_line).to_path_buf()); } } None diff --git a/crates/pet-utils/src/path.rs b/crates/pet-utils/src/path.rs index f0dba71a..5485929c 100644 --- a/crates/pet-utils/src/path.rs +++ b/crates/pet-utils/src/path.rs @@ -6,7 +6,11 @@ use std::{ path::{Path, PathBuf}, }; -pub fn get_absolute_path(path: &Path) -> PathBuf { +// This function is used to fix the casing of the file path. +// by returning the actual path with the correct casing as found on the OS. +// This is a noop for Unix systems. +// I.e. this function is only useful on Windows. +pub fn fix_file_path_casing(path: &Path) -> PathBuf { // Return the path as is. if cfg!(unix) { return path.to_path_buf(); From 68e3f842511ea0e4bcca0648f31f1800687436f3 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 5 Jun 2024 22:02:52 +1000 Subject: [PATCH 07/11] Fix file path case --- crates/pet-conda/src/conda_rc.rs | 5 ++++- crates/pet-conda/src/environment_locations.rs | 6 +++++- crates/pet-global-virtualenvs/src/lib.rs | 12 ++++++------ crates/pet-pipenv/src/lib.rs | 4 ++-- crates/pet-virtualenvwrapper/src/environments.rs | 6 ++++-- crates/pet-windows-registry/src/environments.rs | 6 ++++-- crates/pet-windows-store/src/environments.rs | 4 +++- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/crates/pet-conda/src/conda_rc.rs b/crates/pet-conda/src/conda_rc.rs index 27d7a84f..66980424 100644 --- a/crates/pet-conda/src/conda_rc.rs +++ b/crates/pet-conda/src/conda_rc.rs @@ -3,6 +3,7 @@ use crate::env_variables::EnvVariables; use log::trace; +use pet_utils::path::fix_file_path_casing; use std::{fs, path::PathBuf}; #[derive(Debug)] @@ -154,7 +155,9 @@ fn parse_conda_rc(conda_rc: &PathBuf) -> Option { if line.trim().starts_with('-') { if let Some(env_dir) = line.split_once('-').map(|x| x.1) { // Directories in conda-rc are where `envs` are stored. - env_dirs.push(PathBuf::from(env_dir.trim()).join("envs")); + env_dirs.push(fix_file_path_casing( + &PathBuf::from(env_dir.trim()).join("envs"), + )); } continue; } else { diff --git a/crates/pet-conda/src/environment_locations.rs b/crates/pet-conda/src/environment_locations.rs index 88ccccdf..39236604 100644 --- a/crates/pet-conda/src/environment_locations.rs +++ b/crates/pet-conda/src/environment_locations.rs @@ -35,6 +35,7 @@ pub fn get_conda_environment_paths(env_vars: &EnvVariables) -> Vec { envs }); + env_paths = env_paths.iter().map(|p| fix_file_path_casing(&p)).collect(); env_paths.sort(); env_paths.dedup(); // For each env, check if we have a conda install directory in them and @@ -209,7 +210,10 @@ pub fn get_known_conda_install_locations(env_vars: &EnvVariables) -> Vec = vec![]; if let Some(work_on_home) = work_on_home_env_var { - if let Ok(work_on_home) = fs::canonicalize(work_on_home) { - if work_on_home.exists() { - venv_dirs.push(work_on_home); - } + let work_on_home = fix_file_path_casing(&PathBuf::from(work_on_home)); + if fs::metadata(&work_on_home).is_ok() { + venv_dirs.push(work_on_home); } } @@ -27,13 +27,13 @@ fn get_global_virtualenv_dirs( PathBuf::from(".local").join("share").join("virtualenvs"), ] { let venv_dir = home.join(dir); - if venv_dir.exists() { + if fs::metadata(&venv_dir).is_ok() { venv_dirs.push(venv_dir); } } if cfg!(target_os = "linux") { let envs = PathBuf::from("Envs"); - if envs.exists() { + if fs::metadata(&envs).is_ok() { venv_dirs.push(envs); } } diff --git a/crates/pet-pipenv/src/lib.rs b/crates/pet-pipenv/src/lib.rs index 57c79e66..b1d0f409 100644 --- a/crates/pet-pipenv/src/lib.rs +++ b/crates/pet-pipenv/src/lib.rs @@ -7,12 +7,12 @@ use pet_core::{ python_environment::{PythonEnvironment, PythonEnvironmentBuilder, PythonEnvironmentCategory}, Locator, LocatorResult, }; -use pet_utils::env::PythonEnv; +use pet_utils::{env::PythonEnv, path::fix_file_path_casing}; fn get_pipenv_project(env: &PythonEnv) -> Option { let project_file = env.prefix.clone()?.join(".project"); let contents = fs::read_to_string(project_file).ok()?; - let project_folder = PathBuf::from(contents.trim().to_string()); + let project_folder = fix_file_path_casing(&PathBuf::from(contents.trim().to_string())); if fs::metadata(&project_folder).is_ok() { Some(project_folder) } else { diff --git a/crates/pet-virtualenvwrapper/src/environments.rs b/crates/pet-virtualenvwrapper/src/environments.rs index e151c694..72645e70 100644 --- a/crates/pet-virtualenvwrapper/src/environments.rs +++ b/crates/pet-virtualenvwrapper/src/environments.rs @@ -2,7 +2,9 @@ // Licensed under the MIT License. use crate::{env_variables::EnvVariables, environment_locations::get_work_on_home_path}; -use pet_utils::{env::PythonEnv, executable::find_executable, pyvenv_cfg::PyVenvCfg}; +use pet_utils::{ + env::PythonEnv, executable::find_executable, path::fix_file_path_casing, pyvenv_cfg::PyVenvCfg, +}; use pet_virtualenv::is_virtualenv; use std::{fs, path::PathBuf}; @@ -26,7 +28,7 @@ pub fn is_virtualenvwrapper(env: &PythonEnv, environment: &EnvVariables) -> bool pub fn get_project(env: &PythonEnv) -> Option { let project_file = env.prefix.clone()?.join(".project"); let contents = fs::read_to_string(project_file).ok()?; - let project_folder = PathBuf::from(contents.trim().to_string()); + let project_folder = fix_file_path_casing(&PathBuf::from(contents.trim().to_string())); if fs::metadata(&project_folder).is_ok() { Some(project_folder) } else { diff --git a/crates/pet-windows-registry/src/environments.rs b/crates/pet-windows-registry/src/environments.rs index 736635df..3f39a134 100644 --- a/crates/pet-windows-registry/src/environments.rs +++ b/crates/pet-windows-registry/src/environments.rs @@ -11,6 +11,8 @@ use pet_core::{ LocatorResult, }; #[cfg(windows)] +use pet_utils::path::fix_file_path_casing; +#[cfg(windows)] use pet_windows_store::is_windows_app_folder_in_program_files; #[cfg(windows)] use std::{path::PathBuf, sync::Arc}; @@ -94,7 +96,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 = PathBuf::from(env_path); + let env_path = fix_file_path_casing(&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", @@ -152,7 +154,7 @@ fn get_registry_pythons_from_key_for_company( ); continue; } - let executable = PathBuf::from(executable); + let executable = fix_file_path_casing(&PathBuf::from(executable)); if !executable.exists() { warn!( "Python executable ({}) file not found for {}\\Software\\Python\\{}\\{}", diff --git a/crates/pet-windows-store/src/environments.rs b/crates/pet-windows-store/src/environments.rs index e8a9873a..c0a24a95 100644 --- a/crates/pet-windows-store/src/environments.rs +++ b/crates/pet-windows-store/src/environments.rs @@ -12,6 +12,8 @@ use pet_core::python_environment::PythonEnvironment; #[cfg(windows)] use pet_core::{arch::Architecture, python_environment::PythonEnvironmentBuilder}; #[cfg(windows)] +use pet_utils::path::fix_file_path_casing; +#[cfg(windows)] use regex::Regex; use std::path::PathBuf; #[cfg(windows)] @@ -47,7 +49,7 @@ impl PotentialPython { let exe = self.exe.clone().unwrap_or_default(); let parent = path.parent()?.to_path_buf(); // This dir definitely exists. if let Some(result) = get_package_display_name_and_location(&name, hkcu) { - let env_path = PathBuf::from(result.env_path); + let env_path = fix_file_path_casing(PathBuf::from(result.env_path)); Some( PythonEnvironmentBuilder::new( From 8096ac980528ef9ef828a3f43366312df63f285d Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 5 Jun 2024 22:04:15 +1000 Subject: [PATCH 08/11] oops --- crates/pet-windows-store/src/environments.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pet-windows-store/src/environments.rs b/crates/pet-windows-store/src/environments.rs index c0a24a95..492d513d 100644 --- a/crates/pet-windows-store/src/environments.rs +++ b/crates/pet-windows-store/src/environments.rs @@ -49,7 +49,7 @@ impl PotentialPython { let exe = self.exe.clone().unwrap_or_default(); let parent = path.parent()?.to_path_buf(); // This dir definitely exists. if let Some(result) = get_package_display_name_and_location(&name, hkcu) { - let env_path = fix_file_path_casing(PathBuf::from(result.env_path)); + let env_path = fix_file_path_casing(&PathBuf::from(result.env_path)); Some( PythonEnvironmentBuilder::new( From 3fe5cb3598367d6fc12c918b768c46e2c94cbe40 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 5 Jun 2024 22:05:58 +1000 Subject: [PATCH 09/11] Fixes --- crates/pet-conda/src/environment_locations.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/pet-conda/src/environment_locations.rs b/crates/pet-conda/src/environment_locations.rs index 39236604..6a871939 100644 --- a/crates/pet-conda/src/environment_locations.rs +++ b/crates/pet-conda/src/environment_locations.rs @@ -35,7 +35,7 @@ pub fn get_conda_environment_paths(env_vars: &EnvVariables) -> Vec { envs }); - env_paths = env_paths.iter().map(|p| fix_file_path_casing(&p)).collect(); + env_paths = env_paths.iter().map(|p| fix_file_path_casing(p)).collect(); env_paths.sort(); env_paths.dedup(); // For each env, check if we have a conda install directory in them and @@ -212,7 +212,7 @@ pub fn get_known_conda_install_locations(env_vars: &EnvVariables) -> Vec Date: Wed, 5 Jun 2024 22:07:36 +1000 Subject: [PATCH 10/11] Fix formatting --- crates/pet-utils/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pet-utils/src/lib.rs b/crates/pet-utils/src/lib.rs index c95152f1..950fb9bf 100644 --- a/crates/pet-utils/src/lib.rs +++ b/crates/pet-utils/src/lib.rs @@ -4,6 +4,6 @@ pub mod env; pub mod executable; pub mod headers; +pub mod path; pub mod pyvenv_cfg; pub mod sys_prefix; -pub mod path; \ No newline at end of file From 00d4869f8a5555270cd7e64993054b8c23cadc8b Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 5 Jun 2024 22:09:59 +1000 Subject: [PATCH 11/11] Revert --- .github/workflows/pr-check.yml | 108 ++++++++++++++++----------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 7e53dc23..032123b8 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -66,60 +66,60 @@ jobs: - name: Check Conda version run: conda info --all - # - name: Install pipenv - # run: pip install pipenv - - # - name: Check pipenv version - # run: pipenv --version - - # - name: Install virtualenvwrapper - # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') - # run: | - # pip install virtualenvwrapper - # echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV - # shell: bash - - # - name: Install virtualenvwrapper-win - # if: startsWith( matrix.os, 'windows') - # run: | - # pip install virtualenvwrapper-win - # echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV - # shell: bash - - # - name: Install pyenv - # if: startsWith( matrix.os, 'windows') - # run: | - # choco install pyenv-win -y - # echo "PATH=$PATH;$HOME/.pyenv/pyenv-win/bin;$HOME/.pyenv/pyenv-win/shims" >> $GITHUB_ENV - # echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV - # shell: bash - - # - name: Install pyenv and pyenv-virtualenv - # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') - # run: | - # curl https://pyenv.run | bash - # echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV - # echo "PATH=$HOME/.pyenv/bin:$PATH" >> $GITHUB_ENV - # shell: bash - - # - name: Check Pyenv version - # run: pyenv --version - # shell: bash - - # - name: Install Pyenv Python(s) - # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') - # run: | - # pyenv install --list - # pyenv install 3.12.3 3.11.9 3.10.14 3.9.19 3.8.19 - # shell: bash - - # # pyenv-win install list has not updated for a while - # - name: Install Pyenv Python(s) - # if: startsWith( matrix.os, 'windows') - # run: | - # pyenv install --list - # pyenv install 3.10.5 3.9.13 3.8.10 - # shell: bash + - name: Install pipenv + run: pip install pipenv + + - name: Check pipenv version + run: pipenv --version + + - name: Install virtualenvwrapper + if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') + run: | + pip install virtualenvwrapper + echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV + shell: bash + + - name: Install virtualenvwrapper-win + if: startsWith( matrix.os, 'windows') + run: | + pip install virtualenvwrapper-win + echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV + shell: bash + + - name: Install pyenv + if: startsWith( matrix.os, 'windows') + run: | + choco install pyenv-win -y + echo "PATH=$PATH;$HOME/.pyenv/pyenv-win/bin;$HOME/.pyenv/pyenv-win/shims" >> $GITHUB_ENV + echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV + shell: bash + + - name: Install pyenv and pyenv-virtualenv + if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') + run: | + curl https://pyenv.run | bash + echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV + echo "PATH=$HOME/.pyenv/bin:$PATH" >> $GITHUB_ENV + shell: bash + + - name: Check Pyenv version + run: pyenv --version + shell: bash + + - name: Install Pyenv Python(s) + if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') + run: | + pyenv install --list + pyenv install 3.12.3 3.11.9 3.10.14 3.9.19 3.8.19 + shell: bash + + # pyenv-win install list has not updated for a while + - name: Install Pyenv Python(s) + if: startsWith( matrix.os, 'windows') + run: | + pyenv install --list + pyenv install 3.10.5 3.9.13 3.8.10 + shell: bash - name: Rust Tool Chain setup uses: dtolnay/rust-toolchain@stable