-
Notifications
You must be signed in to change notification settings - Fork 872
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
Allow version specifiers to be used in Python version requests #4214
Conversation
e232add
to
7f370c3
Compare
fc7e190
to
1321ccf
Compare
A little terrifying...
|
1321ccf
to
d19f861
Compare
crates/uv/tests/lock.rs
Outdated
----- stdout ----- | ||
|
||
----- stderr ----- | ||
warning: `uv sync` is experimental and may change without warning. | ||
Removing virtual environment at: [VENV]/ | ||
error: Requested Python executable `>=3.12` not found in PATH | ||
Using Python 3.12.3 interpreter at: /opt/homebrew/opt/[email protected]/bin/python3.12 |
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.
This is problematic, need to add a filter for this
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.
uv/crates/uv/src/commands/project/mod.rs
Lines 151 to 156 in 90947a9
writeln!( | |
printer.stderr(), | |
"Using Python {} interpreter at: {}", | |
interpreter.python_version(), | |
interpreter.sys_executable().user_display().cyan() | |
)?; |
Cherry-picked from #4214 The first commit gets us some context on an IO error during queries: Previously: ``` failed to canonicalize path `[VENV]/bin/python3` Caused by: No such file or directory (os error 2) ``` Now: ``` Failed to query Python interpreter Caused by: failed to canonicalize path `[VENV]/bin/python3` Caused by: No such file or directory (os error 2) ``` but really we shouldn't attempt to query a missing interpreter during discovery anyway, so we improve handling of that too.
By setting the test search path to an empty path, we avoid accidentally pulling interpreters from the system during a test case. Cherry-picked from #4214
# Conflicts: # crates/uv/tests/common/mod.rs
1a449ca
to
662a4c2
Compare
…ecifiers (#4289) Before 0.2.10 we would parse `--python=python` as an executable name. After #4214, we started treating this as a Python version range request (with an empty version range). This is not entirely unreasonable, but it was an unexpected regression and I don't think `VersionRequest` should support empty ranges in its `from_str` implementation without more consideration.
In service of #4212 but this is user-facing e.g. Python discovery will support version specifiers everywhere now.
Closes #4212