Skip to content

Commit 0aee5ae

Browse files
committed
Upgrade black version to the latest
1 parent 750d97c commit 0aee5ae

12 files changed

Lines changed: 31 additions & 72 deletions

integration_tests/samples/socket_mode/aiohttp_example.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
async def main():
14-
1514
client = SocketModeClient(
1615
app_token=os.environ.get("SLACK_SDK_TEST_SOCKET_MODE_APP_TOKEN"),
1716
web_client=AsyncWebClient(token=os.environ.get("SLACK_SDK_TEST_SOCKET_MODE_BOT_TOKEN")),

integration_tests/samples/socket_mode/bolt_builtin_example.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def hello_command(ack, body):
3232

3333

3434
if __name__ == "__main__":
35-
3635
from bolt_adapter.builtin import SocketModeHandler
3736

3837
app_token = os.environ.get("SLACK_SDK_TEST_SOCKET_MODE_APP_TOKEN")

integration_tests/samples/socket_mode/bolt_oauth_aiohttp_async_example.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ async def hello_command(ack, body):
3939

4040

4141
if __name__ == "__main__":
42-
4342
import asyncio
4443
from asyncio import Future
4544

integration_tests/samples/socket_mode/bolt_websocket_client_example.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def hello_command(ack, body):
3232

3333

3434
if __name__ == "__main__":
35-
3635
from bolt_adapter.websocket_client import SocketModeHandler
3736

3837
app_token = os.environ.get("SLACK_SDK_TEST_SOCKET_MODE_APP_TOKEN")

integration_tests/samples/socket_mode/websockets_example.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
async def main():
14-
1514
client = SocketModeClient(
1615
app_token=os.environ.get("SLACK_SDK_TEST_SOCKET_MODE_APP_TOKEN"),
1716
web_client=AsyncWebClient(token=os.environ.get("SLACK_SDK_TEST_SOCKET_MODE_BOT_TOKEN")),

integration_tests/web/test_admin_conversations_bulk.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def test_sync(self):
7777

7878
@async_test
7979
async def test_async_move(self):
80-
8180
client = self.async_client
8281

8382
conv_creation = await client.admin_conversations_create(
@@ -98,7 +97,6 @@ async def test_async_move(self):
9897

9998
@async_test
10099
async def test_async(self):
101-
102100
client = self.async_client
103101

104102
conv_creation = await client.admin_conversations_create(

integration_tests/web/test_admin_conversations_restrictAccess.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ def setUp(self):
4040
if self.channel_id is None:
4141
millis = int(round(time.time() * 1000))
4242
channel_name = f"private-test-channel-{millis}"
43-
self.channel_id = client.conversations_create(name=channel_name, is_private=True,)[
43+
self.channel_id = client.conversations_create(
44+
name=channel_name,
45+
is_private=True,
46+
)[
4447
"channel"
4548
]["id"]
4649

integration_tests/web/test_app_manifest.py

Lines changed: 18 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def tearDown(self):
1414
pass
1515

1616
def test_operations(self):
17-
token = os.environ["SLACK_SDK_TEST_TOOLING_TOKEN"] # xoxe.xoxp-...
17+
token = os.environ["SLACK_SDK_TEST_TOOLING_TOKEN"] # xoxe.xoxp-...
1818
client = WebClient(token)
1919
client.apps_manifest_validate(manifest=STR_MANIFEST)
2020
client.apps_manifest_validate(manifest=DICT_MANIFEST)
@@ -115,86 +115,46 @@ def test_operations(self):
115115
"""
116116

117117
DICT_MANIFEST = {
118-
"display_information": {
119-
"name": "manifest-sandbox"
120-
},
118+
"display_information": {"name": "manifest-sandbox"},
121119
"features": {
122-
"app_home": {
123-
"home_tab_enabled": True,
124-
"messages_tab_enabled": False,
125-
"messages_tab_read_only_enabled": False
126-
},
127-
"bot_user": {
128-
"display_name": "manifest-sandbox",
129-
"always_online": True
130-
},
120+
"app_home": {"home_tab_enabled": True, "messages_tab_enabled": False, "messages_tab_read_only_enabled": False},
121+
"bot_user": {"display_name": "manifest-sandbox", "always_online": True},
131122
"shortcuts": [
132-
{
133-
"name": "message one",
134-
"type": "message",
135-
"callback_id": "m",
136-
"description": "message"
137-
},
138-
{
139-
"name": "global one",
140-
"type": "global",
141-
"callback_id": "g",
142-
"description": "global"
143-
}
123+
{"name": "message one", "type": "message", "callback_id": "m", "description": "message"},
124+
{"name": "global one", "type": "global", "callback_id": "g", "description": "global"},
144125
],
145126
"slash_commands": [
146127
{
147128
"command": "/hey",
148129
"url": "https://www.example.com/",
149130
"description": "What's up?",
150131
"usage_hint": "What's up?",
151-
"should_escape": True
132+
"should_escape": True,
152133
}
153134
],
154-
"unfurl_domains": [
155-
"example.com"
156-
]
135+
"unfurl_domains": ["example.com"],
157136
},
158137
"oauth_config": {
159-
"redirect_urls": [
160-
"https://www.example.com/foo"
161-
],
138+
"redirect_urls": ["https://www.example.com/foo"],
162139
"scopes": {
163-
"user": [
164-
"search:read",
165-
"channels:read",
166-
"groups:read",
167-
"mpim:read"
168-
],
169-
"bot": [
170-
"commands",
171-
"incoming-webhook",
172-
"app_mentions:read",
173-
"links:read"
174-
]
175-
}
140+
"user": ["search:read", "channels:read", "groups:read", "mpim:read"],
141+
"bot": ["commands", "incoming-webhook", "app_mentions:read", "links:read"],
142+
},
176143
},
177144
"settings": {
178-
"allowed_ip_address_ranges": [
179-
"123.123.123.123/32"
180-
],
145+
"allowed_ip_address_ranges": ["123.123.123.123/32"],
181146
"event_subscriptions": {
182147
"request_url": "https://www.example.com/slack/events",
183-
"user_events": [
184-
"member_joined_channel"
185-
],
186-
"bot_events": [
187-
"app_mention",
188-
"link_shared"
189-
]
148+
"user_events": ["member_joined_channel"],
149+
"bot_events": ["app_mention", "link_shared"],
190150
},
191151
"interactivity": {
192152
"is_enabled": True,
193153
"request_url": "https://www.example.com/",
194-
"message_menu_options_url": "https://www.example.com/"
154+
"message_menu_options_url": "https://www.example.com/",
195155
},
196156
"org_deploy_enabled": True,
197157
"socket_mode_enabled": False,
198-
"token_rotation_enabled": True
199-
}
158+
"token_rotation_enabled": True,
159+
},
200160
}

integration_tests/web/test_calls.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ def tearDown(self):
2424

2525
def test_sync(self):
2626
client = self.sync_client
27-
user_id = list(filter(lambda u: not u["deleted"] and "bot_id" not in u, client.users_list(limit=50)["members"],))[
27+
user_id = list(
28+
filter(
29+
lambda u: not u["deleted"] and "bot_id" not in u,
30+
client.users_list(limit=50)["members"],
31+
)
32+
)[
2833
0
2934
]["id"]
3035

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@
2626
"Jinja2==3.0.3", # https://github.com/pallets/flask/issues/4494
2727
"pytest-cov>=2,<3",
2828
"flake8>=5,<6",
29-
"black==22.8.0",
29+
"black==23.11.0",
3030
"click==8.0.4", # black is affected by https://github.com/pallets/click/issues/2225
3131
"psutil>=5,<6",
3232
# used only under slack_sdk/*_store
3333
"boto3<=2",
34-
# TODO: Upgrade to v2
3534
"moto>=3,<4", # For AWS tests
3635
]
3736
codegen_dependencies = [
38-
"black==22.10.0",
37+
"black==23.11.0",
3938
]
4039

4140
needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv)

0 commit comments

Comments
 (0)