Skip to content

Commit a719deb

Browse files
Merge pull request #424 from supertokens/fix/linter-failures
fix: Linter and formatter failures
2 parents 7dadddb + 9dc4013 commit a719deb

File tree

7 files changed

+26
-27
lines changed

7 files changed

+26
-27
lines changed

supertokens_python/recipe/dashboard/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from __future__ import annotations
1616

17-
from typing import Callable, Optional, Union, TYPE_CHECKING
17+
from typing import Callable, Optional, Union
1818

1919
from supertokens_python import AppInfo, RecipeModule
2020

supertokens_python/recipe/multitenancy/recipe_implementation.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ async def get_tenant(
162162
self, tenant_id: Optional[str], user_context: Dict[str, Any]
163163
) -> Optional[GetTenantOkResult]:
164164
res = await self.querier.send_get_request(
165-
NormalisedURLPath(f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant"),
165+
NormalisedURLPath(
166+
f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant"
167+
),
166168
)
167169

168170
if res["status"] == "TENANT_NOT_FOUND_ERROR":
@@ -210,7 +212,9 @@ async def create_or_update_third_party_config(
210212
user_context: Dict[str, Any],
211213
) -> CreateOrUpdateThirdPartyConfigOkResult:
212214
response = await self.querier.send_put_request(
213-
NormalisedURLPath(f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/config/thirdparty"),
215+
NormalisedURLPath(
216+
f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/config/thirdparty"
217+
),
214218
{
215219
"config": config.to_json(),
216220
"skipValidation": skip_validation is True,
@@ -250,7 +254,9 @@ async def associate_user_to_tenant(
250254
AssociateUserToTenantThirdPartyUserAlreadyExistsError,
251255
]:
252256
response: Dict[str, Any] = await self.querier.send_post_request(
253-
NormalisedURLPath(f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant/user"),
257+
NormalisedURLPath(
258+
f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant/user"
259+
),
254260
{
255261
"userId": user_id,
256262
},
@@ -281,7 +287,9 @@ async def dissociate_user_from_tenant(
281287
self, tenant_id: Optional[str], user_id: str, user_context: Dict[str, Any]
282288
) -> DisassociateUserFromTenantOkResult:
283289
response = await self.querier.send_post_request(
284-
NormalisedURLPath(f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant/user/remove"),
290+
NormalisedURLPath(
291+
f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant/user/remove"
292+
),
285293
{
286294
"userId": user_id,
287295
},

supertokens_python/recipe/session/asyncio/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414
from __future__ import annotations
15-
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, TYPE_CHECKING
15+
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union
1616

1717
from supertokens_python.recipe.openid.interfaces import (
1818
GetOpenIdDiscoveryConfigurationResult,
@@ -47,12 +47,9 @@
4747

4848
_T = TypeVar("_T")
4949

50-
if TYPE_CHECKING:
51-
from supertokens_python.framework.request import BaseRequest
52-
5350

5451
async def create_new_session(
55-
request: BaseRequest,
52+
request: Any,
5653
tenant_id: str,
5754
user_id: str,
5855
access_token_payload: Union[Dict[str, Any], None] = None,

supertokens_python/recipe/session/syncio/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414
from __future__ import annotations
15-
from typing import Any, Dict, List, Union, Callable, Optional, TypeVar, TYPE_CHECKING
15+
from typing import Any, Dict, List, Union, Callable, Optional, TypeVar
1616

1717
from supertokens_python.async_to_sync_wrapper import sync
1818
from supertokens_python.recipe.openid.interfaces import (
@@ -37,12 +37,8 @@
3737
)
3838

3939

40-
if TYPE_CHECKING:
41-
from supertokens_python.framework.request import BaseRequest
42-
43-
4440
def create_new_session(
45-
request: BaseRequest,
41+
request: Any,
4642
tenant_id: str,
4743
user_id: str,
4844
access_token_payload: Union[Dict[str, Any], None] = None,

tests/auth-react/fastapi-server/app.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,9 @@ async def authorisation_url_get(
914914
passwordless_init = passwordless.init(
915915
contact_config=ContactEmailOnlyConfig(),
916916
flow_type=flow_type,
917-
email_delivery=passwordless.EmailDeliveryConfig(CustomPlessEmailService()),
917+
email_delivery=passwordless.EmailDeliveryConfig(
918+
CustomPlessEmailService()
919+
),
918920
override=passwordless.InputOverrideConfig(
919921
apis=override_passwordless_apis
920922
),
@@ -923,7 +925,9 @@ async def authorisation_url_get(
923925
contact_config=ContactEmailOnlyConfig(),
924926
flow_type=flow_type,
925927
providers=providers_list,
926-
email_delivery=passwordless.EmailDeliveryConfig(CustomPlessEmailService()),
928+
email_delivery=passwordless.EmailDeliveryConfig(
929+
CustomPlessEmailService()
930+
),
927931
override=thirdpartypasswordless.InputOverrideConfig(
928932
apis=override_thirdpartypasswordless_apis
929933
),
@@ -1141,12 +1145,6 @@ async def check_role_api(
11411145
return JSONResponse({"status": "OK"})
11421146

11431147

1144-
1145-
@app.get("/hello")
1146-
async def check_role_api():
1147-
return JSONResponse({"msg": "hello world!"})
1148-
1149-
11501148
@app.exception_handler(405) # type: ignore
11511149
def f_405(_, e): # type: ignore
11521150
return PlainTextResponse("", status_code=404)

tests/auth-react/flask-server/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,9 @@ async def authorisation_url_get(
970970
contact_config=ContactPhoneOnlyConfig(),
971971
flow_type="USER_INPUT_CODE_AND_MAGIC_LINK",
972972
providers=providers_list,
973-
email_delivery=thirdpartypasswordless.EmailDeliveryConfig(CustomPlessEmailService()),
973+
email_delivery=thirdpartypasswordless.EmailDeliveryConfig(
974+
CustomPlessEmailService()
975+
),
974976
sms_delivery=thirdpartypasswordless.SMSDeliveryConfig(CustomSMSService()),
975977
override=thirdpartypasswordless.InputOverrideConfig(
976978
apis=override_thirdpartypasswordless_apis

tests/thirdpartypasswordless/test_authorisation_url_feature.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
14-
import json
15-
1614
from fastapi import FastAPI
1715
from pytest import mark, fixture
1816

0 commit comments

Comments
 (0)