Open jnussbaum opened 6 days ago
The .python-version
file is not quite obsolete with requires-python
-- they're subtly different. requires-python
is the range of versions supported by your project. .python-version
is the exact version you want to use when developing. For example, if you're working on a library, your requires-python
might be >= "3.10"
. But when developing on your machine, you might want to use 3.12.4
by default -- so you'd set that in a .python-version
.
Thanks for this information, that makes sense 👍
First a big thumbs up for the great work you're doing with ruff and uv! We have adopted both in our company, and we're overwhelmed!
I have just a quick request for clarification: https://docs.astral.sh/uv/guides/projects/ implies that it is always necessary (or at least best practice) to have the file
.python-version
checked in. But for standards-compliant projects that defineproject.requires-python
inpyproject.toml
, this seems obsolete. I tried it out, and in fact, uv correctly detectsproject.requires-python
and installs the intended python version, even without.python-version
.In our project, I wanted to remove
.python-version
, so that we don't have the python version defined in 2 separate places. But then I became insecure because of the documentation.Therefore, I think it would be helpful to add a remark to https://docs.astral.sh/uv/guides/projects/, mentioning that
.python-version
is obsolete in this case. WDYT?