Search in the user scheme scripts directory last in find_uv_bin#14191
Search in the user scheme scripts directory last in find_uv_bin#14191
find_uv_bin#14191Conversation
|
Arguably breaking, but I'd be surprised if it had real-world implications. We can slot into v0.8 if we want though. |
|
I suggest is searching the relative paths first: When uv is installed into I can't see where it would find an unrelated "wrong" uv with the first logic. At worst it won't find anything, does it? Maybe a more general "fix" is to have the |
There was a problem hiding this comment.
@zanieb I tested this change with 4 combinations and it seems to be working well:
- uv installed at system level for uv python and for mise python, had to use
uv run python -m pip install --break-system-packages uv.whland similar for mise. - venv created with
uv envand withpython -m venv - tested only on macOS
I did not test with pip --user level because that one is known that packages installed like this are not to be available to venvs regardless how they are created.
All these 4 combinations worked this way as python -m uv was able to return the correct uv. Obviously that the uv executable was not in path for most of them, but that was expected.
Hm.. I think both the |
In which case could there be a false positive? It looks at the location adjacent to the python module. That would work for pretty much all scenarios as this is the same location the binary would be for e.g. user or system installations, isn't it? |
|
I mean, when we look 4 parents up we could just be looking in an arbitrary directory at that point? |
I see. Maybe we can match the parents against |
|
I considered that, but I was sort of hesitant to add more complexity. I can mull it over some more / seek feedback from more of the team. |
95088e3 to
8b369b4
Compare
1137c6c to
50a958d
Compare
50a958d to
9eee403
Compare
9eee403 to
6bb9b73
Compare
4c6ae73 to
bb1bb76
Compare
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 uvbefore the one matching the uv module.