htmy 0.3.0__tar.gz → 0.3.2__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.

@@ -1,13 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: htmy
3
- Version: 0.3.0
3
+ Version: 0.3.2
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.11,<4.0
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
@@ -5,9 +5,11 @@ 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, Self, TypedDict, cast, overload
8
+ from typing import Any, ClassVar, Generic, TypedDict, cast, overload
9
9
  from xml.sax.saxutils import escape as xml_escape
10
10
 
11
+ from typing_extensions import Self
12
+
11
13
  from .io import open_file
12
14
  from .typing import (
13
15
  AsyncFunctionComponent,
@@ -1,5 +1,7 @@
1
1
  from collections.abc import Callable
2
- from typing import Any, NotRequired, TypeAlias, TypedDict
2
+ from typing import Any, TypeAlias, TypedDict
3
+
4
+ from typing_extensions import NotRequired
3
5
 
4
6
  from htmy.typing import Component
5
7
 
@@ -37,12 +37,17 @@ class HTMY:
37
37
 
38
38
  Arguments:
39
39
  component: The component to render.
40
- context: An optional rendering context. If `None`, the renderer's default context will be used.
40
+ context: An optional rendering context.
41
41
 
42
42
  Returns:
43
43
  The rendered string.
44
44
  """
45
- return await self._render(component, self._default_context if context is None else context)
45
+ return await self._render(
46
+ component,
47
+ # Type ignore: ChainMap expects mutable mappings,
48
+ # but mutation is not supported by the Context typing.
49
+ self._default_context if context is None else ChainMap(context, self._default_context), # type: ignore[arg-type]
50
+ )
46
51
 
47
52
  async def _render(self, component: Component, context: Context) -> str:
48
53
  """
@@ -1,13 +1,13 @@
1
1
  [tool.poetry]
2
2
  name = "htmy"
3
- version = "0.3.0"
3
+ version = "0.3.2"
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.11"
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
File without changes