Skip to content

Commit 4247a4d

Browse files
committed
[red-knot] Do not merge: Run ecosystem checks with 3.9
1 parent 4894f52 commit 4247a4d

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

crates/red_knot/src/python_version.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
/// TODO: unify with the `PythonVersion` enum in the linter/formatter crates?
44
#[derive(Copy, Clone, Hash, Debug, PartialEq, Eq, PartialOrd, Ord, Default, clap::ValueEnum)]
55
pub enum PythonVersion {
6-
#[value(name = "3.7")]
7-
Py37,
8-
#[value(name = "3.8")]
9-
Py38,
106
#[default]
117
#[value(name = "3.9")]
128
Py39,
@@ -23,8 +19,6 @@ pub enum PythonVersion {
2319
impl PythonVersion {
2420
const fn as_str(self) -> &'static str {
2521
match self {
26-
Self::Py37 => "3.7",
27-
Self::Py38 => "3.8",
2822
Self::Py39 => "3.9",
2923
Self::Py310 => "3.10",
3024
Self::Py311 => "3.11",
@@ -43,8 +37,6 @@ impl std::fmt::Display for PythonVersion {
4337
impl From<PythonVersion> for ruff_python_ast::PythonVersion {
4438
fn from(value: PythonVersion) -> Self {
4539
match value {
46-
PythonVersion::Py37 => Self::PY37,
47-
PythonVersion::Py38 => Self::PY38,
4840
PythonVersion::Py39 => Self::PY39,
4941
PythonVersion::Py310 => Self::PY310,
5042
PythonVersion::Py311 => Self::PY311,

crates/red_knot_project/src/metadata/pyproject.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ impl Project {
9696
return Ok(None);
9797
};
9898

99-
let minor = versions.next().copied().unwrap_or_default();
99+
let mut minor = versions.next().copied().unwrap_or_default();
100+
101+
// Ensure minor is at least 9
102+
minor = minor.max(9);
100103

101104
tracing::debug!("Resolved requires-python constraint to: {major}.{minor}");
102105

0 commit comments

Comments
 (0)