Skip to content

Commit bed72be

Browse files
continue mypy
1 parent 2d8c2a7 commit bed72be

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

packages/models-library/src/models_library/api_schemas_payments/errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pydantic.errors import PydanticErrorMixin
1+
from common_library.errors_classes import OsparcErrorMixin
22

33

4-
class _BaseRpcApiError(PydanticErrorMixin, ValueError):
4+
class _BaseRpcApiError(OsparcErrorMixin, ValueError):
55
@classmethod
66
def get_full_class_name(cls) -> str:
77
# Can be used as unique code identifier

services/web/server/src/simcore_service_webserver/application_settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
9191
SIMCORE_VCS_RELEASE_TAG: str | None = Field(
9292
default=None,
9393
description="Name of the tag that marks this release, or None if undefined",
94-
example="ResistanceIsFutile10",
94+
examples=["ResistanceIsFutile10"],
9595
)
9696

9797
SIMCORE_VCS_RELEASE_URL: AnyHttpUrl | None = Field(
9898
default=None,
9999
description="URL to release notes",
100-
example="https://github.com/ITISFoundation/osparc-simcore/releases/tag/staging_ResistanceIsFutile10",
100+
examples=["https://github.com/ITISFoundation/osparc-simcore/releases/tag/staging_ResistanceIsFutile10"],
101101
)
102102

103103
SWARM_STACK_NAME: str | None = Field(

services/web/server/src/simcore_service_webserver/director_v2/_models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def set_default_thumbnail_if_empty(cls, v, values):
4545
"examples": [
4646
{
4747
"name": "My awesome cluster",
48-
"type": ClusterType.ON_PREMISE, # can use also values from equivalent enum
48+
"type": ClusterType.ON_PREMISE, # type: ignore[dict-item] # can use also values from equivalent enum
4949
"endpoint": "https://registry.osparc-development.fake.dev",
5050
"authentication": {
5151
"type": "simple",
@@ -56,7 +56,7 @@ def set_default_thumbnail_if_empty(cls, v, values):
5656
{
5757
"name": "My AWS cluster",
5858
"description": "a AWS cluster administered by me",
59-
"type": ClusterType.AWS,
59+
"type": ClusterType.AWS, # type: ignore[dict-item]
6060
"owner": 154,
6161
"endpoint": "https://registry.osparc-development.fake.dev",
6262
"authentication": {
@@ -65,9 +65,9 @@ def set_default_thumbnail_if_empty(cls, v, values):
6565
"password": "somepassword",
6666
},
6767
"access_rights": {
68-
154: CLUSTER_ADMIN_RIGHTS,
69-
12: CLUSTER_MANAGER_RIGHTS,
70-
7899: CLUSTER_USER_RIGHTS,
68+
154: CLUSTER_ADMIN_RIGHTS, # type: ignore[dict-item]
69+
12: CLUSTER_MANAGER_RIGHTS, # type: ignore[dict-item]
70+
7899: CLUSTER_USER_RIGHTS, # type: ignore[dict-item]
7171
},
7272
},
7373
]

services/web/server/src/simcore_service_webserver/director_v2/settings.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from aiohttp import ClientSession, ClientTimeout, web
88
from models_library.basic_types import VersionTag
9-
from pydantic import Field, PositiveInt
9+
from pydantic import AliasChoices, Field, PositiveInt
1010
from servicelib.aiohttp.application_keys import APP_CLIENT_SESSION_KEY
1111
from settings_library.base import BaseCustomSettings
1212
from settings_library.basic_types import PortInt
@@ -36,9 +36,9 @@ def base_url(self) -> URL:
3636
DIRECTOR_V2_RESTART_DYNAMIC_SERVICE_TIMEOUT: PositiveInt = Field(
3737
1 * _MINUTE,
3838
description="timeout of containers restart",
39-
envs=[
39+
validation_alias=AliasChoices(
4040
"DIRECTOR_V2_RESTART_DYNAMIC_SERVICE_TIMEOUT",
41-
],
41+
),
4242
)
4343

4444
DIRECTOR_V2_STORAGE_SERVICE_UPLOAD_DOWNLOAD_TIMEOUT: PositiveInt = Field(
@@ -49,9 +49,9 @@ def base_url(self) -> URL:
4949
"such payloads it is required to have long timeouts which "
5050
"allow the service to finish the operation."
5151
),
52-
envs=[
52+
validation_alias=AliasChoices(
5353
"DIRECTOR_V2_DYNAMIC_SERVICE_DATA_UPLOAD_DOWNLOAD_TIMEOUT",
54-
],
54+
),
5555
)
5656

5757
def get_service_retrieve_timeout(self) -> ClientTimeout:

services/web/server/src/simcore_service_webserver/studies_dispatcher/_catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ async def iter_latest_product_services(
114114
version=row.version,
115115
title=row.name,
116116
description=row.description,
117-
thumbnail=row.thumbnail or settings.STUDIES_DEFAULT_SERVICE_THUMBNAIL,
117+
thumbnail=row.thumbnail or f"{settings.STUDIES_DEFAULT_SERVICE_THUMBNAIL}",
118118
file_extensions=service_filetypes.get(row.key, []),
119119
)
120120

services/web/server/src/simcore_service_webserver/wallets/_groups_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async def list_wallet_groups_by_user_and_wallet(
7777
] = await wallets_groups_db.list_wallet_groups(app=app, wallet_id=wallet_id)
7878

7979
wallet_groups_api: list[WalletGroupGet] = [
80-
TypeAdapter(WalletGroupGet, group) for group in wallet_groups_db
80+
TypeAdapter(WalletGroupGet).validate_python(group) for group in wallet_groups_db
8181
]
8282

8383
return wallet_groups_api

0 commit comments

Comments
 (0)