Skip to content

Commit 68ac769

Browse files
acn-ericlawclaude
andcommitted
chore: raise the supported floor to Python 3.11 - 3.10 is end of life
What: requires-python >= 3.11, the 3.10 classifier removed, ruff's target py311 and the modernizations it allows (datetime.UTC, the built-in TimeoutError, fromisoformat with Z, PostOffice.__aenter__ -> Self); the CI matrix 3.11 and 3.14; CHANGELOG with an upgrade note; the memory records the floor and the merges of #83, #84 and #85. Why: Python 3.10 reached its end of life on 2026-10-01 (the developer guide's schedule), so the package no longer declares it - the maintainer's direction. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 86d1367 commit 68ac769

24 files changed

Lines changed: 132 additions & 78 deletions

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# the supported floor and the newest release the package declares (pyproject.toml): the
2222
# floor catches what a user on it would hit (a typing stub, a missing method), the newest the
2323
# deprecations ahead; every gate runs on both
24-
python-version: ['3.10', '3.14']
24+
python-version: ['3.11', '3.14']
2525
name: test (python ${{ matrix.python-version }})
2626
steps:
2727
- uses: actions/checkout@v7

‎CHANGELOG.md‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,15 @@
364364
the Node 20 runtime that `actions/checkout@v4` and `actions/setup-python@v5` declare, and run them on Node 24 with a
365365
deprecation warning. An action declares its own runtime, and Node 24 is the newest GitHub offers, so both move to v7.
366366
In lockstep with the Node pack. **Upgrade note:** none - CI only; nothing in the package changes.
367-
9. **CI tests on the supported floor and the newest Python.** The `test` job runs ruff, basedpyright and pytest on
368-
a matrix of Python 3.10, the floor `pyproject.toml` declares, and 3.14, the newest release it lists; the floor
369-
catches what a user on it would hit (a typing stub, a missing method - as the first run of #84 did), the newest
370-
the deprecations ahead. `fail-fast` is off so both results show.
367+
9. **The supported floor rises to Python 3.11, and CI tests on the floor and the newest Python.** Python 3.10 reached
368+
its end of life on 2026-10-01 (the developer guide's release schedule), so the package no longer declares it:
369+
`requires-python >= 3.11`, the classifiers from 3.11 to 3.14, ruff's target `py311` - and with it the
370+
modernizations the target allows (`datetime.UTC`, the built-in `TimeoutError`, `fromisoformat` reading a trailing
371+
`Z`, `PostOffice.__aenter__` returning `Self`). The `test` job runs ruff, basedpyright and pytest on a matrix of
372+
3.11, the floor, and 3.14, the newest release the package lists - the floor catches what a user on it would hit
373+
(a typing stub, a missing method, as the first run of #84 did on 3.10), the newest the deprecations ahead;
374+
`fail-fast` is off so both results show. **Upgrade note:** an installation on Python 3.10 stays on 4.12.30 until
375+
it moves to a supported interpreter; `pip` refuses the next release there by the declared floor.
371376

372377
## Version 4.12.30, 11/16/2026
373378

‎extensions/agent-question/agent_question.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import sys
4444
from collections.abc import Mapping, Sequence
4545
from dataclasses import dataclass
46-
from datetime import datetime, timezone
46+
from datetime import UTC, datetime
4747
from typing import Any, Protocol
4848

4949
import aiohttp
@@ -144,8 +144,8 @@ def parse_iso(text: str) -> datetime | None:
144144
except ValueError:
145145
return None
146146
if value.tzinfo is None:
147-
value = value.replace(tzinfo=timezone.utc)
148-
return value.astimezone(timezone.utc)
147+
value = value.replace(tzinfo=UTC)
148+
return value.astimezone(UTC)
149149

150150

151151
# --- configuration ----------------------------------------------------------------------------
@@ -928,7 +928,7 @@ async def events(request: web.Request) -> web.StreamResponse:
928928
while True:
929929
try:
930930
row = await asyncio.wait_for(queue.get(), (ping_ms / 1000) if ping_ms > 0 else None)
931-
except asyncio.TimeoutError:
931+
except TimeoutError:
932932
await response.write(b": ping\n\n")
933933
continue
934934
if row is None:
@@ -1009,7 +1009,7 @@ async def _forward(url: str, body: dict[str, Any], settings: Settings) -> tuple[
10091009
except ValueError:
10101010
parsed = {"text": text[:500]}
10111011
return response.status, parsed, None
1012-
except (aiohttp.ClientError, asyncio.TimeoutError) as exc:
1012+
except (TimeoutError, aiohttp.ClientError) as exc:
10131013
return None, None, type(exc).__name__
10141014

10151015

‎extensions/agent-tools/agent_tools.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
from collections import deque
5959
from collections.abc import Awaitable, Callable
6060
from dataclasses import dataclass
61-
from datetime import datetime, timezone
61+
from datetime import UTC, datetime
6262
from html.parser import HTMLParser
6363
from pathlib import Path, PurePosixPath, PureWindowsPath
6464
from typing import Any
@@ -760,7 +760,7 @@ def decode_utf8(data: bytes, *, truncated: bool) -> str | None:
760760

761761

762762
def _modified(stat: Any) -> str:
763-
moment = datetime.fromtimestamp(stat.st_mtime, tz=timezone.utc)
763+
moment = datetime.fromtimestamp(stat.st_mtime, tz=UTC)
764764
return moment.isoformat(timespec="seconds").replace("+00:00", "Z")
765765

766766

@@ -1750,7 +1750,7 @@ async def fetch(self, url: str) -> Fetched:
17501750
data=bytes(data),
17511751
truncated=truncated,
17521752
)
1753-
except asyncio.TimeoutError as exc:
1753+
except TimeoutError as exc:
17541754
raise AppException(
17551755
408, f"{host} did not answer within {self.sandbox.timeout_ms} ms"
17561756
) from exc
@@ -2561,7 +2561,7 @@ async def time_now(_headers: dict[str, str], body: Body) -> Any:
25612561
args = _arguments(body, TIME_NOW_ROW)
25622562
name = _string(args, "timezone", default="UTC").strip() or "UTC"
25632563
if name.upper() == "UTC":
2564-
zone: Any = timezone.utc
2564+
zone: Any = UTC
25652565
name = "UTC"
25662566
else:
25672567
try:
@@ -2570,7 +2570,7 @@ async def time_now(_headers: dict[str, str], body: Body) -> Any:
25702570
raise AppException(
25712571
400, f"{name} is not a time zone - an IANA name such as Europe/Berlin"
25722572
) from exc
2573-
now = datetime.now(timezone.utc)
2573+
now = datetime.now(UTC)
25742574
local = now.astimezone(zone)
25752575
offset = local.strftime("%z")
25762576
return {

‎extensions/ask-person/ask_person.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
import time
5858
from collections.abc import Mapping, Sequence
5959
from dataclasses import dataclass, replace
60-
from datetime import datetime, timedelta, timezone
60+
from datetime import UTC, datetime, timedelta
6161
from typing import Any, Protocol
6262

6363
import aiohttp
@@ -189,8 +189,8 @@ def parse_iso(text: str) -> datetime | None:
189189
except ValueError:
190190
return None
191191
if value.tzinfo is None:
192-
value = value.replace(tzinfo=timezone.utc)
193-
return value.astimezone(timezone.utc)
192+
value = value.replace(tzinfo=UTC)
193+
return value.astimezone(UTC)
194194

195195

196196
# --- configuration ----------------------------------------------------------------------------
@@ -601,7 +601,7 @@ def build_event(message: Message, key: bytes, reply_url: str) -> dict[str, Any]:
601601
event["ttl"] = message.ttl
602602
event["requested_at"] = message.requested_at
603603
if message.kind in WAIT_KINDS and message.ttl_ms is not None:
604-
requested = parse_iso(message.requested_at) or datetime.now(timezone.utc)
604+
requested = parse_iso(message.requested_at) or datetime.now(UTC)
605605
expires_at = requested + timedelta(milliseconds=message.ttl_ms)
606606
ticket = issue_ticket(ticket_payload(message, expires_at), key)
607607
event["expires_at"] = iso_utc(expires_at)
@@ -1513,7 +1513,7 @@ async def _engine(request: EngineRequest, timeout_ms: int) -> tuple[int, dict[st
15131513
) as response:
15141514
text = await response.text()
15151515
return map_outcome(response.status, text, None)
1516-
except (aiohttp.ClientError, asyncio.TimeoutError) as exc:
1516+
except (TimeoutError, aiohttp.ClientError) as exc:
15171517
log.warning("The graph at %s did not answer - %s", request.url, type(exc).__name__)
15181518
return map_outcome(None, None, type(exc).__name__)
15191519

@@ -1705,7 +1705,7 @@ def inspect(words: list[str]) -> int:
17051705
except TicketError as exc:
17061706
print(f"{exc.status} {exc.message}")
17071707
return 1
1708-
expires = datetime.fromtimestamp(payload["e"], tz=timezone.utc)
1708+
expires = datetime.fromtimestamp(payload["e"], tz=UTC)
17091709
print(json.dumps({**payload, "expires_at": iso_utc(expires)}, indent=2))
17101710
return 0
17111711

‎extensions/llm-helper/llm_helper.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ async def audit_single_idle() -> None:
21292129

21302130
def _plus_seconds(stamp: str, seconds: int) -> str:
21312131
"""An ISO-8601 UTC stamp moved by seconds (the conversation row's expires_at)."""
2132-
moment = datetime.fromisoformat(stamp.replace("Z", "+00:00"))
2132+
moment = datetime.fromisoformat(stamp)
21332133
return iso_utc(moment + timedelta(seconds=seconds))
21342134

21352135

‎extensions/mcp-binding/mcp_binding.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ async def call(self, name: str, arguments: dict[str, Any]) -> Any:
390390
def _leaf(exc: BaseException) -> BaseException:
391391
"""The first leaf of an exception group: the SDK's transports run in a task group, which wraps
392392
the failure of the code inside them."""
393-
# duck-typed, so Python 3.10 (where the group class is anyio's backport) reads the same
393+
# duck-typed: the SDK's group class is anyio's, the same shape as the built-in ExceptionGroup
394394
while isinstance(getattr(exc, "exceptions", None), (list, tuple)) and exc.exceptions: # type: ignore[attr-defined]
395395
exc = exc.exceptions[0] # type: ignore[attr-defined]
396396
return exc

‎memory/continuity.md‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
> Canonical live home for the current stack — language version, dependencies, tool
5555
> versions. `instructions.md` keeps only a high-level descriptor and points here.
5656
57-
- Runtime deps: `aiohttp` >=3.10,<4 (Event API host), `msgpack` >=1,<2 (envelope codec),
57+
- Python >= 3.11 (the floor since 2026-11-25: 3.10 reached end of life on 2026-10-01, Eric's direction from the
58+
developer guide's schedule; CI tests the floor and the newest release, 3.14); build backend hatchling, the wheel
59+
from `src/mercury_composable`. Runtime deps: `aiohttp` >=3.10,<4 (Event API host), `msgpack` >=1,<2 (envelope codec),
5860
`PyYAML` >=6,<7 (config); dev: `pytest` >=8 + `pytest-asyncio` >=0.23 (`asyncio_mode=auto`), `ruff` >=0.9, and
5961
the helper's backends for its tests (`anthropic[bedrock]`, `redis`, `fakeredis[lua]` >=2.26);
6062
optional extras, all for the LLM helper (`extensions/llm-helper`; the package itself stays SDK-free): `llm` = `anthropic`
@@ -64,7 +66,7 @@
6466
built-in agent tools (`extensions/agent-tools`): `graph` = `neo4j` >=6,<7 (the knowledge-graph tools over Bolt) and
6567
`documents` = `pypdf` >=6,<7 + `python-docx` >=1.1,<2 (`file.extract`), both 2026-11-17, and for the ask-a-person
6668
main flow (`extensions/ask-person`): `ask` = `PyJWT[crypto]` >=2.9,<3 (the reply page's `oauth2` mode), 2026-11-19
67-
<!-- id: stack-deps-aiohttp-msgpack | created: 2026-08-22 | last_used: 2026-11-19 | uses: 8 | tier: archive-candidate | origin: 2026-08-22-171555 -->
69+
<!-- id: stack-deps-aiohttp-msgpack | created: 2026-08-22 | last_used: 2026-11-25 | uses: 9 | tier: active | origin: 2026-08-22-171555 -->
6870
6971
## Architectural Invariants
7072

@@ -320,7 +322,7 @@
320322
([[static-content-resources-public]]), the engines' actuator endpoints beside it for Kubernetes probes (Eric).
321323
**Driven live 2026-11-20** with the React UI (mercury-composable `docs/test-reports/agent-question-ui-live-drive.md`);
322324
the streams end when the application stops ([[platform-on-shutdown-hook]]).
323-
<!-- id: agent-question-app | created: 2026-11-19 | last_used: 2026-11-20 | uses: 7 | tier: active | origin: 2026-11-19-071444 -->
325+
<!-- id: agent-question-app | created: 2026-11-19 | last_used: 2026-11-20 | uses: 7 | tier: archive-candidate | origin: 2026-11-19-071444 -->
324326

325327
- **The host serves static web content from `resources/public` next to the application file - the engines' `public`
326328
folder (Eric, 2026-11-20; PR #73, the Node twin mercury-nodejs #138).** `static.html.folder` is honoured as the Java
@@ -350,7 +352,7 @@
350352
reconnect to the next instance from their last sequence; the cleanup (`on_cleanup`) still closes the stores after
351353
the last request. **How to apply:** a stream or a socket ends in `on_shutdown`, a store closes in `on_cleanup`;
352354
never a shorter `shutdown_timeout` as the remedy - only the extension knows a response is a stream.
353-
<!-- id: platform-on-shutdown-hook | created: 2026-11-20 | last_used: 2026-11-20 | uses: 1 | tier: active | origin: 2026-11-20-094019 -->
355+
<!-- id: platform-on-shutdown-hook | created: 2026-11-20 | last_used: 2026-11-20 | uses: 1 | tier: archive-candidate | origin: 2026-11-20-094019 -->
354356

355357
- **REST automation in the pack: `rest.yaml` is the router in front of the functions, the engines' grammar and never a
356358
dialect (RFC-0018 in mercury-composable, agreed by Eric 2026-11-25; built here the same day as build plan step 1,
@@ -365,23 +367,25 @@
365367
refused by name at load: a flow binding, the HTTP relay, the A/B dual service; `upload: true` is the pack's
366368
bounded form (the files' bytes in the request map within `rest.upload.max.bytes`, `AsyncHttpRequest.files()`;
367369
the LLM helper's `llm.upload` the first intake, 2026-11-25). The edge records
368-
`http.request` and the function's round trip as the engines do, so the forwarder's SERVER kind holds. **How to
370+
`http.request` and the function's round trip as the engines do, so the forwarder's SERVER kind holds. **MERGED
371+
2026-11-25:** step 1 as PR #83 (`b4f9c09`), upload as PR #84 (`2cda53f`); the CI matrix as PR #85 (`86d1367`). **How to
369372
apply:** a new endpoint is a `rest.yaml` entry and a `@preload` function reading `AsyncHttpRequest(body)`, never a
370373
mounted route; a behaviour of the edge is first a vector case, then code, in both packs; the grammar's messages
371374
are the engines' and a pack never grows a dialect; what the engines defer stays deferred until a field request.
372-
<!-- id: rest-automation-python | created: 2026-11-25 | last_used: 2026-11-25 | uses: 2 | tier: active | origin: 2026-11-25-005844 -->
375+
<!-- id: rest-automation-python | created: 2026-11-25 | last_used: 2026-11-25 | uses: 3 | tier: active | origin: 2026-11-25-005844 -->
373376

374377
## Conventions
375378

376379
- **Quality gates (adopted 2026-08-23, Eric's IDE review round): ruff + basedpyright +
377-
pytest, config lives in pyproject.toml.** ruff: line-length 100, py310, isort extend.
380+
pytest, config lives in pyproject.toml.** ruff: line-length 100, py311 (the floor rose from 3.10 on
381+
2026-11-25, 3.10 being end of life since 2026-10-01 - Eric, from the developer guide's schedule), isort extend.
378382
basedpyright: standard mode + reportMissingParameterType=error, TESTS INCLUDED (Eric's
379383
ruling — test signatures are annotated; handlers take `(dict[str, str], Body)`).
380384
`agent-skills/` excluded from both (tool-managed by agent-memory — style fixes belong
381385
upstream). Run: `uvx ruff check .` / `uvx basedpyright` / `.venv/bin/pytest -q`.
382386
Unused contract params take the underscore prefix; deliberate suppressions carry
383387
rationale comments (PyBroadException / noqa only where the rule actually fires).
384-
<!-- id: conv-python-quality-gates | created: 2026-08-23 | last_used: 2026-11-25 | uses: 18 | tier: active | origin: 2026-08-23-005709 -->
388+
<!-- id: conv-python-quality-gates | created: 2026-08-23 | last_used: 2026-11-25 | uses: 19 | tier: active | origin: 2026-08-23-005709 -->
385389
- Engine-mirrored configuration/logging/trace conventions (see the invariant above and
386390
`instructions.md`); GitHub flow with tests + a CHANGELOG entry per change
387391
(CONTRIBUTING.md).

‎memory/open-threads/thread-bp-llm-attachments-python.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
`upload: true`) saves uploaded documents under `uploads/` inside the root and returns the references a call
3131
names in `attachments` - Eric's AI SDLC use case, documents uploaded to the helper for context, rules and
3232
formula extraction; `attachable` tells a PDF or an image from a file that needs a conversion first; the
33-
object-store download stays the later iteration (branch `feat/rest-upload`).
33+
object-store download stays the later iteration (PR #84, MERGED 2026-11-25).
3434
→ proposal: RFC-0016 (mercury-composable)
3535
→ serves: vision-mercury-python
36-
<!-- id: bp-llm-attachments-python | created: 2026-11-24 | last_used: 2026-11-25 | uses: 2 | tier: working | origin: 2026-11-24-055310 -->
36+
<!-- id: bp-llm-attachments-python | created: 2026-11-24 | last_used: 2026-11-25 | uses: 3 | tier: working | origin: 2026-11-24-055310 -->

‎memory/open-threads/thread-bp-question-record-and-ui.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
manager's grace period ends it ([[platform-on-shutdown-hook]]). Follow-ups outside this thread: the reply page's own
88
sign-in against an issuer; `llm.transcript.audit.instances`. The narrative: logs 2026-11-20-075621 to 2026-11-20-094019.
99
→ serves: vision-mercury-python
10-
<!-- id: bp-question-record-and-ui | created: 2026-11-20 | last_used: 2026-11-20 | uses: 4 | tier: active | origin: 2026-11-20-075621 -->
10+
<!-- id: bp-question-record-and-ui | created: 2026-11-20 | last_used: 2026-11-20 | uses: 4 | tier: archive-candidate | origin: 2026-11-20-075621 -->

0 commit comments

Comments
 (0)