Add tests for python version compatibility (#14430)

This commit is contained in:
Micha Reiser 2024-11-18 13:26:55 +01:00 committed by GitHub
parent d81b6cd334
commit 1f07880d5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 80 additions and 2 deletions

View file

@ -475,4 +475,24 @@ impl PythonVersion {
pub fn supports_pep_701(self) -> bool {
self >= Self::Py312
}
pub fn as_tuple(self) -> (u8, u8) {
match self {
Self::Py37 => (3, 7),
Self::Py38 => (3, 8),
Self::Py39 => (3, 9),
Self::Py310 => (3, 10),
Self::Py311 => (3, 11),
Self::Py312 => (3, 12),
Self::Py313 => (3, 13),
}
}
pub fn latest() -> Self {
Self::Py313
}
pub fn minimal_supported() -> Self {
Self::Py37
}
}