-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: create venv from rust #128
feat: create venv from rust #128
Conversation
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.
Looking very good, 1 question and minor changes requested :)
crates/rattler_installs_packages/src/python_env/system_python.rs
Outdated
Show resolved
Hide resolved
I'll want to test the branch a bit tomorrow and will look at te rest of the changes, but from what I am seeing it looks pretty good! |
Thank you very much! Let me know if there is anything I can help with |
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.
Approved! Just gonna do some simple testing with it 👍
Okay looks good, merging! |
.or_else(|_| which::which("python")) | ||
.map_err(|_| FindPythonError::NotFound) | ||
|
||
let output = match std::process::Command::new("python3") |
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.
Not something that needed to happen in this PR but... given the move away from a few stat calls to a subprocess, consider caching the results of system_python_executable
across the entire process since it's unlikely to change and you can avoid this overhead on every environment creation + bytecode compile call etc.
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.
Thanks @pradyunsg will make an issue (#134) out of this!
Create python venv directly from rust.
Implementation based on built-in venv module.
I've changed a little
system_python_executable
implementation.which
does not return original interpreter but a shim path when using pyenv. This does not work well when we later createpyenv.cfg
and sethome =
Closes: #83