Skip to content

Commit

Permalink
fix: cyclic import
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Dec 30, 2024
1 parent 75b1d77 commit 873ce29
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ flask-cors==5.0.0
nest-asyncio==1.6.0
pdoc3==0.11.0
pylint==3.2.7
pyright==1.1.389
pyright==1.1.391
python-dotenv==1.0.1
pytest==8.3.3
pytest-asyncio==0.24.0
Expand Down
4 changes: 2 additions & 2 deletions supertokens_python/recipe/oauth2provider/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
from urllib.parse import parse_qsl
from dateutil import parser

from supertokens_python.recipe.session.asyncio import get_session
from supertokens_python.recipe.session.exceptions import TryRefreshTokenError
from supertokens_python.utils import send_200_response, send_non_200_response

if TYPE_CHECKING:
Expand All @@ -40,6 +38,8 @@ async def auth_get(
RedirectResponse,
ErrorOAuth2Response,
)
from supertokens_python.recipe.session.asyncio import get_session
from supertokens_python.recipe.session.exceptions import TryRefreshTokenError

if api_implementation.disable_auth_get is True:
return None
Expand Down
4 changes: 2 additions & 2 deletions supertokens_python/recipe/oauth2provider/api/end_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

from supertokens_python.exceptions import raise_bad_input_exception
from supertokens_python.framework import BaseResponse
from supertokens_python.recipe.session import SessionContainer
from supertokens_python.recipe.session.exceptions import TryRefreshTokenError
from supertokens_python.types import GeneralErrorResponse
from supertokens_python.utils import send_200_response, send_non_200_response

Expand All @@ -31,6 +29,8 @@
RedirectResponse,
ErrorOAuth2Response,
)
from supertokens_python.recipe.session import SessionContainer
from supertokens_python.recipe.session.exceptions import TryRefreshTokenError

EndSessionCallable = Callable[
[Dict[str, str], APIOptions, Optional[SessionContainer], bool, Dict[str, Any]],
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/recipe/oauth2provider/api/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

from supertokens_python.exceptions import raise_bad_input_exception
from supertokens_python.framework import BaseResponse
from supertokens_python.recipe.session.exceptions import TryRefreshTokenError
from supertokens_python.utils import send_200_response, send_non_200_response
from http.cookies import SimpleCookie

Expand All @@ -42,6 +41,7 @@ async def login(
ErrorOAuth2Response,
)
from supertokens_python.recipe.session.asyncio import get_session
from supertokens_python.recipe.session.exceptions import TryRefreshTokenError

if api_implementation.disable_login_get is True:
return None
Expand Down
3 changes: 2 additions & 1 deletion supertokens_python/recipe/oauth2provider/api/user_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

from typing import TYPE_CHECKING, Any, Dict, Optional

from supertokens_python.asyncio import get_user
from supertokens_python.utils import (
send_200_response,
send_non_200_response_with_message,
Expand All @@ -35,6 +34,8 @@ async def user_info_get(
api_options: APIOptions,
user_context: Dict[str, Any],
):
from supertokens_python.asyncio import get_user

if api_implementation.disable_user_info_get is True:
return None

Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/recipe/oauth2provider/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

from supertokens_python import Supertokens
from supertokens_python.recipe.multitenancy.constants import DEFAULT_TENANT_ID
from supertokens_python.recipe.session.asyncio import get_session_information
from ..constants import LOGIN_PATH, AUTH_PATH, END_SESSION_PATH

if TYPE_CHECKING:
Expand All @@ -48,6 +47,7 @@ async def login_get(
FrontendRedirectionURLTypeTryRefresh,
FrontendRedirectionURLTypeLogin,
)
from supertokens_python.recipe.session.asyncio import get_session_information

login_request = await recipe_implementation.get_login_request(
challenge=login_challenge,
Expand Down

0 comments on commit 873ce29

Please sign in to comment.