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

@ -94,7 +94,7 @@ impl PythonVersionFile {
/// Create a new representation of a version file at the given path.
///
/// The file will not any versions; see [`PythonVersionFile::with_versions`].
/// The file will not any include versions; see [`PythonVersionFile::with_versions`].
/// The file will not be created; see [`PythonVersionFile::write`].
pub fn new(path: PathBuf) -> Self {
Self {