Skip to content

Commit

Permalink
feat: relax typing_extensions version constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
egormkn committed Jul 22, 2024
1 parent 16518bf commit 432c1a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = {file = "LICENSE"}
dynamic = ["version", "description"]
dependencies = [
"ipywidgets",
"typing_extensions >= 4.1.1",
"typing_extensions >= 3.7.0",
]

classifiers = [
Expand Down
8 changes: 6 additions & 2 deletions reacton/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
8 changes: 6 additions & 2 deletions reacton/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
from typing import Callable, TypeVar, cast

import ipywidgets as widgets
import typing_extensions

P = typing_extensions.ParamSpec("P")
try:
from typing_extensions import ParamSpec
P = ParamSpec("P")
except ImportError:
P = ...

T = TypeVar("T")


Expand Down

0 comments on commit 432c1a2

Please sign in to comment.