chore: move the type check to mypy 2.4.1

mypy 2 checks against Python 3.10 at the oldest, so the target moves
there; install.py's 3.8 floor stays held by vermin. Of the errors it
reports, three were new rather than reworded. A list of links reused the
name of the page list in the same function, a tuple key was spelled with
a star unpack mypy 2.4 misreads, and torrentzip's Sink took bytes where a
bytearray is passed. The baseline is synced to the new wording.
This commit is contained in:
Abdessamad Derraz committed 2026-11-12 12:35:38 +01:00
1 parent 7d6efc3522
commit 8e125e1d18
5 files changed
+365 -374

No files matched your search

+1 -1
View File
@@ -180,7 +180,7 @@ jobs:
# what this job has installed does not change the result.
- name: Type-check the scripts and the installer
run: |
pip install "mypy==1.18.2" "mypy-baseline==0.7.4"
pip install "mypy==2.4.1" "mypy-baseline==0.7.4"
mypy > "$RUNNER_TEMP/mypy.txt" || true
mypy-baseline filter --no-colors < "$RUNNER_TEMP/mypy.txt"
+355 -362
View File
File diff suppressed because it is too large. Load diff
+4 -2
View File
@@ -45,7 +45,7 @@ dev = [
"uv==0.13.4",
# The type check CI runs, pinned: another mypy reports other errors
# than the ones mypy-baseline.txt holds.
"mypy==1.18.2",
"mypy==2.4.1",
"mypy-baseline==0.7.4",
]
# The site is built by Astro Starlight from website/package.json and its
@@ -63,7 +63,9 @@ Repository = "https://github.com/Abdess/retrobios"
# `mypy-baseline sync < out.txt` once the fix is in.
[tool.mypy]
files = ["install.py", "scripts"]
python_version = "3.9"
# The oldest target mypy 2 checks against. install.py's own floor, 3.8, is
# held by vermin (pr_checks.py, validate.yml).
python_version = "3.10"
explicit_package_bases = true
ignore_missing_imports = true
no_site_packages = true
+4 -8
View File
@@ -7255,7 +7255,7 @@ def _group_start(group: _StartGroup, first_below: bool) -> list[tuple[str, str]]
if same is None:
regional[(region,)] = text
else:
regional[(*same, region)] = regional.pop(same)
regional[same + (region,)] = regional.pop(same)
out = [(", ".join(_region_words(r) for r in regions), regional[regions])
for regions in sorted(regional, key=lambda rs: (order.get(rs[0], len(order)), rs))]
@@ -10308,13 +10308,9 @@ def emulator_pages(
else:
lines.append(f"| Source | {source} |")
if isinstance(upstream_raw, dict):
parts = []
for k, v in upstream_raw.items():
if isinstance(v, str) and v.startswith("http"):
parts.append(f"[{k}]({v})")
else:
parts.append(f"{k}: {v}")
lines.append(f"| Upstream | {', '.join(parts)} |")
links = [f"[{k}]({v})" if isinstance(v, str) and v.startswith("http") else f"{k}: {v}"
for k, v in upstream_raw.items()]
lines.append(f"| Upstream | {', '.join(links)} |")
elif upstream_none:
lines.append("| Upstream | none: the source is the project itself |")
elif upstream and upstream != source:
+1 -1
View File
@@ -43,7 +43,7 @@ class Source(Protocol):
class Sink(Protocol):
def write(self, data: bytes, /) -> int: ...
def write(self, data: bytes | bytearray, /) -> int: ...
# TorrentZip constants: 1996-12-24 23:32:00, deflate level 9
_DOS_DATE = ((1996 - 1980) << 9) | (12 << 5) | 24