From 951b00e263d90909cb5eb01669441ef868eaa380 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sat, 29 Aug 2026 11:46:10 +0200 Subject: [PATCH] Grade the todo MCP against 3.14 too, not just run on it ruff and mypy were still grading `mcp/` against 3.10 while `requires-python` had already moved to 3.14, so `datetime.timezone.utc` survived where `datetime.UTC` is now correct (UP017). `pin_ci_python.py` rewrites the knobs; ruff's `--select UP,I,F401 --fix` did the rest. `mcp/` has no ruff hook in `.pre-commit-config.yaml`, so it also carries six pre-existing CPY001 (missing copyright notice) findings. Those fire identically at py310 and are left alone -- they are not this change's to fix. 24 tests pass at 100% line and branch coverage. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01SfnJmxxsZ534AKk16rC2Gr --- mcp/pyproject.toml | 4 ++-- mcp/todo_mcp/_mcp.py | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mcp/pyproject.toml b/mcp/pyproject.toml index 4e580e1..00129af 100644 --- a/mcp/pyproject.toml +++ b/mcp/pyproject.toml @@ -19,7 +19,7 @@ include = ["todo_mcp*"] # RUFF - Fast Python linter and formatter # ============================================================================ [tool.ruff] -target-version = "py310" +target-version = "py314" include = ["*.py", "**/*.py"] exclude = [".git", ".venv", "__pycache__", "build", "dist", ".eggs"] @@ -65,7 +65,7 @@ docstring-code-format = true # MYPY - Static type checker # ============================================================================ [tool.mypy] -python_version = "3.10" +python_version = "3.14" strict = true warn_return_any = true warn_unused_configs = true diff --git a/mcp/todo_mcp/_mcp.py b/mcp/todo_mcp/_mcp.py index 44d492a..97f9d02 100644 --- a/mcp/todo_mcp/_mcp.py +++ b/mcp/todo_mcp/_mcp.py @@ -23,7 +23,7 @@ file yields a graceful "please export it" message rather than an error. from __future__ import annotations -from datetime import datetime, timezone +from datetime import UTC, datetime import logging import os from pathlib import Path @@ -83,7 +83,7 @@ def _load_backlog() -> tuple[bool, list[Note], str | None]: stat = path.stat() except OSError: return False, [], None - mtime = datetime.fromtimestamp(stat.st_mtime, tz=timezone.utc).isoformat() + mtime = datetime.fromtimestamp(stat.st_mtime, tz=UTC).isoformat() notes = parse_backlog(path.read_text(encoding="utf-8")) return True, notes, mtime diff --git a/pubspec.yaml b/pubspec.yaml index ef1463c..2cafb1b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.31+1 +version: 1.0.32+1 environment: sdk: ^3.12.2