Make `uv venv` use the python version listed in `.python-version` if no `--python` is provided
As the title. People can list multiple versions in the .python-version file too. The first matched one should be used.
E.g., with the following .python-version, 3.12 is preferred but 3.11 is fine as well.
3.12
3.11
It looks like uv project uses .python-versions (there is a trailing s somehow). pyenv uses .python-version.
HI! That file is for internal development purposes – we need multiple specific Python versions to test this project.
We don't support .python-version markers at all. We definitely can consider it though.
+1 for this. I have a use case where different branches are currently using different python version as part of a transition so using a versioned file to specify this would be great.
Thank you for this wonderful project!
This becomes especially interesting in combination with https://github.com/astral-sh/uv/issues/2607
Implemented in https://github.com/astral-sh/uv/pull/4335
Just leave a note here the command is: uv venv --preview