summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaper <michal@vasilek.cz>2021-11-28 16:13:15 +0100
committerGitHub <noreply@github.com>2021-11-28 16:13:15 +0100
commit0436eb2c3b613a3ae8c4f7497dee29a08594b55c (patch)
tree93d00f278683e6460fff792787787ee39c553134
parentb3a8695f97de33042c662ab0248f32dfa6ca6b59 (diff)
Do not require typing-extensions on Python 3.8+ (#346)
-rw-r--r--papis/document.py6
-rw-r--r--papis/downloaders/base.py6
-rw-r--r--papis/tui/app.py6
-rw-r--r--setup.py2
4 files changed, 16 insertions, 4 deletions
diff --git a/papis/document.py b/papis/document.py
index d91fb58d..fffcece6 100644
--- a/papis/document.py
+++ b/papis/document.py
@@ -7,7 +7,11 @@ import shutil
import logging
from typing import (
List, Dict, Any, Optional, Union, NamedTuple, Callable, Tuple)
-from typing_extensions import TypedDict
+
+try:
+ from typing import TypedDict # Python 3.8+
+except ImportError:
+ from typing_extensions import TypedDict
import papis.config
import papis
diff --git a/papis/downloaders/base.py b/papis/downloaders/base.py
index 8a1ea32b..9af596ec 100644
--- a/papis/downloaders/base.py
+++ b/papis/downloaders/base.py
@@ -1,6 +1,10 @@
import re
from typing import Any, List, Dict, Iterator, Tuple, Union, Pattern
-from typing_extensions import TypedDict
+
+try:
+ from typing import TypedDict # Python 3.8+
+except ImportError:
+ from typing_extensions import TypedDict
import bs4
diff --git a/papis/tui/app.py b/papis/tui/app.py
index 86c2cfa4..0f405fb5 100644
--- a/papis/tui/app.py
+++ b/papis/tui/app.py
@@ -22,7 +22,11 @@ from .widgets.list import Option, OptionsList
from typing import ( # noqa: ignore
Optional, Dict, Any, List, Callable, Tuple, Generic,
Sequence)
-from typing_extensions import TypedDict
+
+try:
+ from typing import TypedDict # Python 3.8+
+except ImportError:
+ from typing_extensions import TypedDict
__all__ = [
"Option",
diff --git a/setup.py b/setup.py
index b563d555..9c95f9aa 100644
--- a/setup.py
+++ b/setup.py
@@ -71,7 +71,7 @@ setup(
"pygments>=2.2.0",
"stevedore>=1.30",
"python-doi>=0.1.1",
- "typing-extensions>=3.7",
+ "typing-extensions>=3.7 ; python_version<'3.8'",
"lxml>=4.3.5 ; python_version>'3.5'",
"python-slugify>=1.2.6 ; python_version>'3.4'",
],