diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd790f9..4b49217 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.12.3 + rev: v0.15.2 hooks: # Run the linter. - id: ruff-check @@ -9,6 +9,6 @@ repos: # Run the formatter. - id: ruff-format - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.5.0" + rev: v2.16.2 hooks: - - id: pyproject-fmt \ No newline at end of file + - id: pyproject-fmt diff --git a/examples/django/pyproject.toml b/examples/django/pyproject.toml index 6deb45d..5e1beb2 100644 --- a/examples/django/pyproject.toml +++ b/examples/django/pyproject.toml @@ -10,6 +10,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] dependencies = [ "daphne>=4.2", @@ -17,5 +18,5 @@ dependencies = [ "django>=5.2.1", ] -[tool.uv.sources] -datastar-py = { path = "../../" } +[tool.uv] +sources.datastar-py = { path = "../../" } diff --git a/pyproject.toml b/pyproject.toml index 77a97fc..61d0868 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,5 @@ [build-system] build-backend = "hatchling.build" - requires = [ "hatchling" ] [project] @@ -39,9 +38,9 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] - -dependencies = [ ] +dependencies = [] urls.Documentation = "https://github.com/starfederation/datastar-python/blob/develop/README.md" urls.GitHub = "https://github.com/starfederation/datastar-python" diff --git a/src/datastar_py/django.py b/src/datastar_py/django.py index 1c14b92..64e39e9 100644 --- a/src/datastar_py/django.py +++ b/src/datastar_py/django.py @@ -1,8 +1,8 @@ from __future__ import annotations -from collections.abc import Awaitable, Mapping +from collections.abc import Awaitable, Callable, Mapping from functools import wraps -from typing import Any, Callable, ParamSpec +from typing import Any, ParamSpec from django.http import HttpRequest from django.http import StreamingHttpResponse as _StreamingHttpResponse diff --git a/src/datastar_py/fastapi.py b/src/datastar_py/fastapi.py index 9368f50..7625b04 100644 --- a/src/datastar_py/fastapi.py +++ b/src/datastar_py/fastapi.py @@ -1,4 +1,4 @@ -from typing import Annotated, Any, Union +from typing import Annotated, Any from fastapi import Depends @@ -15,4 +15,4 @@ ] -ReadSignals = Annotated[Union[dict[str, Any], None], Depends(read_signals)] +ReadSignals = Annotated[dict[str, Any] | None, Depends(read_signals)] diff --git a/src/datastar_py/litestar.py b/src/datastar_py/litestar.py index 97a3a5f..7492547 100644 --- a/src/datastar_py/litestar.py +++ b/src/datastar_py/litestar.py @@ -1,11 +1,10 @@ from __future__ import annotations -from collections.abc import Awaitable, Mapping +from collections.abc import Awaitable, Callable, Mapping from functools import wraps from typing import ( TYPE_CHECKING, Any, - Callable, ParamSpec, ) diff --git a/src/datastar_py/quart.py b/src/datastar_py/quart.py index 90c3cb4..1866523 100644 --- a/src/datastar_py/quart.py +++ b/src/datastar_py/quart.py @@ -1,9 +1,9 @@ from __future__ import annotations -from collections.abc import Awaitable, Mapping +from collections.abc import Awaitable, Callable, Mapping from functools import wraps from inspect import isasyncgen, isasyncgenfunction, isgenerator -from typing import Any, Callable, ParamSpec +from typing import Any, ParamSpec from quart import Response, copy_current_request_context, request, stream_with_context diff --git a/src/datastar_py/sanic.py b/src/datastar_py/sanic.py index 283465a..878ac8e 100644 --- a/src/datastar_py/sanic.py +++ b/src/datastar_py/sanic.py @@ -1,10 +1,10 @@ from __future__ import annotations -from collections.abc import Awaitable, Collection, Mapping +from collections.abc import Awaitable, Callable, Collection, Mapping from contextlib import aclosing, closing from functools import wraps from inspect import isasyncgen, isgenerator -from typing import Any, Callable, ParamSpec, Union +from typing import Any, ParamSpec from sanic import HTTPResponse, Request @@ -92,7 +92,7 @@ async def wrapper(*args: P.args, **kwargs: P.kwargs) -> DatastarResponse | None: return None return DatastarResponse(r) - wrapper.__annotations__["return"] = Union[DatastarResponse, None] + wrapper.__annotations__["return"] = DatastarResponse | None return wrapper diff --git a/src/datastar_py/sse.py b/src/datastar_py/sse.py index e051344..c5f7577 100644 --- a/src/datastar_py/sse.py +++ b/src/datastar_py/sse.py @@ -3,7 +3,7 @@ import json from collections.abc import AsyncIterable, Iterable, Mapping from itertools import chain -from typing import Literal, Protocol, TypeAlias, Union, overload, runtime_checkable +from typing import Literal, Protocol, TypeAlias, overload, runtime_checkable import datastar_py.consts as consts from datastar_py.attributes import _escape @@ -32,9 +32,9 @@ class DatastarEvent(str): # 0..N datastar events -DatastarEvents: TypeAlias = Union[ - DatastarEvent, Iterable[DatastarEvent], AsyncIterable[DatastarEvent], None -] +DatastarEvents: TypeAlias = ( + DatastarEvent | Iterable[DatastarEvent] | AsyncIterable[DatastarEvent] | None +) class ServerSentEventGenerator: diff --git a/src/datastar_py/starlette.py b/src/datastar_py/starlette.py index 53989af..60b4aac 100644 --- a/src/datastar_py/starlette.py +++ b/src/datastar_py/starlette.py @@ -1,11 +1,10 @@ from __future__ import annotations -from collections.abc import Awaitable, Mapping +from collections.abc import Awaitable, Callable, Mapping from functools import wraps from typing import ( TYPE_CHECKING, Any, - Callable, ParamSpec, )