Surface dedicated errors for .python-version conflict with requires-python (#7218)

## Summary

I got confused because I had a `.python-version` file that conflicted
with my `requires-python`.
This commit is contained in:
Charlie Marsh 2024-09-09 17:12:53 -04:00 committed by GitHub
parent 5905f40f50
commit fe8880bf3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 191 additions and 50 deletions

View file

@ -129,6 +129,12 @@ impl PythonVersionFile {
&self.path
}
/// Return the file name of the version file (guaranteed to be one of `.python-version` or
/// `.python-versions`).
pub fn file_name(&self) -> &str {
self.path.file_name().unwrap().to_str().unwrap()
}
/// Set the versions for the file.
#[must_use]
pub fn with_versions(self, versions: Vec<PythonRequest>) -> Self {