diff --git a/Makefile b/Makefile index 86543ac83..235277eff 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ typing: for lib in $(LIBRARIES); do \ cd ${WORKDIR}/$$lib && \ poetry run mypy --version && \ - poetry run mypy --install-types --non-interactive --strict $$(echo $$lib | tr "-" "_") && \ + poetry run mypy --install-types --non-interactive --strict --no-warn-unused-ignores $$(echo $$lib | tr "-" "_") && \ poetry run ty version && \ poetry run ty check && \ poetry run pyrefly --version && \ diff --git a/scaleway/pyproject.toml b/scaleway/pyproject.toml index 287fba6c2..71ed4a506 100644 --- a/scaleway/pyproject.toml +++ b/scaleway/pyproject.toml @@ -115,4 +115,4 @@ invalid-assignment = "ignore" invalid-argument-type = "ignore" missing-argument = "ignore" unresolved-reference = "ignore" -possibly-unbound-attribute = "ignore" +unused-ignore-comment = "ignore" diff --git a/scaleway/scaleway/applesilicon/v1alpha1/api.py b/scaleway/scaleway/applesilicon/v1alpha1/api.py index 00eca7991..1972f3ef8 100644 --- a/scaleway/scaleway/applesilicon/v1alpha1/api.py +++ b/scaleway/scaleway/applesilicon/v1alpha1/api.py @@ -1104,9 +1104,8 @@ def wait_for_server_private_network( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status - not in SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/scaleway/dedibox/v1/api.py b/scaleway/scaleway/dedibox/v1/api.py index f11df7de9..88be35b11 100644 --- a/scaleway/scaleway/dedibox/v1/api.py +++ b/scaleway/scaleway/dedibox/v1/api.py @@ -1350,8 +1350,8 @@ def wait_for_server_install( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in SERVER_INSTALL_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in SERVER_INSTALL_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/scaleway/instance/v1/custom_api.py b/scaleway/scaleway/instance/v1/custom_api.py index 853dcc7af..5c85e86f7 100644 --- a/scaleway/scaleway/instance/v1/custom_api.py +++ b/scaleway/scaleway/instance/v1/custom_api.py @@ -111,7 +111,7 @@ def set_all_server_user_data( server_id: str, user_data: Dict[str, bytes], zone: Optional[ScwZone] = None, - ) -> Optional[None]: + ) -> None: param_zone = validate_path_param("zone", zone or self.client.default_zone) param_server_id = validate_path_param("server_id", server_id) @@ -134,7 +134,7 @@ def set_all_server_user_data( content=user_data[key], ) - return None + return def wait_instance_server(self, server_id: str, zone: ScwZone) -> GetServerResponse: wait_interval = interval diff --git a/scaleway/scaleway/instance/v1/test_user_data.py b/scaleway/scaleway/instance/v1/test_user_data.py index 3cb264273..be5a98a18 100644 --- a/scaleway/scaleway/instance/v1/test_user_data.py +++ b/scaleway/scaleway/instance/v1/test_user_data.py @@ -32,10 +32,13 @@ def test_set_and_get_server_user_data(self) -> None: key = "first key" content = b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10" self.instance_api.set_server_user_data( - server_id=self.server.server.id, key=key, content=content + server_id=self.server.server.id, # type: ignore[possibly-missing-attribute] + key=key, + content=content, ) user_data = self.instance_api.get_server_user_data( - server_id=self.server.server.id, key=key + server_id=self.server.server.id, # type: ignore[possibly-missing-attribute] + key=key, ) self.assertIsNotNone(user_data) @@ -56,9 +59,10 @@ def test_set_and_get_all_user_data(self) -> None: key: content, } self.instance_api.set_all_server_user_data( - server_id=self.server.server.id, user_data=user_data + server_id=self.server.server.id, # type: ignore[possibly-missing-attribute] + user_data=user_data, ) response = self.instance_api.get_all_server_user_data( - server_id=self.server.server.id + server_id=self.server.server.id # type: ignore[possibly-missing-attribute] ) self.assertIsNotNone(response) diff --git a/scaleway/scaleway/interlink/v1beta1/api.py b/scaleway/scaleway/interlink/v1beta1/api.py index cb5ce9d15..225646c9c 100644 --- a/scaleway/scaleway/interlink/v1beta1/api.py +++ b/scaleway/scaleway/interlink/v1beta1/api.py @@ -251,8 +251,8 @@ def wait_for_dedicated_connection( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in DEDICATED_CONNECTION_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in DEDICATED_CONNECTION_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/scaleway/mongodb/v1/custom_api.py b/scaleway/scaleway/mongodb/v1/custom_api.py index 855707ea7..47259bf36 100644 --- a/scaleway/scaleway/mongodb/v1/custom_api.py +++ b/scaleway/scaleway/mongodb/v1/custom_api.py @@ -3,7 +3,7 @@ from datetime import datetime, timezone from typing import Any, Optional -from scaleway.mongodb.v1.api import MongodbV1API # type: ignore[import-untyped] +from scaleway.mongodb.v1.api import MongodbV1API def _ensure_tzaware_utc(value: Optional[datetime]) -> Optional[datetime]: @@ -14,7 +14,7 @@ def _ensure_tzaware_utc(value: Optional[datetime]) -> Optional[datetime]: return value -class MongodbUtilsV1API(MongodbV1API): # type: ignore[misc] +class MongodbUtilsV1API(MongodbV1API): """ Extensions for MongoDB V1 that provide safer ergonomics. diff --git a/scaleway/scaleway/mongodb/v1alpha1/custom_api.py b/scaleway/scaleway/mongodb/v1alpha1/custom_api.py index 25ed7438f..971d2ce58 100644 --- a/scaleway/scaleway/mongodb/v1alpha1/custom_api.py +++ b/scaleway/scaleway/mongodb/v1alpha1/custom_api.py @@ -3,7 +3,7 @@ from datetime import datetime, timezone from typing import Any, Optional -from scaleway.mongodb.v1alpha1.api import MongodbV1Alpha1API # type: ignore[import-untyped] +from scaleway.mongodb.v1alpha1.api import MongodbV1Alpha1API def _ensure_tzaware_utc(value: Optional[datetime]) -> Optional[datetime]: @@ -14,7 +14,7 @@ def _ensure_tzaware_utc(value: Optional[datetime]) -> Optional[datetime]: return value -class MongodbUtilsV1Alpha1API(MongodbV1Alpha1API): # type: ignore[misc] +class MongodbUtilsV1Alpha1API(MongodbV1Alpha1API): """ Extensions for MongoDB V1alpha1 that provide safer ergonomics. diff --git a/scaleway/scaleway/rdb/v1/api.py b/scaleway/scaleway/rdb/v1/api.py index 3632cb7ac..451d21173 100644 --- a/scaleway/scaleway/rdb/v1/api.py +++ b/scaleway/scaleway/rdb/v1/api.py @@ -536,8 +536,8 @@ def wait_for_database_backup( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in DATABASE_BACKUP_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in DATABASE_BACKUP_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/scaleway/vpcgw/v1/api.py b/scaleway/scaleway/vpcgw/v1/api.py index b04c7a0c1..7fa509d97 100644 --- a/scaleway/scaleway/vpcgw/v1/api.py +++ b/scaleway/scaleway/vpcgw/v1/api.py @@ -694,8 +694,8 @@ def wait_for_gateway_network( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/scaleway/vpcgw/v2/api.py b/scaleway/scaleway/vpcgw/v2/api.py index 29ee499ca..102253a73 100644 --- a/scaleway/scaleway/vpcgw/v2/api.py +++ b/scaleway/scaleway/vpcgw/v2/api.py @@ -628,8 +628,8 @@ def wait_for_gateway_network( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/vcr_config.py b/scaleway/vcr_config.py index b695d9288..fc28bc6dd 100644 --- a/scaleway/vcr_config.py +++ b/scaleway/vcr_config.py @@ -51,7 +51,7 @@ def scrub_data(data): return data -def scrub_json_string(raw: bytes | str) -> bytes | str: +def scrub_json_string(raw: bytes | str) -> str: if isinstance(raw, bytes): raw = raw.decode("utf-8")