Pin .python-version in uv init (#6869)

## Summary

I'm not convinced that the behavior is correct as-implemented. When the
user passes a `--python >=3.8` or we discover a `requires-python` from
the workspace, we're currently writing that request out to
`.python-version`. I would probably rather that we write the resolved
patch version?

Closes https://github.com/astral-sh/uv/issues/6821.
This commit is contained in:
Charlie Marsh 2024-09-03 19:43:50 -04:00 committed by GitHub
parent 3e8d53c8eb
commit 50d7b9c38a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 350 additions and 113 deletions

View file

@ -453,6 +453,10 @@ uv init [OPTIONS] [PATH]
<p>This is the default behavior when using <code>--app</code>.</p>
</dd><dt><code>--no-pin-python</code></dt><dd><p>Do not create a <code>.python-version</code> file for the project.</p>
<p>By default, uv will create a <code>.python-version</code> file containing the minor version of the discovered Python interpreter, which will cause subsequent uv commands to use that version.</p>
</dd><dt><code>--no-progress</code></dt><dd><p>Hide all progress outputs.</p>
<p>For example, spinners or progress bars.</p>