-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prefer Python executable names that match the request over default na…
…mes (#9066) This restores behavior previously removed in #7649. I thought it'd be clearer (and simpler) to have a consistent Python executable name ordering. However, we've seen some cases where this can be surprising and, in combination with #8481, can result in incorrect behavior. For example, see #9046 where we prefer `python3` over `python3.12` in the same directory even though `python3.12` was requested. While `python3` and `python3.12` both point to valid Python 3.12 environments there, the expectation is that when `python3.12` is requested that the `python3.12` executable is preferred. This expectation may be less obvious if the user requests `[email protected]`, but uv does not distinguish between these request forms. Similarly, this may be surprising as by default uv prefers `python` over `python3` but when requesting `python3.12` the preference will be swapped.
- Loading branch information
Showing
5 changed files
with
284 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -477,49 +477,52 @@ fn executable_names_from_request() { | |
case( | ||
"any", | ||
&[ | ||
"python", "python3", "cpython", "pypy", "graalpy", "cpython3", "pypy3", "graalpy3", | ||
"python", "python3", "cpython", "cpython3", "pypy", "pypy3", "graalpy", "graalpy3", | ||
], | ||
); | ||
|
||
case("default", &["python", "python3"]); | ||
|
||
case("3", &["python", "python3"]); | ||
case("3", &["python3", "python"]); | ||
|
||
case("4", &["python", "python4"]); | ||
case("4", &["python4", "python"]); | ||
|
||
case("3.13", &["python", "python3", "python3.13"]); | ||
case("3.13", &["python3.13", "python3", "python"]); | ||
|
||
case("pypy", &["pypy", "pypy3", "python", "python3"]); | ||
|
||
case( | ||
"[email protected]", | ||
&[ | ||
"python", | ||
"python3", | ||
"python3.10", | ||
"pypy", | ||
"pypy3", | ||
"pypy3.10", | ||
"pypy3", | ||
"pypy", | ||
"python3.10", | ||
"python3", | ||
"python", | ||
], | ||
); | ||
|
||
case( | ||
"3.13t", | ||
&[ | ||
"python", | ||
"python3", | ||
"python3.13t", | ||
"python3.13", | ||
"pythont", | ||
"python3t", | ||
"python3.13t", | ||
"python3", | ||
"pythont", | ||
"python", | ||
], | ||
); | ||
case("3t", &["python3t", "python3", "pythont", "python"]); | ||
|
||
case( | ||
"3.13.2", | ||
&["python", "python3", "python3.13", "python3.13.2"], | ||
&["python3.13.2", "python3.13", "python3", "python"], | ||
); | ||
|
||
case( | ||
"3.13rc2", | ||
&["python", "python3", "python3.13", "python3.13rc2"], | ||
&["python3.13rc2", "python3.13", "python3", "python"], | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.