You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm really exicted that we can specify python version and libraries dependency for scripts in uv and this thing can convinced me to move from poetry to uv.
Description
Unfortunately, I've encounter an issue which I don't if it's a bug or expected behaviour.
The problem is that script inline python requirement is not respected by uv when .python-version file is specified in the same directory.
Steps to reproduce:
OS Version: Ubuntu 22.04 LTS
uv version: 0.5.4 (installed through official installation script as mentioned in documentation)
It has a warning, so I personally think it's an expected behavior.
warning: The Python request from `.python-version` resolved to Python 3.12.7, which is incompatible with the script's Python requirement: `==3.11.5`
Personally, I believe that if the script has a specified version, we ought to adhere to it unless a different version is explicitly defined via the CLI.
However, since uv run is categorized as a project API, it is also reasonable for it to respect the .python-version file under the project.
Hello,
I'm really exicted that we can specify python version and libraries dependency for scripts in
uv
and this thing can convinced me to move frompoetry
touv
.Description
Unfortunately, I've encounter an issue which I don't if it's a bug or expected behaviour.
The problem is that script inline python requirement is not respected by
uv
when.python-version
file is specified in the same directory.Steps to reproduce:
OS Version: Ubuntu 22.04 LTS
uv
version: 0.5.4 (installed through official installation script as mentioned in documentation).python-version
contains:example.py
script with dependencies:uv
example.py
What we see:
.python-version
resolved to Python 3.12.7, which is incompatible with the script's Python requirement:==3.11.5
print(sys.version)
returns3.12.7
but not3.11.5
What should we see:
The script should be run with python 3.11.5, but it's not.
Alternative
We can run
example.py
withBut this means that the inline metadata requirements are not being used at all.
Is this a bug or a feature?
The text was updated successfully, but these errors were encountered: