Skip to content

Commit ee4e448

Browse files
authored
fix: init and linting (#539)
* fix: lint fixes * fix: remove log file
1 parent 3d15343 commit ee4e448

20 files changed

+47
-658
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"Programming Language :: Python :: 3.9",
111111
"Programming Language :: Python :: 3.10",
112112
"Programming Language :: Python :: 3.11",
113+
"Programming Language :: Python :: 3.12",
113114
"Intended Audience :: Developers",
114115
"Topic :: Internet :: WWW/HTTP :: Session",
115116
"License :: OSI Approved :: Apache Software License",

supertokens_python/recipe/dashboard/api/multitenancy/__init__.py

Whitespace-only changes.

supertokens_python/recipe/dashboard/api/multitenancy/get_tenant_info.py

Lines changed: 1 addition & 4 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

15-
from typing import Any, Dict, List, Union
15+
from typing import Any, Dict, List, Union, Optional
1616
from typing_extensions import Literal
1717

1818
from supertokens_python.recipe.multitenancy.asyncio import get_tenant
@@ -32,9 +32,6 @@
3232
from ...interfaces import APIInterface, APIOptions, CoreConfigFieldInfo
3333

3434

35-
from typing import List, Optional
36-
37-
3835
class ThirdPartyProvider:
3936
def __init__(self, third_party_id: str, name: str):
4037
self.third_party_id = third_party_id

supertokens_python/recipe/dashboard/api/multitenancy/get_third_party_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,17 @@ async def get_third_party_config(
275275
after_override = provider.override(before_override)
276276

277277
if (
278-
before_override.get_authorisation_redirect_url
278+
before_override.get_authorisation_redirect_url # pylint: disable=W0143
279279
!= after_override.get_authorisation_redirect_url
280280
):
281281
is_get_authorisation_redirect_url_overridden = True
282282
if (
283-
before_override.exchange_auth_code_for_oauth_tokens
283+
before_override.exchange_auth_code_for_oauth_tokens # pylint: disable=W0143
284284
!= after_override.exchange_auth_code_for_oauth_tokens
285285
):
286286
is_exchange_auth_code_for_oauth_tokens_overridden = True
287287
if (
288-
before_override.get_user_info
288+
before_override.get_user_info # pylint: disable=W0143
289289
!= after_override.get_user_info
290290
):
291291
is_get_user_info_overridden = True

supertokens_python/recipe/dashboard/api/user/__init__.py

Whitespace-only changes.

supertokens_python/recipe/dashboard/api/user/create/__init__.py

Whitespace-only changes.

supertokens_python/recipe/dashboard/api/user/create/emailpassword_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def create_email_password_user(
6363
_: APIInterface,
6464
tenant_id: str,
6565
api_options: APIOptions,
66-
user_context: Dict[str, Any],
66+
__: Dict[str, Any],
6767
) -> Union[
6868
CreateEmailPasswordUserOkResponse,
6969
CreateEmailPasswordUserFeatureNotEnabledResponse,

supertokens_python/recipe/dashboard/api/user/create/passwordless_user.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ async def create_passwordless_user(
105105
raise BadInputError("Please provide exactly one of email or phoneNumber")
106106

107107
if email is not None and (
108-
isinstance(passwordless_recipe.config.contact_config, ContactEmailOnlyConfig)
109-
or isinstance(
110-
passwordless_recipe.config.contact_config, ContactEmailOrPhoneConfig
108+
isinstance(
109+
passwordless_recipe.config.contact_config,
110+
(ContactEmailOnlyConfig, ContactEmailOrPhoneConfig),
111111
)
112112
):
113113
email = email.strip()
@@ -120,9 +120,9 @@ async def create_passwordless_user(
120120
return CreatePasswordlessUserEmailValidationErrorResponse(validation_error)
121121

122122
if phone_number is not None and (
123-
isinstance(passwordless_recipe.config.contact_config, ContactPhoneOnlyConfig)
124-
or isinstance(
125-
passwordless_recipe.config.contact_config, ContactEmailOrPhoneConfig
123+
isinstance(
124+
passwordless_recipe.config.contact_config,
125+
(ContactPhoneOnlyConfig, ContactEmailOrPhoneConfig),
126126
)
127127
):
128128
validation_error = (

supertokens_python/recipe/dashboard/api/userroles/__init__.py

Whitespace-only changes.

supertokens_python/recipe/dashboard/api/userroles/permissions/__init__.py

Whitespace-only changes.

supertokens_python/recipe/dashboard/api/userroles/permissions/get_permissions_for_role.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
GetPermissionsForRoleOkResult,
77
)
88

9-
from supertokens_python.recipe.userroles.recipe import UserRolesRecipe
109
from supertokens_python.recipe.userroles.recipe import UserRolesRecipe
1110
from supertokens_python.types import APIResponse
1211

@@ -37,10 +36,10 @@ def to_json(self):
3736

3837

3938
async def get_permissions_for_role_api(
40-
_api_interface: APIInterface,
41-
_tenant_id: str,
39+
_: APIInterface,
40+
__: str,
4241
api_options: APIOptions,
43-
user_context: Dict[str, Any],
42+
___: Dict[str, Any],
4443
) -> Union[
4544
OkPermissionsForRoleResponse,
4645
FeatureNotEnabledErrorResponse,

supertokens_python/recipe/dashboard/api/userroles/roles/__init__.py

Whitespace-only changes.

supertokens_python/recipe/dashboard/api/userroles/roles/get_all_roles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def to_json(self):
2424

2525

2626
async def get_all_roles_api(
27-
_: APIInterface, __: str, api_options: APIOptions, ___: Any
27+
_: APIInterface, __: str, ___: APIOptions, ____: Any
2828
) -> Union[OkResponse, FeatureNotEnabledErrorResponse]:
2929
try:
3030
UserRolesRecipe.get_instance()
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2024, VRAI Labs and/or its affiliates. All rights reserved.
2+
#
3+
# This software is licensed under the Apache License, Version 2.0 (the
4+
# "License") as published by the Apache Software Foundation.
5+
#
6+
# You may not use this file except in compliance with the License. You may
7+
# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations
13+
# under the License.
14+
from .create_device import handle_create_device_api
15+
from .list_devices import handle_list_devices_api
16+
from .remove_device import handle_remove_device_api
17+
from .verify_device import handle_verify_device_api
18+
from .verify_totp import handle_verify_totp_api
19+
20+
__all__ = [
21+
"handle_create_device_api",
22+
"handle_list_devices_api",
23+
"handle_remove_device_api",
24+
"handle_verify_device_api",
25+
"handle_verify_totp_api",
26+
]

supertokens_python/recipe/totp/api/create_device.py

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

2727

2828
async def handle_create_device_api(
29-
tenant_id: str,
29+
_: str,
3030
api_implementation: APIInterface,
3131
api_options: APIOptions,
3232
user_context: Dict[str, Any],

supertokens_python/recipe/totp/api/list_devices.py

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

2525

2626
async def handle_list_devices_api(
27-
tenant_id: str,
27+
_: str,
2828
api_implementation: APIInterface,
2929
api_options: APIOptions,
3030
user_context: Dict[str, Any],

supertokens_python/recipe/totp/api/remove_device.py

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

2626

2727
async def handle_remove_device_api(
28-
tenant_id: str,
28+
_: str,
2929
api_implementation: APIInterface,
3030
api_options: APIOptions,
3131
user_context: Dict[str, Any],

supertokens_python/recipe/totp/api/verify_device.py

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

2626

2727
async def handle_verify_device_api(
28-
tenant_id: str,
28+
_: str,
2929
api_implementation: APIInterface,
3030
api_options: APIOptions,
3131
user_context: Dict[str, Any],

supertokens_python/recipe/totp/api/verify_totp.py

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

2626

2727
async def handle_verify_totp_api(
28-
tenant_id: str,
28+
_: str,
2929
api_implementation: APIInterface,
3030
api_options: APIOptions,
3131
user_context: Dict[str, Any],

0 commit comments

Comments
 (0)