astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
25.4k stars 739 forks source link

uv python list doesn't find pypy #7286

Closed hynek closed 1 month ago

hynek commented 1 month ago

I find uv python list an amazing tool to debug Python Environment xkcd situations, even tho I don't use uv for downloads. But find my PyPy installation (I could've sworn it used to but I might be wrong).

Here's le output to demonstrate:

❯ uv python list
cpython-3.13.0rc2-macos-aarch64-none    /usr/local/bin/python3.13 -> ../../../Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
cpython-3.13.0rc2-macos-aarch64-none    /Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
cpython-3.13.0rc2-macos-aarch64-none    /Library/Frameworks/Python.framework/Versions/3.13/bin/python3 -> python3.13
cpython-3.12.6-macos-aarch64-none       /usr/local/bin/python3.12 -> ../../../Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12
cpython-3.12.6-macos-aarch64-none       /usr/local/bin/python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.12/bin/python3
cpython-3.12.6-macos-aarch64-none       /Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12
cpython-3.12.6-macos-aarch64-none       /Library/Frameworks/Python.framework/Versions/3.12/bin/python3 -> python3.12
cpython-3.12.6-macos-aarch64-none       .local/share/uv/python/cpython-3.12.6-macos-aarch64-none/bin/python3 -> python3.12
cpython-3.11.10-macos-aarch64-none      /opt/homebrew/opt/python@3.11/bin/python3.11 -> ../Frameworks/Python.framework/Versions/3.11/bin/python3.11
cpython-3.11.10-macos-aarch64-none      <download available>
cpython-3.11.9-macos-aarch64-none       /usr/local/bin/python3.11 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11
cpython-3.11.9-macos-aarch64-none       /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11
cpython-3.11.9-macos-aarch64-none       /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -> python3.11
cpython-3.10.15-macos-aarch64-none      /opt/homebrew/opt/python@3.10/bin/python3.10 -> ../Frameworks/Python.framework/Versions/3.10/bin/python3.10
cpython-3.10.15-macos-aarch64-none      <download available>
cpython-3.10.11-macos-aarch64-none      /usr/local/bin/python3.10 -> ../../../Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10
cpython-3.9.20-macos-aarch64-none       /opt/homebrew/opt/python@3.9/bin/python3.9 -> ../Frameworks/Python.framework/Versions/3.9/bin/python3.9
cpython-3.9.20-macos-aarch64-none       <download available>
cpython-3.9.6-macos-aarch64-none        /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -> ../../Library/Frameworks/Python3.framework/Versions/3.9/bin/python3
cpython-3.8.20-macos-aarch64-none       /opt/homebrew/opt/python@3.8/bin/python3.8 -> ../Frameworks/Python.framework/Versions/3.8/bin/python3.8
cpython-3.8.20-macos-aarch64-none       <download available>
cpython-3.7.9-macos-x86_64-none         /usr/local/bin/python3.7 -> ../../../Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7
pypy-3.10.14-macos-aarch64-none         <download available>
pypy-3.9.19-macos-aarch64-none          <download available>
pypy-3.8.16-macos-aarch64-none          <download available>

~
❯ type pypy3.10
pypy3.10 is /opt/homebrew/bin/pypy3.10

~
❯ uv --version
uv 0.4.9 (77d278f68 2024-09-10)

I can use it to create venvs, though:

❯ uv venv --python pypy3.10 foo
Using Python 3.10.14 interpreter at: /opt/homebrew/bin/pypy3.10
Creating virtualenv at: foo
Activate with: source foo/bin/activate.fish
zanieb commented 1 month ago

That's surprising. I'll look into this.

zanieb commented 1 month ago

Btw if you don't want to see the downloads you can use uv python list --only-installed or set your python-preference to `only-system

hynek commented 1 month ago

Btw if you don't want to see the downloads you can use uv python list --only-installed or set your python-preference to `only-system

Ohhh loving it! I didn’t mind the download available but this is really cool.

zanieb commented 1 month ago

I think this is because, generally, we don't look for pypy executables unless you request PyPy so we exclude them here. I'll need to do some refactors to fix this.

hynek commented 1 month ago

That’s kinda funny in combination with #7118 — sorry for running into all edge cases. 🙈

zanieb commented 1 month ago

I appreciate it :)

hynek commented 1 month ago

image