From b8f8c0db26b268bd036a8369db865cccf0b513d2 Mon Sep 17 00:00:00 2001 From: Egor Makarenko Date: Mon, 22 Jul 2024 14:25:05 +0300 Subject: [PATCH] feat: relax typing_extensions version constraint --- pyproject.toml | 2 +- reacton/core.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c6ae83f..337095e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ license = {file = "LICENSE"} dynamic = ["version", "description"] dependencies = [ "ipywidgets", - "typing_extensions >= 4.1.1", + "typing_extensions >= 3.7.0", ] classifiers = [ diff --git a/reacton/core.py b/reacton/core.py index ac54e1a..650c65f 100644 --- a/reacton/core.py +++ b/reacton/core.py @@ -40,7 +40,6 @@ import ipywidgets import ipywidgets as widgets import traitlets -import typing_extensions from typing_extensions import Literal, Protocol import reacton.logging # noqa: F401 # has sidefx @@ -87,7 +86,12 @@ def get(): V = TypeVar("V") # used for value type of widget V2 = TypeVar("V2") # used for value type of widget E = TypeVar("E") # used for elements -P = typing_extensions.ParamSpec("P") + +try: + from typing_extensions import ParamSpec + P = ParamSpec("P") +except ImportError: + P = ... WidgetOrList = Union[widgets.Widget, List[widgets.Widget]] EffectCleanupCallable = Callable[[], None]