Skip to content

Commit aa26caa

Browse files
authored
avoid importing testing module (#907)
* avoid importing testing module * add changelog
1 parent 9f879a6 commit aa26caa

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

docs/source/about/changelog.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ more info, see the :ref:`Contributor Guide <Creating a Changelog Entry>`.
2323
Unreleased
2424
----------
2525

26-
No changes.
26+
**Removed**
27+
28+
- :pull:`907` - accidental import of idom.testing
2729

2830

2931
v1.0.0-a2

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ show_missing = true
3030
skip_covered = true
3131
sort = "Name"
3232
exclude_lines = [
33-
"pragma: no cover",
33+
# These are regex patterns
34+
'pragma: no cover',
3435
'\.\.\.',
35-
"raise NotImplementedError",
36+
'raise NotImplementedError',
37+
'if TYPE_CHECKING[\s:]',
3638
]
3739
omit = [
3840
"src/idom/__main__.py",

src/idom/widgets.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from base64 import b64encode
4-
from typing import Any, Callable, Iterable, Tuple, TypeVar, Union
4+
from typing import TYPE_CHECKING, Any, Callable, Iterable, Tuple, TypeVar, Union
55

66
from typing_extensions import Protocol
77

@@ -10,7 +10,6 @@
1010
from . import html
1111
from ._warnings import warn
1212
from .core.types import ComponentConstructor, VdomDict
13-
from .testing.backend import _hotswap, _MountFunc
1413

1514

1615
def image(
@@ -95,6 +94,10 @@ def __call__(self, value: str) -> _CastTo:
9594
...
9695

9796

97+
if TYPE_CHECKING:
98+
from .testing.backend import _MountFunc
99+
100+
98101
def hotswap(
99102
update_on_change: bool = False,
100103
) -> Tuple[_MountFunc, ComponentConstructor]: # pragma: no cover
@@ -103,4 +106,6 @@ def hotswap(
103106
DeprecationWarning,
104107
stacklevel=2,
105108
)
109+
from .testing.backend import _hotswap
110+
106111
return _hotswap(update_on_change)

0 commit comments

Comments
 (0)