Skip to content

Commit ed1893d

Browse files
chore(deps): update mypy requirement from <=1.15.0 to <=1.17.1 (#1740)
* chore(deps): update mypy requirement from <=1.15.0 to <=1.17.1 Updates the requirements on [mypy](https://github.com/python/mypy) to permit the latest version. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v0.1.0...v1.17.1) --- updated-dependencies: - dependency-name: mypy dependency-version: 1.17.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * improve typing * Update basic_components.py --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Bergamin <[email protected]> Co-authored-by: William Bergamin <[email protected]>
1 parent eb1c7af commit ed1893d

File tree

10 files changed

+27
-27
lines changed

10 files changed

+27
-27
lines changed

requirements/testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ psutil>=6.0.0,<8
1515
boto3<=2
1616
# For AWS tests
1717
moto>=4.0.13,<6
18-
mypy<=1.15.0
18+
mypy<=1.17.1
1919
# For AsyncSQLAlchemy tests
2020
greenlet<=4
2121
aiosqlite<=1

slack_sdk/models/blocks/basic_components.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class Option(JsonObject):
166166
different required formats in different situations
167167
"""
168168

169-
attributes = {} # type: ignore[assignment] # no attributes because to_dict has unique implementations
169+
attributes: Set[str] = set()
170170
logger = logging.getLogger(__name__)
171171

172172
label_max_length = 75
@@ -313,7 +313,7 @@ class OptionGroup(JsonObject):
313313
different required formats in different situations
314314
"""
315315

316-
attributes = {} # type: ignore[assignment] # no attributes because to_dict has unique implementations
316+
attributes: Set[str] = set()
317317
label_max_length = 75
318318
options_max_length = 100
319319
logger = logging.getLogger(__name__)
@@ -395,7 +395,7 @@ def to_dict(self, option_type: str = "block") -> Dict[str, Any]:
395395

396396

397397
class ConfirmObject(JsonObject):
398-
attributes = {} # type: ignore[assignment] # no attributes because to_dict has unique implementations
398+
attributes: Set[str] = set()
399399

400400
title_max_length = 100
401401
text_max_length = 300

slack_sdk/models/dialogs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def __init__(
421421

422422

423423
class DialogBuilder(JsonObject):
424-
attributes = {} # type: ignore[assignment] # no attributes because to_dict has unique implementation
424+
attributes: Set[str] = set()
425425

426426
_callback_id: Optional[str]
427427
_elements: List[Union[DialogTextComponent, AbstractDialogSelector]]

slack_sdk/oauth/installation_store/async_cacheable_installation_store.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, installation_store: AsyncInstallationStore):
2626
def logger(self) -> Logger:
2727
return self.underlying.logger
2828

29-
async def async_save(self, installation: Installation): # type: ignore[explicit-override]
29+
async def async_save(self, installation: Installation):
3030
# Invalidate cache data for update operations
3131
key = f"{installation.enterprise_id or ''}-{installation.team_id or ''}"
3232
if key in self.cached_bots:
@@ -36,14 +36,14 @@ async def async_save(self, installation: Installation): # type: ignore[explicit
3636
self.cached_installations.pop(key)
3737
return await self.underlying.async_save(installation)
3838

39-
async def async_save_bot(self, bot: Bot): # type: ignore[explicit-override]
39+
async def async_save_bot(self, bot: Bot):
4040
# Invalidate cache data for update operations
4141
key = f"{bot.enterprise_id or ''}-{bot.team_id or ''}"
4242
if key in self.cached_bots:
4343
self.cached_bots.pop(key)
4444
return await self.underlying.async_save_bot(bot)
4545

46-
async def async_find_bot( # type: ignore[explicit-override]
46+
async def async_find_bot(
4747
self,
4848
*,
4949
enterprise_id: Optional[str],
@@ -64,7 +64,7 @@ async def async_find_bot( # type: ignore[explicit-override]
6464
self.cached_bots[key] = bot
6565
return bot
6666

67-
async def async_find_installation( # type: ignore[explicit-override]
67+
async def async_find_installation(
6868
self,
6969
*,
7070
enterprise_id: Optional[str],

slack_sdk/oauth/installation_store/cacheable_installation_store.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, installation_store: InstallationStore):
2424
def logger(self) -> Logger:
2525
return self.underlying.logger
2626

27-
def save(self, installation: Installation): # type: ignore[explicit-override]
27+
def save(self, installation: Installation):
2828
# Invalidate cache data for update operations
2929
key = f"{installation.enterprise_id or ''}-{installation.team_id or ''}"
3030
if key in self.cached_bots:
@@ -35,14 +35,14 @@ def save(self, installation: Installation): # type: ignore[explicit-override]
3535

3636
return self.underlying.save(installation)
3737

38-
def save_bot(self, bot: Bot): # type: ignore[explicit-override]
38+
def save_bot(self, bot: Bot):
3939
# Invalidate cache data for update operations
4040
key = f"{bot.enterprise_id or ''}-{bot.team_id or ''}"
4141
if key in self.cached_bots:
4242
self.cached_bots.pop(key)
4343
return self.underlying.save_bot(bot)
4444

45-
def find_bot( # type: ignore[explicit-override]
45+
def find_bot(
4646
self,
4747
*,
4848
enterprise_id: Optional[str],
@@ -63,7 +63,7 @@ def find_bot( # type: ignore[explicit-override]
6363
self.cached_bots[key] = bot
6464
return bot
6565

66-
def find_installation( # type: ignore[explicit-override]
66+
def find_installation(
6767
self,
6868
*,
6969
enterprise_id: Optional[str],

slack_sdk/socket_mode/builtin/internals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _establish_new_socket_connection(
8888
if status != 200:
8989
raise Exception(f"Failed to connect to the proxy (proxy: {proxy}, connect status code: {status})")
9090

91-
sock = ssl_context.wrap_socket( # type: ignore[union-attr]
91+
sock = ssl_context.wrap_socket(
9292
sock,
9393
do_handshake_on_connect=True,
9494
suppress_ragged_eofs=True,
@@ -103,7 +103,7 @@ def _establish_new_socket_connection(
103103
return sock
104104

105105
sock = socket.create_connection((server_hostname, server_port), receive_timeout)
106-
sock = ssl_context.wrap_socket( # type: ignore[union-attr]
106+
sock = ssl_context.wrap_socket(
107107
sock,
108108
do_handshake_on_connect=True,
109109
suppress_ragged_eofs=True,

slack_sdk/socket_mode/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def run_message_listeners(self, message: dict, raw_message: str) -> None:
131131

132132
for listener in self.message_listeners:
133133
try:
134-
listener(self, message, raw_message) # type: ignore[call-arg, arg-type]
134+
listener(self, message, raw_message) # type: ignore[call-arg, arg-type, misc]
135135
except Exception as e:
136136
self.logger.exception(f"Failed to run a message listener: {e}")
137137

slack_sdk/socket_mode/websocket_client/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class SocketModeClient(BaseSocketModeClient):
5858
auto_reconnect_enabled: bool
5959
default_auto_reconnect_enabled: bool
6060

61-
close: bool # type: ignore[assignment]
61+
closed: bool
6262
connect_operation_lock: Lock
6363

6464
on_open_listeners: List[Callable[[WebSocketApp], None]]
@@ -225,7 +225,7 @@ def send_message(self, message: str) -> None:
225225
)
226226
raise e
227227

228-
def close(self) -> None: # type: ignore[explicit-override, no-redef]
228+
def close(self) -> None:
229229
self.closed = True
230230
self.auto_reconnect_enabled = False
231231
self.disconnect()

slack_sdk/web/internal_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,19 +394,19 @@ def _upload_file_via_v2_url(
394394
else:
395395
resp = urlopen(req, context=ssl, timeout=timeout)
396396

397-
charset = resp.headers.get_content_charset() or "utf-8" # type: ignore[union-attr]
397+
charset = resp.headers.get_content_charset() or "utf-8"
398398
# read the response body here
399-
body: str = resp.read().decode(charset) # type: ignore[union-attr]
399+
body: str = resp.read().decode(charset)
400400
if logger.level <= logging.DEBUG:
401401
message = (
402402
"Received the following response - "
403-
f"status: {resp.status}, " # type: ignore[union-attr]
404-
f"headers: {dict(resp.headers)}, " # type: ignore[union-attr]
403+
f"status: {resp.status}, "
404+
f"headers: {dict(resp.headers)}, "
405405
f"body: {body}"
406406
)
407407
logger.debug(message)
408408

409-
return {"status": resp.status, "headers": resp.headers, "body": body} # type: ignore[union-attr]
409+
return {"status": resp.status, "headers": resp.headers, "body": body}
410410

411411

412412
def _validate_for_legacy_client(

slack_sdk/webhook/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@ def _perform_http_request_internal(self, url: str, req: Request):
267267
http_resp = opener.open(req, timeout=self.timeout)
268268
else:
269269
http_resp = urlopen(req, context=self.ssl, timeout=self.timeout)
270-
charset: str = http_resp.headers.get_content_charset() or "utf-8" # type: ignore[union-attr]
271-
response_body: str = http_resp.read().decode(charset) # type: ignore[union-attr]
270+
charset: str = http_resp.headers.get_content_charset() or "utf-8"
271+
response_body: str = http_resp.read().decode(charset)
272272
resp = WebhookResponse(
273273
url=url,
274-
status_code=http_resp.status, # type: ignore[union-attr]
274+
status_code=http_resp.status,
275275
body=response_body,
276-
headers=http_resp.headers, # type: ignore[arg-type, union-attr]
276+
headers=http_resp.headers, # type: ignore[arg-type]
277277
)
278278
_debug_log_response(self.logger, resp)
279279
return resp

0 commit comments

Comments
 (0)