-
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
Improve handling of missing interpreters during discovery #4218
Conversation
error: failed to canonicalize path `[VENV]/Scripts/python.exe` | ||
Caused by: The system cannot find the path specified. (os error 3) |
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.
Oh hey this is way better, why would we fail here anyway?
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.
Yeah I'm actually not sure.
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.
Well I know why we did but yeah there's no reason to
crates/uv/tests/pip_sync.rs
Outdated
error: failed to canonicalize path `[VENV]/bin/python3` | ||
Caused by: No such file or directory (os error 2) | ||
error: No Python interpreters found in virtual environments |
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.
Now this isn't amazing, I guess with -v
you'd see why your VIRTUAL_ENV
was ignored. We could add some sort of hint in the future?
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.
Since it literally doesn't exist this seems okay for now though
This feels kind of obvious, but the query code never checked if the requested interpreter exists so we would fail with an IO error and stop discovery which does not feel quite right
Cherry-picked from #4214
The first commit gets us some context on an IO error during queries:
Previously:
Now:
but really we shouldn't attempt to query a missing interpreter during discovery anyway, so we improve handling of that too.