mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-23 13:05:58 +00:00
Add tests for python version compatibility (#14430)
This commit is contained in:
parent
d81b6cd334
commit
1f07880d5c
5 changed files with 80 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue