Closed
Labels
area:cliRelated to the command line interfaceRelated to the command line interface
Description
~ $ uv --version
uv 0.5.1 (Homebrew 2024-11-08)
When I run uv run --python 3.13 python then Python 3.13.0rc2 is started. Why it is still using the release candidate?
~ $ uv python list --only-installed
cpython-3.13.0-macos-aarch64-none /opt/homebrew/opt/python@3.13/bin/python3.13 -> ../Frameworks/Python.framework/Versions/3.13/bin/python3.13
cpython-3.13.0rc2-macos-aarch64-none .local/share/uv/python/cpython-3.13.0rc2-macos-aarch64-none/bin/python3.13
cpython-3.12.7-macos-aarch64-none /opt/homebrew/opt/python@3.12/bin/python3.12 -> ../Frameworks/Python.framework/Versions/3.12/bin/python3.12
cpython-3.12.6-macos-aarch64-none .pyenv/versions/3.12.6/bin/python3.12
cpython-3.12.6-macos-aarch64-none .pyenv/versions/3.12.6/bin/python3 -> python3.12
cpython-3.12.6-macos-aarch64-none .pyenv/versions/3.12.6/bin/python -> python3.12
cpython-3.11.10-macos-aarch64-none .local/share/uv/python/cpython-3.11.10-macos-aarch64-none/bin/python3.11
cpython-3.10.15-macos-aarch64-none .local/share/uv/python/cpython-3.10.15-macos-aarch64-none/bin/python3.10
cpython-3.9.6-macos-aarch64-none /Library/Developer/CommandLineTools/usr/bin/python3 -> ../../Library/Frameworks/Python3.framework/Versions/3.9/bin/python
I had to run uv python uninstall 3.13 to get rid of the release candidate, and only then did uv run --python 3.13 python run the latest version - the one installed by Homebrew.
Shouldn't uv automatically use the final version over the release candidate? It feels strange that I had to manually install 3.13 for it to use the newer 3.13.
Reacted by Angelo Peronio
Metadata
Metadata
Assignees
Labels
area:cliRelated to the command line interfaceRelated to the command line interface
Activity
charliermarsh commentedon Nov 11, 2024
Was the release candidate already installed? Did
uv python install 3.13give you the release candidate after uninstalling?zanieb commentedon Nov 11, 2024
Yeah we'll use a managed versions over system ones (like that homebrew one) and installed versions over available downloads. It looks like you previously used the release candidate — I think it's reasonable we don't switch the version out from under you without some sort of intervention?
zanieb commentedon Nov 11, 2024
(Arguably, we should automatically upgrade people to the latest patch version of Python somehow, but we do not do that now)
kevinrenskers commentedon Nov 11, 2024
I had the release candidate installed back when that was the newest version, yeah. Since then Homebrew installed 3.13 because one of its packages demands it (I didn't manually brew install python 3.13).
I expected that uv would pick that version.
After running
uv python uninstall 3.13I then ranuv python install 3.13and yes that gave me the newest version:To me it's weird that I had to do this manually.
Well, going from a release candidate to a final, when I never explicitly asked for a release candidate install anyway, seems reasonable.
That would make sense to me too.
kevinrenskers commentedon Nov 11, 2024
How does one update the installed Python version anyway? Like, I did run
uv python install 3.13when the release candidate was still installed, and it did nothing. It didn't upgrade 3.13 to the final version.Or let's say 3.13.1 is released, how do I then update to that version? Will running
uv python install 3.13at that point update to 3.13.1? Or do I first have to uninstall 3.13? And what about all my Python projects with a.python-versionfile that says3.13. Will they automatically update to 3.13.1 after I runuv python install 3.13? Do I have to specify the patch version in the.python-versionfile?my1e5 commentedon Nov 11, 2024
If you already have 3.13.0 downloaded, then if you run
uv python install 3.13uv will detect that you already have a compatible Python installation that matches the requirement of 3.13 and therefore do nothing. With verbose mode enabled you can see this:So no, in this case it won't automatically fetch and download version 3.13.1. You would have to specifically state that you want
uv python install 3.13.1or useuv python install 3.13 --reinstall.If you run
uv python uninstall 3.13- which would trigger your all downloaded versions matching 3.13 to uninstall - then runninguv python install 3.13would the next time install 3.13.1 straight away. Because in this case it wouldn't find a compatible version meeting the requirement and therefore proceed to download the latest version.The same goes for your
.python-versionfile. If it states3.13, then uv will look and see what is the latest version of 3.13 you already have downloaded. It won't go and automatically download the latest version. It will just use whatever you already have if that's possible.charliermarsh commentedon Nov 12, 2024
I think this looks like it's working correctly --
--reinstallor--upgradeshould upgrade, but we shouldn't do it implicitly.kevinrenskers commentedon Nov 12, 2024
It would make sense to add
--upgrade, because having to reinstall Python to update it feels pretty unintuitive.Personally I do feel that running
uv python install 3.13should install the latest patch version when an old version is installed, but I can see the logic in requiring--upgrade.[-]Python 3.13 is stuck on rc2[/-][+]Add `uv python install --upgrade`[/+]charliermarsh commentedon Nov 12, 2024
Sounds good. I honestly thought
--upgradeexisted already, but I was thinking ofuv tool install.zanieb commentedon Nov 12, 2024
I think we're waiting to add
--upgradeuntil we have better behavior around upgrading Python distributions that are in-use by virtual environments.angelo-peronio commentedon Feb 10, 2025
Possibly a duplicate of #7892
Support transparent Python patch version upgrades (astral-sh#13954)