mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-08-17 09:10:26 +03:00
python: use TypedDict from typing_extensions on python 3.9 and 3.10
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
adea3811ea
commit
446668674e
@ -9,13 +9,19 @@ import sys
|
||||
import threading
|
||||
from enum import Enum
|
||||
from queue import Queue
|
||||
from typing import Any, Callable, Generic, Iterable, TypedDict, TypeVar, overload
|
||||
from typing import Any, Callable, Generic, Iterable, TypeVar, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
import importlib.resources as importlib_resources
|
||||
else:
|
||||
import importlib_resources
|
||||
|
||||
if (3, 9) <= sys.version_info < (3, 11):
|
||||
# python 3.9 broke generic TypedDict, python 3.11 fixed it
|
||||
from typing_extensions import TypedDict
|
||||
else:
|
||||
from typing import TypedDict
|
||||
|
||||
EmbeddingsType = TypeVar('EmbeddingsType', bound='list[Any]')
|
||||
|
||||
|
||||
|
@ -90,6 +90,7 @@ setup(
|
||||
'requests',
|
||||
'tqdm',
|
||||
'importlib_resources; python_version < "3.9"',
|
||||
'typing-extensions>=4.3.0; python_version >= "3.9" and python_version < "3.11"',
|
||||
],
|
||||
extras_require={
|
||||
'dev': [
|
||||
|
Loading…
Reference in New Issue
Block a user