diff --git a/docs/source/about/changelog.rst b/docs/source/about/changelog.rst index f0ab83e15..092d13006 100644 --- a/docs/source/about/changelog.rst +++ b/docs/source/about/changelog.rst @@ -23,7 +23,9 @@ more info, see the :ref:`Contributor Guide `. Unreleased ---------- -No changes. +**Removed** + +- :pull:`907` - accidental import of idom.testing v1.0.0-a2 diff --git a/pyproject.toml b/pyproject.toml index 633c3156a..31f15cdbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,9 +30,11 @@ show_missing = true skip_covered = true sort = "Name" exclude_lines = [ - "pragma: no cover", + # These are regex patterns + 'pragma: no cover', '\.\.\.', - "raise NotImplementedError", + 'raise NotImplementedError', + 'if TYPE_CHECKING[\s:]', ] omit = [ "src/idom/__main__.py", diff --git a/src/idom/widgets.py b/src/idom/widgets.py index a8899b757..6c829216c 100644 --- a/src/idom/widgets.py +++ b/src/idom/widgets.py @@ -1,7 +1,7 @@ from __future__ import annotations from base64 import b64encode -from typing import Any, Callable, Iterable, Tuple, TypeVar, Union +from typing import TYPE_CHECKING, Any, Callable, Iterable, Tuple, TypeVar, Union from typing_extensions import Protocol @@ -10,7 +10,6 @@ from . import html from ._warnings import warn from .core.types import ComponentConstructor, VdomDict -from .testing.backend import _hotswap, _MountFunc def image( @@ -95,6 +94,10 @@ def __call__(self, value: str) -> _CastTo: ... +if TYPE_CHECKING: + from .testing.backend import _MountFunc + + def hotswap( update_on_change: bool = False, ) -> Tuple[_MountFunc, ComponentConstructor]: # pragma: no cover @@ -103,4 +106,6 @@ def hotswap( DeprecationWarning, stacklevel=2, ) + from .testing.backend import _hotswap + return _hotswap(update_on_change)