Skip to content

Commit 185f38d

Browse files
committed
Updating dependency versions and cleaning up setup.py
1 parent d3acd32 commit 185f38d

File tree

6 files changed

+77
-60
lines changed

6 files changed

+77
-60
lines changed

setup.py

Lines changed: 69 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,64 @@
7979
"""
8080

8181

82+
CLASSIFIERS = [
83+
"Development Status :: 5 - Production/Stable",
84+
'Programming Language :: Python',
85+
"Programming Language :: Python :: 3",
86+
"Programming Language :: Python :: 3.6",
87+
"Programming Language :: Python :: 3.7",
88+
"Programming Language :: Python :: 3.8",
89+
"Programming Language :: Python :: 3.9",
90+
"Operating System :: Microsoft :: Windows",
91+
"Operating System :: POSIX",
92+
"Operating System :: MacOS :: MacOS X",
93+
"Environment :: Web Environment",
94+
"License :: OSI Approved :: MIT License",
95+
"Intended Audience :: Developers",
96+
]
97+
98+
99+
PACKAGES = [
100+
"azure_functions_worker",
101+
"azure_functions_worker.protos",
102+
"azure_functions_worker.protos.identity",
103+
"azure_functions_worker.protos.shared",
104+
"azure_functions_worker.bindings",
105+
"azure_functions_worker.bindings.shared_memory_data_transfer",
106+
"azure_functions_worker.utils",
107+
"azure_functions_worker._thirdparty"
108+
]
109+
110+
111+
INSTALL_REQUIRES = [
112+
"grpcio~=1.43.0",
113+
"grpcio-tools~=1.43.0",
114+
"protobuf~=3.19.3",
115+
"azure-functions==1.9.0"
116+
]
117+
118+
119+
EXTRA_REQUIRES = {
120+
"dev": [
121+
"azure-eventhub~=5.7.0", # Used for EventHub E2E tests
122+
"python-dateutil~=2.8.2",
123+
"pycryptodome~=3.10.1",
124+
"flake8~=4.0.1",
125+
"mypy",
126+
"pytest",
127+
"requests==2.*",
128+
"coverage",
129+
"pytest-sugar",
130+
"pytest-cov",
131+
"pytest-xdist",
132+
"pytest-randomly",
133+
"pytest-instafail",
134+
"pytest-rerunfailures",
135+
"ptvsd"
136+
]
137+
}
138+
139+
82140
class BuildGRPC:
83141
"""Generate gRPC bindings."""
84142
def _gen_grpc(self):
@@ -353,6 +411,12 @@ def run(self):
353411
with open("README.md") as readme:
354412
long_description = readme.read()
355413

414+
COMMAND_CLASS = {
415+
'develop': develop,
416+
'build': build,
417+
'webhost': webhost,
418+
'extension': extension
419+
}
356420

357421
setup(
358422
name='azure-functions-worker',
@@ -364,59 +428,12 @@ def run(self):
364428
url="https://github.com/Azure/azure-functions-python-worker",
365429
long_description=long_description,
366430
long_description_content_type='text/markdown',
367-
classifiers=[
368-
'Development Status :: 5 - Production/Stable',
369-
'License :: OSI Approved :: MIT License',
370-
'Intended Audience :: Developers',
371-
'Programming Language :: Python :: 3',
372-
'Programming Language :: Python :: 3.6',
373-
'Programming Language :: Python :: 3.7',
374-
'Programming Language :: Python :: 3.8',
375-
'Programming Language :: Python :: 3.9',
376-
'Operating System :: Microsoft :: Windows',
377-
'Operating System :: POSIX',
378-
'Operating System :: MacOS :: MacOS X',
379-
'Environment :: Web Environment',
380-
],
431+
classifiers=CLASSIFIERS,
381432
license='MIT',
382-
packages=['azure_functions_worker',
383-
'azure_functions_worker.protos',
384-
'azure_functions_worker.protos.identity',
385-
'azure_functions_worker.protos.shared',
386-
'azure_functions_worker.bindings',
387-
'azure_functions_worker.bindings.shared_memory_data_transfer',
388-
'azure_functions_worker.utils',
389-
'azure_functions_worker._thirdparty'],
390-
install_requires=[
391-
'grpcio~=1.33.2',
392-
'grpcio-tools~=1.33.2',
393-
],
394-
extras_require={
395-
'dev': [
396-
'azure-functions==1.8.0',
397-
'azure-eventhub~=5.1.0',
398-
'python-dateutil~=2.8.1',
399-
'pycryptodome~=3.10.1',
400-
'flake8~=3.7.9',
401-
'mypy',
402-
'pytest',
403-
'requests==2.*',
404-
'coverage',
405-
'pytest-sugar',
406-
'pytest-cov',
407-
'pytest-xdist',
408-
'pytest-randomly',
409-
'pytest-instafail',
410-
'pytest-rerunfailures',
411-
'ptvsd'
412-
]
413-
},
433+
packages=PACKAGES,
434+
install_requires=INSTALL_REQUIRES,
435+
extras_require=EXTRA_REQUIRES,
414436
include_package_data=True,
415-
cmdclass={
416-
'develop': develop,
417-
'build': build,
418-
'webhost': webhost,
419-
'extension': extension
420-
},
437+
cmdclass=COMMAND_CLASS,
421438
test_suite='tests'
422439
)

tests/endtoend/eventhub_batch_functions/metadata_output_batch/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ def main(req: func.HttpRequest):
3333
with client:
3434
client.send_batch(event_data_batch)
3535

36-
return f'OK'
36+
return 'OK'

tests/endtoend/eventhub_functions/metadata_output/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ async def main(req: func.HttpRequest):
3232
finally:
3333
await client.close()
3434

35-
return f'OK'
35+
return 'OK'

tests/unittests/resources/customer_func_path/common_module/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4-
__version__: str == 'function_app'
4+
__version__: str = 'function_app'
55

66
import os
77
# This module should be shadowed from customer_deps_path/common_module

tests/unittests/resources/customer_func_path/func_specific_module/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4-
__version__: str == 'function_app'
4+
__version__: str = 'function_app'
55

66
import os
77
# ./tests/unittests/resources/customer_func_path/func_specific_module

tests/unittests/test_dispatcher.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ async def test_dispatcher_initialize_worker_logging(self):
6363
async with self._ctrl as host:
6464
r = await host.init_worker('3.0.12345')
6565
self.assertEqual(
66-
len([l for l in r.logs if l.message.startswith(
66+
len([log for log in r.logs if log.message.startswith(
6767
'Received WorkerInitRequest'
6868
)]),
6969
1
7070
)
7171

7272
self.assertEqual(
73-
len([l for l in r.logs if l.message.startswith(
73+
len([log for log in r.logs if log.message.startswith(
7474
'To enable debug level logging'
7575
)]),
7676
1
@@ -86,14 +86,14 @@ async def test_dispatcher_environment_reload_logging(self):
8686
# Reload environment variable on specialization
8787
r = await host.reload_environment(environment={})
8888
self.assertEqual(
89-
len([l for l in r.logs if l.message.startswith(
89+
len([log for log in r.logs if log.message.startswith(
9090
'Received FunctionEnvironmentReloadRequest'
9191
)]),
9292
1
9393
)
9494

9595
self.assertEqual(
96-
len([l for l in r.logs if l.message.startswith(
96+
len([log for log in r.logs if log.message.startswith(
9797
'To enable debug level logging'
9898
)]),
9999
1

0 commit comments

Comments
 (0)