Skip to content

Commit

Permalink
Add typing_extensions to requirements (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
aminalaee authored Aug 1, 2022
1 parent a047221 commit 9f70b8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ zip_safe = False
python_requires = >=3.7
install_requires =
starlette
typing_extensions>=4.0;python_version < '3.8'
jinja2
sqlalchemy >=1.4, <1.5
wtforms >=3, <4
Expand Down
7 changes: 6 additions & 1 deletion sqladmin/forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import inspect
import sys
from enum import Enum
from typing import (
Any,
Expand All @@ -20,7 +21,6 @@
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession
from sqlalchemy.orm import ColumnProperty, RelationshipProperty, Session
from sqlalchemy.sql.schema import Column
from typing_extensions import Protocol
from wtforms import (
BooleanField,
DateField,
Expand All @@ -47,6 +47,11 @@
)
from sqladmin.helpers import get_direction, get_primary_key

if sys.version_info >= (3, 8):
from typing import Protocol
else:
from typing_extensions import Protocol


class Validator(Protocol):
def __init__(self, *args: Any, **kwargs: Any) -> None:
Expand Down

0 comments on commit 9f70b8a

Please sign in to comment.