Skip to content

Drop Python 3.11 support#674

Merged
ecomodeller merged 4 commits into
mainfrom
fix/vertical-colorbar-mypy
Jun 29, 2026
Merged

Drop Python 3.11 support#674
ecomodeller merged 4 commits into
mainfrom
fix/vertical-colorbar-mypy

Conversation

@ecomodeller

@ecomodeller ecomodeller commented Jun 24, 2026

Copy link
Copy Markdown
Member

Bumps the minimum Python to 3.12 across requires-python, the trove classifiers, mypy's target, and the CI matrices, and fixes the two mypy errors that 3.11 was masking.

mikeio's main branch now requires Python >=3.12 (SPEC 0), which made the test-mikeio-main canary job fail at dependency resolution: uv resolves for every supported Python version, and 3.11 is no longer satisfiable. Since mikeio is a core dependency, modelskill follows the same policy.

This also fixes the typecheck CI, where numpy's current type stubs use the 3.12+ type statement that mypy rejects when targeting 3.11.

ax.figure is typed Figure | SubFigure | None, so accessing .colorbar
directly raised a union-attr error. Narrow to non-None before use.
The slice/Iterable overload overlaps with the int/Hashable overload
because str and tuple are both Hashable and Iterable[Hashable]. The
overlap is structurally unavoidable, so suppress it in place.

@overload
def __getitem__(self, x: slice | Iterable[Hashable]) -> ComparerCollection: ...
def __getitem__(self, x: slice | Iterable[Hashable]) -> ComparerCollection: ... # type: ignore[overload-overlap]
numpy's current type stubs use the 3.12+ `type` statement, which mypy
rejects when targeting 3.11, breaking the typecheck on every matrix job.
Bump requires-python and mypy's target to 3.12 and drop 3.11 from the CI
matrices.
3.14 is exercised in CI and allowed by requires-python, but was missing
from the classifiers.
@ecomodeller ecomodeller changed the title Fix mypy union-attr error in vertical comparison colorbar Drop Python 3.11 support Jun 29, 2026
@ecomodeller ecomodeller merged commit b69c1e1 into main Jun 29, 2026
11 checks passed
@ecomodeller ecomodeller deleted the fix/vertical-colorbar-mypy branch June 29, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant