Skip to content

Commit 3a96533

Browse files
committed
Set minimum python version to 3.11
1 parent 03144ac commit 3a96533

File tree

8 files changed

+18
-28
lines changed

8 files changed

+18
-28
lines changed

docs/source/about/changelog.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Unreleased
1717

1818
**Added**
1919

20-
- :pull:`1113` - Added support for Python 3.12 and 3.13.
20+
- :pull:`1113` - Added support for Python 3.12, 3.13, and 3.14.
2121
- :pull:`1281` - Added type hints to ``reactpy.html`` attributes.
2222
- :pull:`1285` - Added support for nested components in web modules
2323
- :pull:`1289` - Added support for inline JavaScript as event handlers or other attributes that expect a callable via ``reactpy.types.InlineJavaScript``
@@ -67,9 +67,9 @@ Unreleased
6767

6868
**Removed**
6969

70+
- :pull:`1113` - Removed support for Python 3.9 and 3.10.
7071
- :pull:`1255` - Removed the ability to import ``reactpy.html.*`` elements directly. You must now call ``html.*`` to access the elements.
7172
- :pull:`1113` - Removed backend specific installation extras (such as ``pip install reactpy[starlette]``).
72-
- :pull:`1113` - Removed support for Python 3.9.
7373
- :pull:`1264` - Removed support for async functions within ``reactpy.use_effect`` hook. Use ``reactpy.use_async_effect`` instead.
7474
- :pull:`1113` - Removed deprecated function ``module_from_template``.
7575
- :pull:`1311` - Removed deprecated exception type ``reactpy.core.serve.Stop``.

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ authors = [
2828
{ name = "Mark Bakhit", email = "archiethemonger@gmail.com" },
2929
{ name = "Ryan Morshead", email = "ryan.morshead@gmail.com" },
3030
]
31-
requires-python = ">=3.10"
31+
requires-python = ">=3.11"
3232
classifiers = [
3333
"Development Status :: 5 - Production/Stable",
3434
"Programming Language :: Python",
35-
"Programming Language :: Python :: 3.10",
3635
"Programming Language :: Python :: 3.11",
3736
"Programming Language :: Python :: 3.12",
3837
"Programming Language :: Python :: 3.13",
@@ -45,7 +44,6 @@ dependencies = [
4544
"requests >=2",
4645
"lxml >=4",
4746
"anyio >=3",
48-
"typing-extensions >=3.10",
4947
]
5048
dynamic = ["version"]
5149
urls.Changelog = "https://reactpy.dev/docs/about/changelog.html"
@@ -108,7 +106,7 @@ extra-dependencies = [
108106
features = ["all"]
109107

110108
[[tool.hatch.envs.hatch-test.matrix]]
111-
python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
109+
python = ["3.11", "3.12", "3.13", "3.14"]
112110

113111
[tool.pytest.ini_options]
114112
addopts = ["--strict-config", "--strict-markers"]

src/reactpy/executors/asgi/middleware.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
from collections.abc import Iterable
99
from dataclasses import dataclass
1010
from pathlib import Path
11-
from typing import Any
11+
from typing import Any, Unpack
1212

1313
import orjson
1414
from asgi_tools import ResponseText, ResponseWebSocket
1515
from asgiref.compatibility import guarantee_single_callable
1616
from servestatic import ServeStaticASGI
17-
from typing_extensions import Unpack
1817

1918
from reactpy import config
2019
from reactpy.core.hooks import ConnectionContext

src/reactpy/executors/asgi/pyscript.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
import re
55
from collections.abc import Sequence
66
from dataclasses import dataclass
7-
from datetime import datetime, timezone
7+
from datetime import UTC, datetime
88
from email.utils import formatdate
99
from pathlib import Path
10-
from typing import Any
11-
12-
from typing_extensions import Unpack
10+
from typing import Any, Unpack
1311

1412
from reactpy import html
1513
from reactpy.executors.asgi.middleware import ReactPyMiddleware
@@ -118,6 +116,4 @@ def render_index_html(self) -> None:
118116
"</html>"
119117
)
120118
self._etag = f'"{hashlib.md5(self._index_html.encode(), usedforsecurity=False).hexdigest()}"'
121-
self._last_modified = formatdate(
122-
datetime.now(tz=timezone.utc).timestamp(), usegmt=True
123-
)
119+
self._last_modified = formatdate(datetime.now(tz=UTC).timestamp(), usegmt=True)

src/reactpy/executors/asgi/standalone.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
import re
55
from collections.abc import Callable
66
from dataclasses import dataclass
7-
from datetime import datetime, timezone
7+
from datetime import UTC, datetime
88
from email.utils import formatdate
99
from logging import getLogger
10-
from typing import Literal, cast, overload
10+
from typing import Literal, Unpack, cast, overload
1111

1212
from asgi_tools import ResponseHTML
13-
from typing_extensions import Unpack
1413

1514
from reactpy import html
1615
from reactpy.executors.asgi.middleware import ReactPyMiddleware
@@ -240,6 +239,4 @@ def render_index_html(self) -> None:
240239
"</html>"
241240
)
242241
self._etag = f'"{hashlib.md5(self._index_html.encode(), usedforsecurity=False).hexdigest()}"'
243-
self._last_modified = formatdate(
244-
datetime.now(tz=timezone.utc).timestamp(), usegmt=True
245-
)
242+
self._last_modified = formatdate(datetime.now(tz=UTC).timestamp(), usegmt=True)

src/reactpy/pyscript/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def get_reactpy_versions() -> dict[Any, Any]:
219219
response = request.urlopen("https://pypi.org/pypi/reactpy/json", timeout=5)
220220
except Exception:
221221
response = request.urlopen("http://pypi.org/pypi/reactpy/json", timeout=5)
222-
if response.status == 200:
222+
if response.status == 200: # noqa: PLR2004
223223
data = json.load(response)
224224
versions = list(data.get("releases", {}).keys())
225225
latest = data.get("info", {}).get("version", "")

src/reactpy/testing/common.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
import time
88
from collections.abc import Awaitable, Callable, Coroutine
99
from functools import wraps
10-
from typing import Any, Generic, TypeVar, cast
10+
from typing import Any, Generic, ParamSpec, TypeVar, cast
1111
from uuid import uuid4
1212
from weakref import ref
1313

14-
from typing_extensions import ParamSpec
15-
1614
from reactpy.config import REACTPY_TESTS_DEFAULT_TIMEOUT, REACTPY_WEB_MODULES_DIR
1715
from reactpy.core._life_cycle_hook import HOOK_STACK, LifeCycleHook
1816
from reactpy.core.events import EventHandler, to_event_handler_function
@@ -71,7 +69,7 @@ async def until(
7169
break
7270
elif (time.time() - started_at) > timeout: # nocov
7371
msg = f"Expected {description} after {timeout} seconds - last value was {result!r}"
74-
raise asyncio.TimeoutError(msg)
72+
raise TimeoutError(msg)
7573

7674
async def until_is(
7775
self,

src/reactpy/types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
Any,
1010
Generic,
1111
Literal,
12+
NamedTuple,
13+
NotRequired,
1214
Protocol,
1315
TypeAlias,
16+
TypedDict,
1417
TypeVar,
18+
Unpack,
1519
overload,
1620
)
1721

18-
from typing_extensions import NamedTuple, NotRequired, TypedDict, Unpack
19-
2022
CarrierType = TypeVar("CarrierType")
2123
_Type = TypeVar("_Type")
2224

0 commit comments

Comments
 (0)