mirror of
https://github.com/astral-sh/uv
synced 2026-01-21 05:20:09 -05:00
Search in the user scheme scripts directory last in find_uv_bin (#14191)
We should definitely not pick up user-level installations unless we can't find uv anywhere else. Otherwise, e.g., we would find a uv installed with `pipx install uv` before the one matching the uv module.
This commit is contained in:
@@ -18,8 +18,6 @@ def find_uv_bin() -> str:
|
||||
sysconfig.get_path("scripts"),
|
||||
# The scripts directory for the base prefix
|
||||
sysconfig.get_path("scripts", vars={"base": sys.base_prefix}),
|
||||
# The user scheme scripts directory, e.g., `~/.local/bin`
|
||||
sysconfig.get_path("scripts", scheme=_user_scheme()),
|
||||
# Above the package root, e.g., from `pip install --prefix` or `uv run --with`
|
||||
(
|
||||
# On Windows, with module path `<prefix>/Lib/site-packages/uv`
|
||||
@@ -33,6 +31,8 @@ def find_uv_bin() -> str:
|
||||
# Adjacent to the package root, e.g., from `pip install --target`
|
||||
# with module path `<target>/uv`
|
||||
_join(_matching_parents(_module_path(), "uv"), "bin"),
|
||||
# The user scheme scripts directory, e.g., `~/.local/bin`
|
||||
sysconfig.get_path("scripts", scheme=_user_scheme()),
|
||||
]
|
||||
|
||||
seen = []
|
||||
|
||||
Reference in New Issue
Block a user