htmy 0.3.1__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of htmy might be problematic. Click here for more details.
- {htmy-0.3.1 → htmy-0.3.3}/PKG-INFO +3 -2
- {htmy-0.3.1 → htmy-0.3.3}/htmy/__init__.py +1 -0
- {htmy-0.3.1 → htmy-0.3.3}/htmy/core.py +7 -2
- {htmy-0.3.1 → htmy-0.3.3}/htmy/md/typing.py +6 -1
- {htmy-0.3.1 → htmy-0.3.3}/htmy/typing.py +9 -1
- {htmy-0.3.1 → htmy-0.3.3}/pyproject.toml +3 -2
- {htmy-0.3.1 → htmy-0.3.3}/LICENSE +0 -0
- {htmy-0.3.1 → htmy-0.3.3}/README.md +0 -0
- {htmy-0.3.1 → htmy-0.3.3}/htmy/etree.py +0 -0
- {htmy-0.3.1 → htmy-0.3.3}/htmy/html.py +0 -0
- {htmy-0.3.1 → htmy-0.3.3}/htmy/i18n.py +0 -0
- {htmy-0.3.1 → htmy-0.3.3}/htmy/io.py +0 -0
- {htmy-0.3.1 → htmy-0.3.3}/htmy/md/__init__.py +0 -0
- {htmy-0.3.1 → htmy-0.3.3}/htmy/md/core.py +0 -0
- {htmy-0.3.1 → htmy-0.3.3}/htmy/py.typed +0 -0
- {htmy-0.3.1 → htmy-0.3.3}/htmy/renderer.py +0 -0
- {htmy-0.3.1 → htmy-0.3.3}/htmy/utils.py +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: htmy
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Async, pure-Python rendering engine.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Peter Volf
|
|
7
7
|
Author-email: do.volfp@gmail.com
|
|
8
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.10,<4.0
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
@@ -28,6 +28,7 @@ from .typing import ContextProvider as ContextProvider
|
|
|
28
28
|
from .typing import ContextValue as ContextValue
|
|
29
29
|
from .typing import FunctionComponent as FunctionComponent
|
|
30
30
|
from .typing import HTMYComponentType as HTMYComponentType
|
|
31
|
+
from .typing import MutableContext as MutableContext
|
|
31
32
|
from .typing import Properties as Properties
|
|
32
33
|
from .typing import PropertyValue as PropertyValue
|
|
33
34
|
from .typing import SyncComponent as SyncComponent
|
|
@@ -5,7 +5,7 @@ import asyncio
|
|
|
5
5
|
import enum
|
|
6
6
|
from collections.abc import Callable, Container
|
|
7
7
|
from pathlib import Path
|
|
8
|
-
from typing import Any, ClassVar, Generic,
|
|
8
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Generic, TypedDict, cast, overload
|
|
9
9
|
from xml.sax.saxutils import escape as xml_escape
|
|
10
10
|
|
|
11
11
|
from .io import open_file
|
|
@@ -24,6 +24,11 @@ from .typing import (
|
|
|
24
24
|
)
|
|
25
25
|
from .utils import join_components
|
|
26
26
|
|
|
27
|
+
if TYPE_CHECKING:
|
|
28
|
+
from typing_extensions import Self
|
|
29
|
+
else:
|
|
30
|
+
Self = Any
|
|
31
|
+
|
|
27
32
|
# -- Utility components
|
|
28
33
|
|
|
29
34
|
|
|
@@ -238,7 +243,7 @@ class ContextAware:
|
|
|
238
243
|
if isinstance(result, cls):
|
|
239
244
|
return result
|
|
240
245
|
|
|
241
|
-
raise TypeError("
|
|
246
|
+
raise TypeError(f"Invalid context data type for {cls.__name__}.")
|
|
242
247
|
|
|
243
248
|
|
|
244
249
|
# -- Function components
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
from collections.abc import Callable
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeAlias, TypedDict
|
|
3
3
|
|
|
4
4
|
from htmy.typing import Component
|
|
5
5
|
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from typing_extensions import NotRequired
|
|
8
|
+
else:
|
|
9
|
+
from typing import Optional as NotRequired
|
|
10
|
+
|
|
6
11
|
MarkdownMetadataDict: TypeAlias = dict[str, Any]
|
|
7
12
|
|
|
8
13
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from collections.abc import Callable, Coroutine, Mapping
|
|
1
|
+
from collections.abc import Callable, Coroutine, Mapping, MutableMapping
|
|
2
2
|
from typing import Any, Protocol, TypeAlias, TypeGuard, TypeVar, runtime_checkable
|
|
3
3
|
|
|
4
4
|
T = TypeVar("T")
|
|
@@ -23,6 +23,14 @@ ContextValue: TypeAlias = Any
|
|
|
23
23
|
Context: TypeAlias = Mapping[ContextKey, ContextValue]
|
|
24
24
|
"""Context mapping."""
|
|
25
25
|
|
|
26
|
+
MutableContext: TypeAlias = MutableMapping[ContextKey, ContextValue]
|
|
27
|
+
"""
|
|
28
|
+
Mutable context mapping.
|
|
29
|
+
|
|
30
|
+
It can be helpful when the created context should be marked as mutable for static type analysis
|
|
31
|
+
(usually the created context is a plain `dict`).
|
|
32
|
+
"""
|
|
33
|
+
|
|
26
34
|
# -- Components
|
|
27
35
|
|
|
28
36
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "htmy"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.3"
|
|
4
4
|
description = "Async, pure-Python rendering engine."
|
|
5
5
|
authors = ["Peter Volf <do.volfp@gmail.com>"]
|
|
6
6
|
license = "MIT"
|
|
7
7
|
readme = "README.md"
|
|
8
8
|
|
|
9
9
|
[tool.poetry.dependencies]
|
|
10
|
-
python = "^3.
|
|
10
|
+
python = "^3.10"
|
|
11
11
|
anyio = "^4.6.2.post1"
|
|
12
12
|
async-lru = "^2.0.4"
|
|
13
13
|
markdown = "^3.7"
|
|
@@ -22,6 +22,7 @@ pytest-asyncio = "^0.24.0"
|
|
|
22
22
|
pytest-random-order = "^1.1.1"
|
|
23
23
|
ruff = "^0.6.8"
|
|
24
24
|
types-markdown = "^3.7.0.20240822"
|
|
25
|
+
typing-extensions = "^4.12.2"
|
|
25
26
|
|
|
26
27
|
[build-system]
|
|
27
28
|
requires = ["poetry-core"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|