mirror of
https://github.com/astral-sh/ruff
synced 2026-01-07 22:54:28 -05:00
Add tests for python version compatibility (#14430)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user