.python-version
overrides inline script metadata required-python
for uv run
#6883
Labels
bug
Something isn't working
I ran a script with
uv run
, and.python-version
in the current directory overroderequired-python
in the inline script metadata. The version in.python-version
wasn't in the range ofrequired-python
. When the script ran with the wrong Python version, it failed. The problem took me five minutes to debug. I am not sure what should happen in this situation, but it confused me, so I am reporting it. (I think I'd prefer uv to either report a conflict in the Python version requirements and not run the script or to ignore.python-version
in favor ofrequired-python
.)I encountered this conflict on Ubuntu 24.04 on x86-64. uv was installed with pipx. Here is a POSIX shell script to reproduce it.
Output:
The text was updated successfully, but these errors were encountered: