From 39b36952030bd4b5860f5d3ac16fd299b4a70b2a Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 2 Aug 2026 20:34:09 +0000 Subject: [PATCH 1/3] Initial commit with task details Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: https://github.com/link-foundation/python-ai-driven-development-pipeline-template/issues/44 --- .gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitkeep diff --git a/.gitkeep b/.gitkeep new file mode 100644 index 0000000..6d0f175 --- /dev/null +++ b/.gitkeep @@ -0,0 +1 @@ +# .gitkeep file auto-generated at 2026-08-02T20:34:08.964Z for PR creation at branch issue-44-ac3e192dd44c for issue https://github.com/link-foundation/python-ai-driven-development-pipeline-template/issues/44 \ No newline at end of file From 17082719971c1515cd18f0f3b8ade6faf439081e Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 2 Aug 2026 20:38:26 +0000 Subject: [PATCH 2/3] test: guard mypy Python 3.9 compatibility --- tests/test_project_metadata.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/test_project_metadata.py diff --git a/tests/test_project_metadata.py b/tests/test_project_metadata.py new file mode 100644 index 0000000..005687d --- /dev/null +++ b/tests/test_project_metadata.py @@ -0,0 +1,28 @@ +"""Regression tests for project package metadata.""" + +from __future__ import annotations + +from pathlib import Path + +from packaging.requirements import Requirement + +ROOT = Path(__file__).resolve().parents[1] + + +def dev_requirement(name: str) -> Requirement: + """Return one requirement from the project's ``dev`` dependency group.""" + pyproject = (ROOT / "pyproject.toml").read_text(encoding="utf-8") + dev_group = pyproject.split("dev = [", maxsplit=1)[1].split("]", maxsplit=1)[0] + requirement_lines = ( + line.strip().strip('",') for line in dev_group.splitlines() + ) + requirements = (Requirement(line) for line in requirement_lines if line) + return next(requirement for requirement in requirements if requirement.name == name) + + +def test_mypy_dependency_supports_configured_python_target() -> None: + """The dev extra must not install mypy versions that reject Python 3.9.""" + mypy = dev_requirement("mypy") + + assert "1.13.0" in mypy.specifier + assert "2.0" not in mypy.specifier From d5da889ec9fa2205b1cf3db3c936febcc93af443 Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 2 Aug 2026 20:39:26 +0000 Subject: [PATCH 3/3] fix: pin mypy below version 2 --- .gitkeep | 1 - changelog.d/20260802_issue_44_mypy_python_39.md | 4 ++++ pyproject.toml | 2 +- tests/test_project_metadata.py | 4 +--- 4 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 .gitkeep create mode 100644 changelog.d/20260802_issue_44_mypy_python_39.md diff --git a/.gitkeep b/.gitkeep deleted file mode 100644 index 6d0f175..0000000 --- a/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -# .gitkeep file auto-generated at 2026-08-02T20:34:08.964Z for PR creation at branch issue-44-ac3e192dd44c for issue https://github.com/link-foundation/python-ai-driven-development-pipeline-template/issues/44 \ No newline at end of file diff --git a/changelog.d/20260802_issue_44_mypy_python_39.md b/changelog.d/20260802_issue_44_mypy_python_39.md new file mode 100644 index 0000000..9a0d9f1 --- /dev/null +++ b/changelog.d/20260802_issue_44_mypy_python_39.md @@ -0,0 +1,4 @@ +### Fixed + +- Keep the development mypy version below 2.0 while the template supports and + type-checks against Python 3.9. diff --git a/pyproject.toml b/pyproject.toml index 595125a..bd4fca7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ [project.optional-dependencies] dev = [ "ruff>=0.8.0,<0.9", - "mypy>=1.13.0", + "mypy>=1.13.0,<2.0", "pytest>=8.3.0", "pytest-asyncio>=0.24.0", "pytest-cov>=6.0.0", diff --git a/tests/test_project_metadata.py b/tests/test_project_metadata.py index 005687d..6ecc352 100644 --- a/tests/test_project_metadata.py +++ b/tests/test_project_metadata.py @@ -13,9 +13,7 @@ def dev_requirement(name: str) -> Requirement: """Return one requirement from the project's ``dev`` dependency group.""" pyproject = (ROOT / "pyproject.toml").read_text(encoding="utf-8") dev_group = pyproject.split("dev = [", maxsplit=1)[1].split("]", maxsplit=1)[0] - requirement_lines = ( - line.strip().strip('",') for line in dev_group.splitlines() - ) + requirement_lines = (line.strip().strip('",') for line in dev_group.splitlines()) requirements = (Requirement(line) for line in requirement_lines if line) return next(requirement for requirement in requirements if requirement.name == name)