Skip to content

Commit b441d3e

Browse files
feat: add Python 3.10 support
- Lower requires-python from >=3.11 to >=3.10 (aligns with pydantic-ai) - Add 3.10 to CI test matrix - Use asyncio.TimeoutError with noqa for ruff UP041 (TimeoutError is not an alias for asyncio.TimeoutError until 3.11) - Update ruff target-version to py310 - Update README and classifiers The codebase already uses `from __future__ import annotations` everywhere, so PEP 604 union syntax and lowercase generics work on 3.10. No other 3.11-only features are used (no match/case, ExceptionGroup, TaskGroup, tomllib, StrEnum, or Self). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 86598a8 commit b441d3e

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.11", "3.12", "3.13"]
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1515
steps:
1616
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.2.2
1717
- uses: astral-sh/setup-uv@e4db8464a088ece1b920f60402e813ea4de65b8f # v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async def handle_mention(thread, message):
6666
| Feature | chat-sdk | Raw platform SDKs | BotFramework SDK |
6767
|---------|----------|--------------------|------------------|
6868
| Multi-platform from one codebase | 8 platforms | 1 per SDK | Teams + limited |
69-
| Async-native (Python 3.11+) | Yes | Varies | No |
69+
| Async-native (Python 3.10+) | Yes | Varies | No |
7070
| Cross-platform cards | Card model | Platform-specific | Adaptive Cards only |
7171
| Thread locking / dedup | Built-in | DIY | DIY |
7272
| State abstraction (mem/redis/pg) | Built-in | DIY | DIY |

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ version = "0.0.1a11"
44
description = "Multi-platform async chat SDK for Python — port of Vercel Chat"
55
readme = "README.md"
66
license = {text = "MIT"}
7-
requires-python = ">=3.11"
7+
requires-python = ">=3.10"
88
dependencies = []
99
classifiers = [
1010
"Development Status :: 3 - Alpha",
1111
"Framework :: AsyncIO",
1212
"Intended Audience :: Developers",
1313
"License :: OSI Approved :: MIT License",
1414
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python :: 3.10",
1516
"Programming Language :: Python :: 3.11",
1617
"Programming Language :: Python :: 3.12",
1718
"Programming Language :: Python :: 3.13",
@@ -58,7 +59,7 @@ packages = ["src/chat_sdk"]
5859
asyncio_mode = "auto"
5960

6061
[tool.ruff]
61-
target-version = "py311"
62+
target-version = "py310"
6263
line-length = 120
6364

6465
[tool.ruff.lint]

src/chat_sdk/thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ async def _edit_loop() -> None:
579579
try:
580580
await asyncio.wait_for(stop_event.wait(), timeout=interval_s)
581581
break # stop was signaled
582-
except asyncio.TimeoutError:
582+
except asyncio.TimeoutError: # noqa: UP041 — support Python 3.10
583583
pass # interval elapsed, do the edit
584584
if stop_event.is_set() or msg is None:
585585
break

0 commit comments

Comments
 (0)