-
Notifications
You must be signed in to change notification settings - Fork 26
Support resolving Python environments #35
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
Conversation
"env.bak", | ||
"venv.bak", | ||
"Scripts", // If the folder ends bin/scripts, then ignore it, as the parent is most likely an env. | ||
"bin", // If the folder ends bin/scripts, then ignore it, as the parent is most likely an env. |
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.
Ignore searching some known directories
) -> Option<ResolvedEnvironment> { | ||
// First check if this is a known environment | ||
let env = PythonEnv::new(executable.to_owned(), None, None); | ||
if let Some(env) = identify_python_environment_using_locators(&env, locators) { |
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.
Resolve
configuration: RwLock::new(Configuration::default()), | ||
}; | ||
|
||
let mut handlers = HandlersKeyedByMethodName::new(Arc::new(context)); | ||
handlers.add_request_handler("refresh", handle_refresh); | ||
handlers.add_request_handler("resolve", handle_resolve); |
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.
Add resolve request
// if the prefix is not defined, try to get this. | ||
// For instance, if the file is bin/python or Scripts/python | ||
// And we have a pyvenv.cfg file in the parent directory, then we can get the prefix. | ||
if prefix.is_none() { |
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.
Bug fix caught via CI
.unwrap_or_default(); | ||
} | ||
if let Some(project) = &self.project { | ||
writeln!(f, " Project : {}", project.to_str().unwrap()).unwrap_or_default(); |
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.
Minor refactor
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.
Spelling.
Co-authored-by: Karthik Nadig <[email protected]>
Co-authored-by: Karthik Nadig <[email protected]>
Co-authored-by: Karthik Nadig <[email protected]>
Co-authored-by: Karthik Nadig <[email protected]>
Co-authored-by: Karthik Nadig <[email protected]>
Co-authored-by: Karthik Nadig <[email protected]>
No description provided.