Lowered minimum Python version to 3.12 and added CI matrix for testing 3.12/3.13/3.14.
Dependency Audit / Dependency Audit (push) Successful in 17s
CI / Formatting (push) Successful in 14s
CI / Linting (push) Successful in 13s
CI / Tests (Python 3.12) (push) Successful in 28s
CI / Tests (Python 3.13) (push) Successful in 26s
CI / Tests (Python 3.14) (push) Successful in 24s
CI / Type Checking (push) Successful in 27s

This commit is contained in:
2026-02-19 11:31:11 -05:00
parent a276e35fbe
commit 33dd49e20a
29 changed files with 504 additions and 11 deletions
+2
View File
@@ -21,6 +21,8 @@ This module provides the module-facing API for commands:
- CommandHandler type alias
"""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, TypedDict
+2
View File
@@ -21,6 +21,8 @@ This module provides the context objects that handlers receive:
- RouteContext: For HTTP route handlers
"""
from __future__ import annotations
import logging
from dataclasses import dataclass, field
from typing import TYPE_CHECKING
+2
View File
@@ -14,6 +14,8 @@
"""Event dataclasses for Owncast webhook payloads."""
from __future__ import annotations
import logging
import re
from dataclasses import dataclass
+2
View File
@@ -20,6 +20,8 @@ This module provides the module-facing API for event handlers:
- EventHandler type alias
"""
from __future__ import annotations
from enum import IntEnum
from typing import TYPE_CHECKING, Any, TypedDict
+2
View File
@@ -14,6 +14,8 @@
"""Async HTTP client for the Owncast Admin API."""
from __future__ import annotations
import logging
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any
+6 -3
View File
@@ -14,11 +14,14 @@
"""Async HTTP client for the Owncast Integration API."""
from __future__ import annotations
import json
import logging
from typing import TYPE_CHECKING, Any
import aiohttp
from aiohttp import ContentTypeError
if TYPE_CHECKING:
from .http_client import HttpClient
@@ -35,7 +38,7 @@ def _extract_error(text: str) -> str:
"""
try:
data = json.loads(text)
except ValueError, TypeError:
except (ValueError, TypeError):
return text
if isinstance(data, dict):
if "error" in data:
@@ -236,7 +239,7 @@ class OwncastClient:
if response.content_type == "application/json":
try:
result = await response.json()
except ValueError, aiohttp.ContentTypeError:
except (ValueError, ContentTypeError):
text = await response.text()
self._logger.error(f"Invalid JSON on POST {endpoint}: {text}")
raise OwncastError(response.status, text) from None
@@ -295,7 +298,7 @@ class OwncastClient:
self._logger.debug(f"GET {endpoint} -> {response.status}")
try:
result = await response.json()
except ValueError, aiohttp.ContentTypeError:
except (ValueError, ContentTypeError):
text = await response.text()
self._logger.error(f"Invalid JSON on GET {endpoint}: {text}")
raise OwncastError(response.status, text) from None
+2
View File
@@ -20,6 +20,8 @@ This module provides the module-facing API for HTTP routes:
- RouteHandler type alias
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, TypedDict
+2
View File
@@ -14,6 +14,8 @@
"""SQLite storage API for Owlbot modules."""
from __future__ import annotations
import asyncio
import contextvars
import logging
+2
View File
@@ -14,6 +14,8 @@
"""Main bot class that ties together the webhook server, modules, and Owncast API."""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Any
@@ -14,6 +14,8 @@
"""Shared custom command handler and database/registry helpers."""
from __future__ import annotations
from datetime import UTC, datetime
from typing import TYPE_CHECKING
@@ -14,6 +14,8 @@
"""Management commands for custom commands (add, edit, delete, etc.)."""
from __future__ import annotations
from datetime import UTC, datetime
from typing import TYPE_CHECKING
@@ -21,6 +21,8 @@ arguments; the engine immediately stops processing and returns ``str(e)`` as
the entire response, discarding any other template content.
"""
from __future__ import annotations
import random
import re
from collections.abc import Awaitable, Callable
@@ -40,6 +40,8 @@ Example AST::
PlaceholderNode("2", [])])]
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING
@@ -14,6 +14,8 @@
"""Moderator commands for managing timers."""
from __future__ import annotations
import re
from datetime import UTC, datetime
from typing import TYPE_CHECKING
+3 -1
View File
@@ -19,6 +19,8 @@ messages at the right moment. Also provides interval parsing utilities and
shared state for chat line counting.
"""
from __future__ import annotations
import asyncio
import contextlib
import re
@@ -160,7 +162,7 @@ def _next_fire_time(row: aiosqlite.Row, now: datetime) -> datetime | None:
try:
anchor = last_fired_dt if last_fired_dt is not None else now
return next(CronSim(row["interval_value"], anchor))
except ValueError, KeyError, CronSimError:
except (ValueError, KeyError, CronSimError):
return None
+2
View File
@@ -14,6 +14,8 @@
"""HTTP server for Owlbot."""
from __future__ import annotations
import asyncio
import logging
from collections.abc import Awaitable, Callable, Coroutine
+2
View File
@@ -14,6 +14,8 @@
"""Dynamic module loading for Owlbot."""
from __future__ import annotations
import importlib.util
import logging
import sys
+2
View File
@@ -17,6 +17,8 @@
Internal infrastructure for managing command registration and dispatch.
"""
from __future__ import annotations
import asyncio
import logging
import math
+2
View File
@@ -17,6 +17,8 @@
Internal infrastructure for managing event handler registration and dispatch.
"""
from __future__ import annotations
import asyncio
import logging
import time
+2
View File
@@ -17,6 +17,8 @@
Internal infrastructure for managing HTTP route registration and dispatch.
"""
from __future__ import annotations
import asyncio
import logging
import time