widgetti / reacton

A pure Python port of React for ipywidgets
https://reacton.solara.dev/
MIT License
298 stars 18 forks source link

feat: relax typing_extensions version constraint #38

Open egormkn opened 4 months ago

egormkn commented 4 months ago

Hello! I wanted to use Reacton in a project where the version of typing_extensions is pinned to 3.7.4.1 (python3-typing-extensions package from Ubuntu 20.04). However, due to ParamSpec usage, reacton requires at least 4.1.1. I suggest to relax the requirements, as missing type definition does not break anything.

Here I used a simple try-except to set type alias to ellipsis on failed import. Not entirely sure if it is correct as documentation specifies a literal ellipsis as a possible type argument for Callable, but with CPython 3.6+ this works fine.