-
Notifications
You must be signed in to change notification settings - Fork 669
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
uvx and uv tool not respecting python version in packaged app #8206
Comments
Ok, I see now that I can pass If you are installing a packaged app from a local folder or git repo, you'd want it to just work. For example,
To an uninformed end user this error can be confusing. How do you know you need to specify |
A simpler MRE. Create a packaged app with
|
I don't know if respecting https://packaging.python.org/en/latest/specifications/version-specifiers/#compatible-release >>> from packaging.specifiers import SpecifierSet
>>> spec = SpecifierSet("~=3.12")
>>> "3.13" in spec
True
>>> spec2 = SpecifierSet("~=3.12.0")
>>> "3.13" in spec2
False
>>> "3.12.7" in spec2
True |
Thanks @DavidCEllis - good to know, I didn't realise this. It seems uvx isn't respecting the |
Now that Python 3.13 has been released I'm seeing this behaviour and wondered if I was doing something wrong.
Say I want to create a packaged application that only runs on Python 3.12.
This creates a
.python-version
pinned at3.12
. I also go into thepyproject.toml
file and changerequires-python
toWhen I run the app within the working directory it uses a suitable version of 3.12
I will also add a PyPi project which currently does not have 3.13 support.
But my problem is when I try to run the app with uvx (or if I try to install the app as a uv tool)
How can I get uvx to respect the requirement that Python 3.12 must be used? My use case is I have this packaged app hosted on a local private git server and I want my colleagues to be able to download/install it as a tool.
My assumption was that uv would look at the
.python-version
file first and if that wasn't present then it would look at therequires-python
field? But it seems to be going straight to 3.13.0 without checking?The text was updated successfully, but these errors were encountered: