-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
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.
uv init --app --package example-packaged-app --python 3.12This creates a .python-version pinned at 3.12. I also go into the pyproject.toml file and change requires-python to
- requires-python = ">=3.12"
+ requires-python = "~=3.12"When I run the app within the working directory it uses a suitable version of 3.12
$ uv run example-packaged-app
Using CPython 3.12.4 interpreter at: /opt/homebrew/opt/[email protected]/bin/python3.12
Creating virtual environment at: .venv
Built example-packaged-app @ file:///Users/User/example-packaged-app
Installed 1 package in 2ms
Hello from example-packaged-app!
I will also add a PyPi project which currently does not have 3.13 support.
uv add dearpygui
Resolved 2 packages in 2ms
Built example-packaged-app @ file:///Users/User/example-packaged-app
Prepared 1 package in 379ms
Uninstalled 1 package in 0.87ms
Installed 2 packages in 4ms
+ dearpygui==1.11.1
~ example-packaged-app==0.1.0 (from file:///Users/User/example-packaged-app)
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)
uvx -v --from file:///Users/User/example-packaged-app example-packaged-app
DEBUG uv 0.4.21
DEBUG Searching for default Python interpreter in managed installations or system path
DEBUG Searching for managed installations at `/Users/rd/.local/share/uv/python`
DEBUG Found managed installation `cpython-3.13.0-macos-aarch64-none`
DEBUG Found `cpython-3.13.0-macos-aarch64-none` at `/Users/rd/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/bin/python3` (managed installations)
DEBUG Using request timeout of 30s
DEBUG Found PEP 621 metadata for /Users/User/example-packaged-app in `pyproject.toml` (example-packaged-app)
DEBUG Acquired lock for `/Users/rd/.local/share/uv/tools`
DEBUG Released lock at `/Users/rd/.local/share/uv/tools/.lock`
DEBUG Caching via interpreter: `/Users/rd/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/bin/python3`
DEBUG Using request timeout of 30s
DEBUG Found static `pyproject.toml` for: example-packaged-app @ file:///Users/User/example-packaged-app
DEBUG No workspace root found, using project root
DEBUG Solving with installed Python version: 3.13.0
DEBUG Solving with target Python version: >=3.13.0
DEBUG Adding direct dependency: example-packaged-app*
DEBUG Searching for a compatible version of example-packaged-app @ file:///Users/User/example-packaged-app (*)
DEBUG Adding transitive dependency for example-packaged-app==0.1.0: dearpygui>=1.11.1
DEBUG Found fresh response for: https://pypi.org/simple/dearpygui/
DEBUG Searching for a compatible version of dearpygui (>=1.11.1)
DEBUG Searching for a compatible version of dearpygui (>1.11.1)
DEBUG No compatible version found for: dearpygui
DEBUG Searching for a compatible version of example-packaged-app @ file:///Users/User/example-packaged-app (<0.1.0 | >0.1.0)
DEBUG No compatible version found for: example-packaged-app
× No solution found when resolving tool dependencies:
╰─▶ Because only dearpygui<=1.11.1 is available and dearpygui==1.11.1 has no wheels with a matching Python ABI tag, we can conclude that dearpygui>=1.11.1 cannot be used.
And because example-packaged-app==0.1.0 depends on dearpygui>=1.11.1, we can conclude that example-packaged-app==0.1.0 cannot be used.
And because only example-packaged-app==0.1.0 is available and you require example-packaged-app, we can conclude that your requirements are unsatisfiable.
hint: Pre-releases are available for dearpygui in the requested range (e.g., 2.0.0b1), but pre-releases weren't enabled (try: `--prerelease=allow`)
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 the requires-python field? But it seems to be going straight to 3.13.0 without checking?