|
10 | 10 | from markupsafe import escape as _escape |
11 | 11 |
|
12 | 12 | try: |
13 | | - from typing import deprecated # type: ignore[attr-defined] |
| 13 | + from warnings import deprecated # type: ignore[attr-defined,unused-ignore] |
14 | 14 | except ImportError: |
15 | 15 | from typing_extensions import deprecated |
16 | 16 |
|
@@ -135,7 +135,7 @@ class ContextProvider(t.Generic[T]): |
135 | 135 | value: T |
136 | 136 | node: Node |
137 | 137 |
|
138 | | - @deprecated( |
| 138 | + @deprecated( # type: ignore[misc,unused-ignore] |
139 | 139 | "iterating over a context provider is deprecated and will be removed in a future release. " |
140 | 140 | "Please use the context_provider.iter_chunks() method instead." |
141 | 141 | ) # pyright: ignore [reportUntypedFunctionDecorator] |
@@ -203,7 +203,7 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> ContextConsumer[T]: |
203 | 203 | return wrapper |
204 | 204 |
|
205 | 205 |
|
206 | | -@deprecated( |
| 206 | +@deprecated( # type: ignore[misc,unused-ignore] |
207 | 207 | "iter_node is deprecated and will be removed in a future release. " |
208 | 208 | "Please use the .iter_chunks() method on elements/fragments instead." |
209 | 209 | ) # pyright: ignore [reportUntypedFunctionDecorator] |
@@ -306,7 +306,7 @@ def __call__(self: BaseElementSelf, *args: t.Any, **kwargs: t.Any) -> BaseElemen |
306 | 306 | self._children, |
307 | 307 | ) |
308 | 308 |
|
309 | | - @deprecated( |
| 309 | + @deprecated( # type: ignore[misc,unused-ignore] |
310 | 310 | "iterating over an element is deprecated and will be removed in a future release. " |
311 | 311 | "Please use the element.iter_chunks() method instead." |
312 | 312 | ) # pyright: ignore [reportUntypedFunctionDecorator] |
@@ -386,7 +386,7 @@ def __init__(self) -> None: |
386 | 386 | # node directly via the constructor. |
387 | 387 | self._node: Node = None |
388 | 388 |
|
389 | | - @deprecated( |
| 389 | + @deprecated( # type: ignore[misc,unused-ignore] |
390 | 390 | "iterating over a fragment is deprecated and will be removed in a future release. " |
391 | 391 | "Please use the fragment.iter_chunks() method instead." |
392 | 392 | ) # pyright: ignore [reportUntypedFunctionDecorator] |
@@ -419,7 +419,7 @@ def _chunks_as_markup(renderable: Renderable) -> _Markup: |
419 | 419 | return _Markup("".join(renderable.iter_chunks())) |
420 | 420 |
|
421 | 421 |
|
422 | | -@deprecated( |
| 422 | +@deprecated( # type: ignore[misc,unused-ignore] |
423 | 423 | "render_node is deprecated and will be removed in a future release. " |
424 | 424 | "Please use fragment instead: https://htpy.dev/usage/#fragments" |
425 | 425 | ) # pyright: ignore [reportUntypedFunctionDecorator] |
|
0 commit comments