Skip to content

Commit a7a928b

Browse files
authored
Updating CI workflow files and updating dependency versions (#968)
* Updating UT workflow file to run on every push * Update README.md * Enabling E2E for V3.x PRs * Fixing tables and badges in README.md * Updating dependency versions and cleaning up setup.py
1 parent 3755e68 commit a7a928b

File tree

9 files changed

+98
-84
lines changed

9 files changed

+98
-84
lines changed

.github/workflows/ci_e2e_workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ name: CI E2E tests
66
on:
77
workflow_dispatch:
88
push:
9-
branches: [ dev, master, main, release/* ]
9+
branches: [ "*dev", master, main, release/* ]
1010
pull_request:
11-
branches: [ dev, master, main, release/* ]
11+
branches: [ "*dev", master, main, release/* ]
1212
schedule:
1313
# Monday to Thursday 1 AM PDT build
1414
# * is a special character in YAML so you have to quote this string

.github/workflows/ut_ci_workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
name: CI Unit tests
55

66
on:
7+
workflow_dispatch:
78
schedule:
89
# Monday to Thursday 1 AM PDT build
910
# * is a special character in YAML so you have to quote this string
1011
- cron: "0 8 * * 1,2,3,4"
1112
push:
12-
branches: [ dev, master, main, release/* ]
1313
pull_request:
14-
branches: [ dev, master, main, release/* ]
14+
branches: [ "*dev", master, main, release/* ]
1515

1616
jobs:
1717
build:

README.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# <img src="https://raw.githubusercontent.com/Azure/azure-functions-python-worker/dev/docs/Azure.Functions.svg" width = "30" alt="Functions Header Image - Lightning Logo"> Azure Functions Python Worker
22

3-
|Branch|Status|CodeCov|Unittests|E2E tests|
4-
|---|---|---|---|---|
5-
|master|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/Azure.azure-functions-python-worker?branchName=master)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=57&branchName=master)|[![codecov](https://codecov.io/gh/Azure/azure-functions-python-worker/branch/master/graph/badge.svg)](https://codecov.io/gh/Azure/azure-functions-python-worker)|![CI Unit tests](https://github.com/Azure/azure-functions-python-worker/workflows/CI%20Unit%20tests/badge.svg?branch=master)|![CI E2E tests](https://github.com/Azure/azure-functions-python-worker/workflows/CI%20E2E%20tests/badge.svg?branch=master)
6-
|dev|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/Azure.azure-functions-python-worker?branchName=dev)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=57&branchName=dev)|[![codecov](https://codecov.io/gh/Azure/azure-functions-python-worker/branch/dev/graph/badge.svg)](https://codecov.io/gh/Azure/azure-functions-python-worker)|![CI Unit tests](https://github.com/Azure/azure-functions-python-worker/workflows/CI%20Unit%20tests/badge.svg?branch=dev)|![CI E2E tests](https://github.com/Azure/azure-functions-python-worker/workflows/CI%20E2E%20tests/badge.svg?branch=dev)
3+
| Branch | Status | CodeCov | Unittests | E2E tests |
4+
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
5+
| main | [![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/Azure.azure-functions-python-worker?branchName=main)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=57&branchName=main) | [![codecov](https://codecov.io/gh/Azure/azure-functions-python-worker/branch/main/graph/badge.svg)](https://codecov.io/gh/Azure/azure-functions-python-worker) | ![CI Unit tests](https://github.com/Azure/azure-functions-python-worker/workflows/CI%20Unit%20tests/badge.svg?branch=main) | ![CI E2E tests](https://github.com/Azure/azure-functions-python-worker/workflows/CI%20E2E%20tests/badge.svg?branch=main) |
6+
| dev | [![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/Azure.azure-functions-python-worker?branchName=dev)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=57&branchName=dev) | [![codecov](https://codecov.io/gh/Azure/azure-functions-python-worker/branch/dev/graph/badge.svg)](https://codecov.io/gh/Azure/azure-functions-python-worker) | ![CI Unit tests](https://github.com/Azure/azure-functions-python-worker/workflows/CI%20Unit%20tests/badge.svg?branch=dev) | ![CI E2E tests](https://github.com/Azure/azure-functions-python-worker/workflows/CI%20E2E%20tests/badge.svg?branch=dev) |
77

88
Python support for Azure Functions is based on Python 3.6, Python 3.7, and Python 3.8, serverless hosting on Linux and the Functions 2.0 and 3.0 runtime.
99

1010
Here is the current status of Python in Azure Functions:
1111

1212
What are the supported Python versions?
1313

14-
|Azure Functions Runtime|Python 3.6|Python 3.7|Python 3.8|Python 3.9|
15-
|---|---|---|---|---|
16-
|Azure Functions 2.0|||-|-|
17-
|Azure Functions 3.0||||(preview)|
14+
| Azure Functions Runtime | Python 3.6 | Python 3.7 | Python 3.8 | Python 3.9 |
15+
|-------------------------|------------|------------|------------|------------|
16+
| Azure Functions 2.0 ||| - | - |
17+
| Azure Functions 3.0 |||| (preview) |
1818

1919
What's available?
2020

@@ -23,9 +23,6 @@ What's available?
2323
- Deploy Python Function project in a custom docker image onto dedicated, or elastic premium plan.
2424
- Triggers / Bindings : HTTP, Blob, Queue, Timer, Cosmos DB, Event Grid, Event Hubs and Service Bus
2525
- Triggers / Bindings : Custom binding support
26-
27-
What's coming?
28-
2926
- [Durable Functions For Python](https://github.com/Azure/azure-functions-durable-python)
3027

3128
# Get Started
@@ -40,15 +37,15 @@ What's coming?
4037

4138
Issues and feature requests are tracked in a variety of places. To report this feedback, please file an issue to the relevant repository below:
4239

43-
|Item|Description|Link|
44-
|----|-----|-----|
45-
| Python Worker | Programming Model, Triggers & Bindings |[File an Issue](https://github.com/Azure/azure-functions-python-worker/issues)|
46-
| Linux | Base Docker Images |[File an Issue](https://github.com/Azure/azure-functions-docker/issues)|
47-
| Runtime | Script Host & Language Extensibility |[File an Issue](https://github.com/Azure/azure-functions-host/issues)|
48-
| VSCode | VSCode Extension for Azure Functions |[File an Issue](https://github.com/microsoft/vscode-azurefunctions/issues)
49-
| Core Tools | Command Line Interface for Local Development |[File an Issue](https://github.com/Azure/azure-functions-core-tools/issues)|
50-
| Portal | User Interface or Experience Issue |[File an Issue](https://github.com/azure/azure-functions-ux/issues)|
51-
| Templates | Code Issues with Creation Template |[File an Issue](https://github.com/Azure/azure-functions-templates/issues)|
40+
| Item | Description | Link |
41+
|---------------|----------------------------------------------|--------------------------------------------------------------------------------|
42+
| Python Worker | Programming Model, Triggers & Bindings | [File an Issue](https://github.com/Azure/azure-functions-python-worker/issues) |
43+
| Linux | Base Docker Images | [File an Issue](https://github.com/Azure/azure-functions-docker/issues) |
44+
| Runtime | Script Host & Language Extensibility | [File an Issue](https://github.com/Azure/azure-functions-host/issues) |
45+
| VSCode | VSCode Extension for Azure Functions | [File an Issue](https://github.com/microsoft/vscode-azurefunctions/issues) |
46+
| Core Tools | Command Line Interface for Local Development | [File an Issue](https://github.com/Azure/azure-functions-core-tools/issues) |
47+
| Portal | User Interface or Experience Issue | [File an Issue](https://github.com/azure/azure-functions-ux/issues) |
48+
| Templates | Code Issues with Creation Template | [File an Issue](https://github.com/Azure/azure-functions-templates/issues) |
5249

5350
# Contribute
5451

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)