16
16
with codecs .open (os .path .join (here , "README.md" ), encoding = "utf-8" ) as readme :
17
17
long_description = readme .read ()
18
18
19
- tests_require = ["pytest>=5,<6" , "pytest-cov>=2,<3" , "codecov>=2,<3" , "flake8>=3,<4" , "black" , "psutil" ]
19
+ tests_require = [
20
+ "pytest>=5,<6" ,
21
+ "pytest-cov>=2,<3" ,
22
+ "codecov>=2,<3" ,
23
+ "flake8>=3,<4" ,
24
+ "black" ,
25
+ "psutil" ,
26
+ ]
20
27
21
- needs_pytest = {' pytest' , ' test' , ' ptr' }.intersection (sys .argv )
22
- pytest_runner = [' pytest-runner' ] if needs_pytest else []
28
+ needs_pytest = {" pytest" , " test" , " ptr" }.intersection (sys .argv )
29
+ pytest_runner = [" pytest-runner" ] if needs_pytest else []
23
30
24
31
25
32
class BaseCommand (Command ):
@@ -88,9 +95,9 @@ class ValidateCommand(BaseCommand):
88
95
description = "Run Python static code analyzer (flake8), formatter (black) and unit tests (pytest)."
89
96
90
97
user_options = [
91
- (' unit-test-target=' , 'i' , ' tests/{unit-test-target}' ),
92
- (' utt=' , 'i' , ' tests/{utt}' ),
93
- (' test-target=' , 'i' , ' tests/{test-target}' )
98
+ (" unit-test-target=" , "i" , " tests/{unit-test-target}" ),
99
+ (" utt=" , "i" , " tests/{utt}" ),
100
+ (" test-target=" , "i" , " tests/{test-target}" ),
94
101
]
95
102
96
103
def initialize_options (self ):
@@ -102,27 +109,37 @@ def run(self):
102
109
with open ("./slack/web/client.py" , "r" ) as original :
103
110
source = original .read ()
104
111
import re
105
- async_source = "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n " \
106
- "#\n " \
107
- "# *** DO NOT EDIT THIS FILE ***\n " \
108
- "#\n " \
109
- "# 1) Modify slack/web/client.py\n " \
110
- "# 2) Run `python setup.py validate`\n " \
111
- "#\n " \
112
- "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n " \
113
- "\n " \
114
- + source
112
+
113
+ async_source = (
114
+ "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n "
115
+ "#\n "
116
+ "# *** DO NOT EDIT THIS FILE ***\n "
117
+ "#\n "
118
+ "# 1) Modify slack/web/client.py\n "
119
+ "# 2) Run `python setup.py validate`\n "
120
+ "#\n "
121
+ "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n "
122
+ "\n " + source
123
+ )
115
124
async_source = re .sub (" def " , " async def " , async_source )
116
125
async_source = re .sub ("from asyncio import Future\n " , "" , async_source )
117
- async_source = re .sub ("return self.api_call\(" , "return await self.api_call(" , async_source )
118
- async_source = re .sub ("Union\[Future, SlackResponse\]" , "AsyncSlackResponse" , async_source )
126
+ async_source = re .sub (
127
+ "return self.api_call\(" , "return await self.api_call(" , async_source
128
+ )
129
+ async_source = re .sub (
130
+ "Union\[Future, SlackResponse\]" , "AsyncSlackResponse" , async_source
131
+ )
119
132
async_source = re .sub (
120
133
"from slack.web.base_client import BaseClient, SlackResponse" ,
121
- "from slack.web.async_base_client import AsyncBaseClient, AsyncSlackResponse" , async_source )
134
+ "from slack.web.async_base_client import AsyncBaseClient, AsyncSlackResponse" ,
135
+ async_source ,
136
+ )
122
137
async_source = re .sub (
123
138
"class WebClient\(BaseClient\):" ,
124
- "class AsyncWebClient(AsyncBaseClient):" , async_source )
125
- with open ('./slack/web/async_client.py' , 'w' ) as output :
139
+ "class AsyncWebClient(AsyncBaseClient):" ,
140
+ async_source ,
141
+ )
142
+ with open ("./slack/web/async_client.py" , "w" ) as output :
126
143
output .write (async_source )
127
144
128
145
self ._run (
@@ -132,7 +149,9 @@ def run(self):
132
149
self ._run ("Running black…" , [sys .executable , "-m" , "black" , f"{ here } /slack" ])
133
150
self ._run ("Running flake8…" , [sys .executable , "-m" , "flake8" , f"{ here } /slack" ])
134
151
135
- target = (self .utt or self .unit_test_target or self .test_target ).replace ("tests/" , "" )
152
+ target = (self .utt or self .unit_test_target or self .test_target ).replace (
153
+ "tests/" , ""
154
+ )
136
155
self ._run (
137
156
"Running pytest…" ,
138
157
[
@@ -152,9 +171,13 @@ class RunIntegrationTestsCommand(BaseCommand):
152
171
description = "Run integration tests (pytest)."
153
172
154
173
user_options = [
155
- ('integration-test-target=' , 'i' , 'integration_tests/{integration-test-target}' ),
156
- ('itt=' , 'i' , 'integration_tests/{itt}' ),
157
- ('test-target=' , 'i' , 'integration_tests/{test-target}' )
174
+ (
175
+ "integration-test-target=" ,
176
+ "i" ,
177
+ "integration_tests/{integration-test-target}" ,
178
+ ),
179
+ ("itt=" , "i" , "integration_tests/{itt}" ),
180
+ ("test-target=" , "i" , "integration_tests/{test-target}" ),
158
181
]
159
182
160
183
def initialize_options (self ):
@@ -163,7 +186,9 @@ def initialize_options(self):
163
186
self .test_target = ""
164
187
165
188
def run (self ):
166
- target = (self .itt or self .integration_test_target or self .test_target ).replace ("integration_tests/" , "" )
189
+ target = (self .itt or self .integration_test_target or self .test_target ).replace (
190
+ "integration_tests/" , ""
191
+ )
167
192
self ._run (
168
193
"Running pytest…" ,
169
194
[
@@ -183,11 +208,15 @@ class RunAllTestsCommand(ValidateCommand):
183
208
description = ValidateCommand .description + "\n Run integration tests (pytest)."
184
209
185
210
user_options = [
186
- ('unit-test-target=' , 'i' , 'tests/{unit-test-target}' ),
187
- ('utt=' , 'i' , 'tests/{utt}' ),
188
- ('integration-test-target=' , 'i' , 'integration_tests/{integration-test-target}' ),
189
- ('itt=' , 'i' , 'integration_tests/{itt}' ),
190
- ('test-target=' , 'i' , 'integration_tests/{test-target}' )
211
+ ("unit-test-target=" , "i" , "tests/{unit-test-target}" ),
212
+ ("utt=" , "i" , "tests/{utt}" ),
213
+ (
214
+ "integration-test-target=" ,
215
+ "i" ,
216
+ "integration_tests/{integration-test-target}" ,
217
+ ),
218
+ ("itt=" , "i" , "integration_tests/{itt}" ),
219
+ ("test-target=" , "i" , "integration_tests/{test-target}" ),
191
220
]
192
221
193
222
def initialize_options (self ):
@@ -199,7 +228,9 @@ def initialize_options(self):
199
228
200
229
def run (self ):
201
230
ValidateCommand .run (self )
202
- target = (self .itt or self .integration_test_target or self .test_target ).replace ("integration_tests/" , "" )
231
+ target = (self .itt or self .integration_test_target or self .test_target ).replace (
232
+ "integration_tests/" , ""
233
+ )
203
234
self ._run (
204
235
"Running pytest…" ,
205
236
[
@@ -216,11 +247,12 @@ def run(self):
216
247
setup (
217
248
name = "slackclient" ,
218
249
version = __version__ ,
219
- description = "Slack API clients for Web API and RTM API" ,
250
+ description = "Slack API clients for Web API and RTM API (Legacy) - "
251
+ + "Please use https://pypi.org/project/slack-sdk/ instead." ,
220
252
long_description = long_description ,
221
253
long_description_content_type = "text/markdown" ,
222
- url = "https://github.com/slackapi/python-slackclient " ,
223
- author = "Slack Technologies, Inc. " ,
254
+ url = "https://github.com/slackapi/python-slack-sdk " ,
255
+ author = "Slack Technologies, LLC " ,
224
256
225
257
python_requires = ">=3.6.0" ,
226
258
include_package_data = True ,
@@ -237,14 +269,21 @@ def run(self):
237
269
"Programming Language :: Python :: 3.6" ,
238
270
"Programming Language :: Python :: 3.7" ,
239
271
"Programming Language :: Python :: 3.8" ,
272
+ "Programming Language :: Python :: 3.9" ,
273
+ "Programming Language :: Python :: 3.10" ,
240
274
],
241
275
keywords = "slack slack-web slack-rtm chat chatbots bots chatops" ,
242
276
packages = find_packages (
243
- exclude = ["docs" , "docs-src" , "integration_tests" , "tests" , "tests.*" , "tutorial" ]
277
+ exclude = [
278
+ "docs" ,
279
+ "docs-src" ,
280
+ "integration_tests" ,
281
+ "tests" ,
282
+ "tests.*" ,
283
+ "tutorial" ,
284
+ ]
244
285
),
245
- install_requires = [
246
- "aiohttp>3.5.2,<4.0.0" # TODO: move to extras_require in v3
247
- ],
286
+ install_requires = ["aiohttp>3.5.2,<4.0.0" ], # TODO: move to extras_require in v3
248
287
extras_require = {"optional" : ["aiodns>1.0" ]},
249
288
setup_requires = pytest_runner ,
250
289
test_suite = "tests" ,
0 commit comments