diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27a9762b..fec42fa0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: [3.7, 3.8, 3.9, '3.10', '3.11'] + python_version: [3.8, 3.9, '3.10', '3.11'] steps: - uses: actions/checkout@v3 @@ -48,7 +48,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Install dependencies shell: bash run: | diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b2b020c3..65adb395 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -13,10 +13,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.7 + - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Install dependencies shell: bash run: | diff --git a/fastapi_users/authentication/strategy/base.py b/fastapi_users/authentication/strategy/base.py index ce60db13..7dfbcdd6 100644 --- a/fastapi_users/authentication/strategy/base.py +++ b/fastapi_users/authentication/strategy/base.py @@ -1,10 +1,4 @@ -import sys -from typing import Generic, Optional - -if sys.version_info < (3, 8): - from typing_extensions import Protocol # pragma: no cover -else: - from typing import Protocol # pragma: no cover +from typing import Generic, Optional, Protocol from fastapi_users import models from fastapi_users.manager import BaseUserManager diff --git a/fastapi_users/authentication/strategy/db/adapter.py b/fastapi_users/authentication/strategy/db/adapter.py index 18fac269..6ed1a02b 100644 --- a/fastapi_users/authentication/strategy/db/adapter.py +++ b/fastapi_users/authentication/strategy/db/adapter.py @@ -1,11 +1,5 @@ -import sys from datetime import datetime -from typing import Any, Dict, Generic, Optional - -if sys.version_info < (3, 8): - from typing_extensions import Protocol # pragma: no cover -else: - from typing import Protocol # pragma: no cover +from typing import Any, Dict, Generic, Optional, Protocol from fastapi_users.authentication.strategy.db.models import AP diff --git a/fastapi_users/authentication/strategy/db/models.py b/fastapi_users/authentication/strategy/db/models.py index 6c3b58be..8c08d0e2 100644 --- a/fastapi_users/authentication/strategy/db/models.py +++ b/fastapi_users/authentication/strategy/db/models.py @@ -1,11 +1,5 @@ -import sys from datetime import datetime -from typing import TypeVar - -if sys.version_info < (3, 8): - from typing_extensions import Protocol # pragma: no cover -else: - from typing import Protocol # pragma: no cover +from typing import Protocol, TypeVar from fastapi_users import models diff --git a/fastapi_users/authentication/transport/base.py b/fastapi_users/authentication/transport/base.py index 64073e7e..d8b1acd9 100644 --- a/fastapi_users/authentication/transport/base.py +++ b/fastapi_users/authentication/transport/base.py @@ -1,9 +1,4 @@ -import sys - -if sys.version_info < (3, 8): - from typing_extensions import Protocol # pragma: no cover -else: - from typing import Protocol # pragma: no cover +from typing import Protocol from fastapi import Response from fastapi.security.base import SecurityBase diff --git a/fastapi_users/authentication/transport/cookie.py b/fastapi_users/authentication/transport/cookie.py index 68c6dd90..dfc47b27 100644 --- a/fastapi_users/authentication/transport/cookie.py +++ b/fastapi_users/authentication/transport/cookie.py @@ -1,10 +1,4 @@ -import sys -from typing import Optional - -if sys.version_info < (3, 8): - from typing_extensions import Literal # pragma: no cover -else: - from typing import Literal # pragma: no cover +from typing import Literal, Optional from fastapi import Response, status from fastapi.security import APIKeyCookie diff --git a/fastapi_users/models.py b/fastapi_users/models.py index f6bbe1ab..ed02632d 100644 --- a/fastapi_users/models.py +++ b/fastapi_users/models.py @@ -1,10 +1,4 @@ -import sys -from typing import Generic, List, Optional, TypeVar - -if sys.version_info < (3, 8): - from typing_extensions import Protocol # pragma: no cover -else: - from typing import Protocol # pragma: no cover +from typing import Generic, List, Optional, Protocol, TypeVar ID = TypeVar("ID") diff --git a/fastapi_users/password.py b/fastapi_users/password.py index 438dcda8..b6f44d0a 100644 --- a/fastapi_users/password.py +++ b/fastapi_users/password.py @@ -1,10 +1,4 @@ -import sys -from typing import Optional, Tuple - -if sys.version_info < (3, 8): - from typing_extensions import Protocol # pragma: no cover -else: - from typing import Protocol # pragma: no cover +from typing import Optional, Protocol, Tuple from passlib import pwd from passlib.context import CryptContext diff --git a/pyproject.toml b/pyproject.toml index 3b0f0c81..cd9507b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -115,7 +115,6 @@ classifiers = [ "Framework :: FastAPI", "Framework :: AsyncIO", "Intended Audience :: Developers", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -123,7 +122,7 @@ classifiers = [ "Programming Language :: Python :: 3 :: Only", "Topic :: Internet :: WWW/HTTP :: Session", ] -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = [ "fastapi >=0.65.2", "passlib[bcrypt] ==1.7.4", @@ -131,7 +130,6 @@ dependencies = [ "pyjwt[crypto] ==2.7.0", "python-multipart ==0.0.6", "makefun >=1.11.2,<2.0.0", - "typing-extensions >=4.1.1; python_version < '3.8'", ] [project.optional-dependencies] @@ -142,7 +140,7 @@ beanie = [ "fastapi-users-db-beanie >=1.0.0", ] oauth = [ - "httpx-oauth >=0.4,<0.12" + "httpx-oauth >=0.13" ] redis = [ "redis >=4.3.3,<5.0.0",