From b2c846f959cf5a67fa714a40e9aa04ae6ddabbe1 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 29 Jan 2021 10:25:00 +0100 Subject: Use typing_extensions for TypedDict --- poezio/core/command_defs.py | 12 +++++++++++- requirements.txt | 1 + setup.py | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/poezio/core/command_defs.py b/poezio/core/command_defs.py index 643e2289..b2fefa38 100644 --- a/poezio/core/command_defs.py +++ b/poezio/core/command_defs.py @@ -1,8 +1,18 @@ +from typing import Callable, List + from poezio.core.commands import CommandCore from poezio.core.completions import CompletionCore from poezio.plugin_manager import PluginManager -from typing import TypedDict, Callable, List + +try: + from typing_extensions import TypedDict +except ImportError: + from sys import version_info + if version_info < (3, 9): + raise + from typing import TypedDict + CommandDict = TypedDict( "CommandDict", diff --git a/requirements.txt b/requirements.txt index e865ed37..403cc355 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ aiodns==1.1.1 pycares==2.3.0 pyasn1==0.4.2 pyasn1-modules==0.2.1 +typing_extensions diff --git a/setup.py b/setup.py index 1fb5e48a..b94373ae 100755 --- a/setup.py +++ b/setup.py @@ -165,7 +165,7 @@ setup( + find_doc('share/doc/poezio/html', 'build/html') + sphinx_files_found ), - install_requires=['slixmpp>=1.6.0', 'aiodns', 'pyasn1_modules', 'pyasn1'], + install_requires=['slixmpp>=1.6.0', 'aiodns', 'pyasn1_modules', 'pyasn1', 'typing_extensions'], extras_require={'OTR plugin': 'python-potr>=1.0', 'Screen autoaway plugin': 'pyinotify==0.9.4', 'Avoiding cython': 'cffi'}, -- cgit v1.2.3