Skip to content

Notify users when a new Python patch version is available #8217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
itamarst opened this issue Oct 15, 2024 · 4 comments
Open

Notify users when a new Python patch version is available #8217

itamarst opened this issue Oct 15, 2024 · 4 comments
Labels
enhancement New feature or improvement to existing functionality

Comments

@itamarst
Copy link

I'm running on 3.12.7. CPython releases 3.12.8 with security fixes. It would be good for uv to notify users that they want to install this new version.

Compare to Linux distribution behavior, where there's an auto-update mechanism that might (depending on distro) pop up saying "updates available, click here to install".

(See also #1795 (comment) for some motivation re making existing venvs secure.)

@zanieb
Copy link
Member

zanieb commented Oct 15, 2024

Good idea :)

@zanieb zanieb added the enhancement New feature or improvement to existing functionality label Oct 15, 2024
@s-banach
Copy link

s-banach commented Nov 4, 2024

Sorry to bother you both, hopefully this question is on-topic.
Is it possible to update the python version in an existing venv without destroying the venv?
Thanks.

@zanieb
Copy link
Member

zanieb commented Nov 4, 2024

Only to a different patch version of the same minor version — and it's sort of a workaround e.g.

❯ uv venv -p 3.11
Using CPython 3.11.10
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
❯ uv pip install anyio
Resolved 3 packages in 118ms
Installed 3 packages in 5ms
 + anyio==4.6.2.post1
 + idna==3.10
 + sniffio==1.3.1
❯ ls .venv/lib/python3.11/site-packages
__pycache__			_virtualenv.py			anyio-4.6.2.post1.dist-info	idna-3.10.dist-info		sniffio-1.3.1.dist-info
_virtualenv.pth			anyio				idna				sniffio
❯ uv venv -p 3.11.5 --allow-existing
Using CPython 3.11.5
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
❯ ls .venv/lib/python3.11/site-packages
__pycache__			_virtualenv.py			anyio-4.6.2.post1.dist-info	idna-3.10.dist-info		sniffio-1.3.1.dist-info
_virtualenv.pth			anyio				idna				sniffio
❯ .venv/bin/python --version
Python 3.11.5

Switching minor versions can change the package compatibility and is generally not safe.

@janosh
Copy link
Contributor

janosh commented Jan 14, 2025

and it's sort of a workaround

very useful! 👍 would be great to document this workaround and maybe add a test for it to ensure it doesn't break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants