Fixed mypy for python 3.7.

Signed-off-by: Pavel <win10@list.ru>
This commit is contained in:
Pavel
2021-10-09 15:06:39 +04:00
parent 372dbd1304
commit eb19290d94
2 changed files with 6 additions and 6 deletions

View File

@ -20,9 +20,9 @@ And what's a better name for python ORM than snakes cabinet :)
""" """
try: try:
from importlib import metadata from importlib.metadata import version # type: ignore
except ImportError: # pragma: no cover except ImportError: # pragma: no cover
import importlib_metadata as metadata # type: ignore from importlib_metadata import version # type: ignore
from ormar.protocols import QuerySetProtocol, RelationProtocol # noqa: I100 from ormar.protocols import QuerySetProtocol, RelationProtocol # noqa: I100
from ormar.decorators import ( # noqa: I100 from ormar.decorators import ( # noqa: I100
post_delete, post_delete,
@ -82,7 +82,7 @@ class UndefinedType: # pragma no cover
Undefined = UndefinedType() Undefined = UndefinedType()
__version__ = metadata.version("ormar") __version__ = version("ormar")
__all__ = [ __all__ = [
"Integer", "Integer",
"BigInteger", "BigInteger",

View File

@ -12,7 +12,7 @@ from ormar.fields.base import BaseField # noqa I101
from ormar.fields.sqlalchemy_encrypted import EncryptBackends from ormar.fields.sqlalchemy_encrypted import EncryptBackends
try: try:
from typing import Literal from typing import Literal # type: ignore
except ImportError: # pragma: no cover except ImportError: # pragma: no cover
from typing_extensions import Literal # type: ignore from typing_extensions import Literal # type: ignore
@ -468,13 +468,13 @@ class JSON(ModelFieldFactory, pydantic.Json):
if TYPE_CHECKING: # pragma: nocover # noqa: C901 if TYPE_CHECKING: # pragma: nocover # noqa: C901
@overload @overload
def LargeBinary( def LargeBinary( # type: ignore
max_length: int, *, represent_as_base64_str: Literal[True], **kwargs: Any max_length: int, *, represent_as_base64_str: Literal[True], **kwargs: Any
) -> str: ) -> str:
... ...
@overload @overload
def LargeBinary( def LargeBinary( # type: ignore
max_length: int, *, represent_as_base64_str: Literal[False], **kwargs: Any max_length: int, *, represent_as_base64_str: Literal[False], **kwargs: Any
) -> bytes: ) -> bytes:
... ...