-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Updates to python locator #23446
Conversation
None => None, | ||
}; | ||
if reported.contains(&exe.to_string_lossy().to_string()) { | ||
// If this file name is `python3`, then ignore this for now. |
There was a problem hiding this comment.
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") { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
@@ -66,6 +68,17 @@ pub fn is_virtualenvwrapper(env: &PythonEnv, environment: &dyn Environment) -> b | |||
false | |||
} | |||
|
|||
fn get_project(env: &PythonEnv) -> Option<PathBuf> { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
The search algorithm has been documented here https://github.com/microsoft/vscode-python/wiki/Python-Environment-Search
The search algorithm has been documented here https://github.com/microsoft/vscode-python/wiki/Python-Environment-Search