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

Updates to python locator #23446

Merged
merged 9 commits into from
May 20, 2024
Merged

Updates to python locator #23446

merged 9 commits into from
May 20, 2024

Conversation

DonJayamanne
Copy link

@DonJayamanne DonJayamanne commented May 17, 2024

None => None,
};
if reported.contains(&exe.to_string_lossy().to_string()) {
// If this file name is `python3`, then ignore this for now.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exe that will be reported is the short name /opt/homebrew/bin/python3.12
I.e. i'm addressing this comment here #23445 (comment)

@@ -117,7 +128,12 @@ fn get_pure_python_environment(
.into_os_string()
.into_string()
.unwrap()]),
))
);
if file_name.ends_with("-win32") {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On windows we have 32bit, and it can be easily identified, hence returning that information.

@@ -96,16 +96,7 @@ pub fn get_version(python_executable: &PathBuf) -> Option<String> {
return Some(pyenv_cfg.version);
}
}

let output = Command::new(python_executable)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed that we would not spawn

@DonJayamanne DonJayamanne added no-changelog No news entry required skip package*.json package.json and package-lock.json don't both need updating skip tests Updates to tests unnecessary labels May 17, 2024
@DonJayamanne DonJayamanne requested a review from karthiknadig May 17, 2024 07:05
@@ -66,6 +68,17 @@ pub fn is_virtualenvwrapper(env: &PythonEnv, environment: &dyn Environment) -> b
false
}

fn get_project(env: &PythonEnv) -> Option<PathBuf> {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

virtualenvwrappers can also have a project path

@@ -214,7 +261,8 @@ impl Locator for PyEnv<'_> {

fn find(&mut self) -> Option<LocatorResult> {
let pyenv_binary = get_pyenv_binary(self.environment)?;
let manager = messaging::EnvManager::new(pyenv_binary, None, EnvManagerType::Pyenv);
let version = get_pyenv_manager_version(&pyenv_binary, self.environment);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates to extract version of pyenv

@DonJayamanne DonJayamanne marked this pull request as ready for review May 20, 2024 20:54
@vscodenpa vscodenpa added this to the May 2024 milestone May 20, 2024
@DonJayamanne DonJayamanne enabled auto-merge (squash) May 20, 2024 23:28
@DonJayamanne DonJayamanne merged commit e4ef0e4 into main May 20, 2024
67 checks passed
@DonJayamanne DonJayamanne deleted the updatesToLocator branch May 20, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog No news entry required skip package*.json package.json and package-lock.json don't both need updating skip tests Updates to tests unnecessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants