diff --git a/CODEOWNERS b/CODEOWNERS index 978e1173..395d45fe 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -10,4 +10,4 @@ # For all file changes, github would automatically include the following people in the PRs. # -* @vrdmr @gavin-aguiar @YunchuWang @pdthummar @hallvictoria +* @vrdmr @gavin-aguiar @hallvictoria diff --git a/README.md b/README.md index f83b7c35..e5b9c07e 100644 --- a/README.md +++ b/README.md @@ -7,20 +7,20 @@ ## Overview -Python support for Azure Functions is based on Python 3.7, 3.8, 3.9, 3.10, and 3.11, serverless hosting on Linux, and the Functions 2.x ([EOL](https://learn.microsoft.com/azure/azure-functions/functions-versions?#retired-versions)), 3.x ([EOL](https://learn.microsoft.com/azure/azure-functions/functions-versions?#retired-versions)) and 4.0 runtime. +Python support for Azure Functions is based on Python 3.8, 3.9, 3.10, 3.11, and 3.12 serverless hosting on Linux, and the Functions 2.x ([EOL](https://learn.microsoft.com/azure/azure-functions/functions-versions?#retired-versions)), 3.x ([EOL](https://learn.microsoft.com/azure/azure-functions/functions-versions?#retired-versions)) and 4.0 runtime. Here is the current status of Python in Azure Functions: _What are the supported Python versions?_ -| Azure Functions Runtime | Python 3.6 | Python 3.7 | Python 3.8 | Python 3.9 | Python 3.10 | Python 3.11 | -|-------------------------|--------|-------|-------|--------|--------------|-------------| -| Azure Functions 3.0 | [EOL](https://learn.microsoft.com/azure/azure-functions/migrate-version-3-version-4)|[EOL](https://learn.microsoft.com/azure/azure-functions/migrate-version-3-version-4)|[EOL](https://learn.microsoft.com/azure/azure-functions/migrate-version-3-version-4)| [EOL](https://learn.microsoft.com/azure/azure-functions/migrate-version-3-version-4)| - |- | -| Azure Functions 4.0 | [EOL](https://azure.microsoft.com/en-au/updates/azure-functions-support-for-python-36-is-ending-on-30-september-2022/) | ✓ | ✓ | ✓ | ✓ | ✓ | +| Azure Functions Runtime | Python 3.8 | Python 3.9 | Python 3.10 | Python 3.11 | Python 3.12 | +|-------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|-------------|-------------|-------------| +| Azure Functions 3.0 | [EOL](https://learn.microsoft.com/azure/azure-functions/migrate-version-3-version-4) | [EOL](https://learn.microsoft.com/azure/azure-functions/migrate-version-3-version-4) | - | - | - | +| Azure Functions 4.0 | ✓ | ✓ | ✓ | ✓ | ✓ | _What's available?_ - Build, test, debug and publish using Azure Functions Core Tools (CLI) or Visual Studio Code -- Triggers / Bindings : HTTP, Blob, Queue, Timer, Cosmos DB, Event Grid, Event Hubs and Service Bus +- Triggers / Bindings : Blob, Cosmos DB, Event Grid, Event Hub, HTTP, Kafka, MySQL, Queue, ServiceBus, SQL, Timer, and Warmup - Create a Python Function on Linux using a custom docker image - Triggers / Bindings : Custom binding support diff --git a/azure/functions/_servicebus.py b/azure/functions/_servicebus.py index cd3efab7..fb45c244 100644 --- a/azure/functions/_servicebus.py +++ b/azure/functions/_servicebus.py @@ -75,7 +75,8 @@ def correlation_id(self) -> Optional[str]: @property def dead_letter_error_description(self) -> Optional[str]: - """Optionally describes the dead letter error description for the message. + """Optionally describes the dead letter error description + for the message. Returns: -------- @@ -87,7 +88,8 @@ def dead_letter_error_description(self) -> Optional[str]: @property def dead_letter_reason(self) -> Optional[str]: - """Optionally describes the dead letter reason description for the message. + """Optionally describes the dead letter reason description + for the message. Returns: -------- @@ -404,11 +406,12 @@ def to(self) -> Optional[str]: @property def transaction_partition_key(self) -> Optional[str]: - """If a message is sent via a transfer queue in the scope of a transaction, - this value selects the transfer queue partition: This is functionally - equivalent to PartitionKey and ensures that messages are kept together - and in order as they are transferred. Optionally describes the - partition key. Maximum length is 128 characters. + """If a message is sent via a transfer queue in the scope of a + transaction, this value selects the transfer queue partition: + This is functionally equivalent to PartitionKey and ensures + that messages are kept together and in order as they are + transferred. Optionally describes the partition key. Maximum + length is 128 characters. Returns: -------- diff --git a/azure/functions/decorators/function_app.py b/azure/functions/decorators/function_app.py index 1378b2cb..9c0b99f6 100644 --- a/azure/functions/decorators/function_app.py +++ b/azure/functions/decorators/function_app.py @@ -80,8 +80,9 @@ def __str__(self): return self.get_function_json() def __call__(self, *args, **kwargs): - """This would allow the Function object to be directly callable - and runnable directly using the interpreter locally. + """This would allow the Function object to be directly + callable and runnable directly using the interpreter + locally. Example: @app.route(route="http_trigger") diff --git a/eng/templates/ci-tests.yml b/eng/templates/ci-tests.yml index 2bee12f8..883486ff 100644 --- a/eng/templates/ci-tests.yml +++ b/eng/templates/ci-tests.yml @@ -14,6 +14,8 @@ jobs: PYTHON_VERSION: '3.10' python-311: PYTHON_VERSION: '3.11' + python-312: + PYTHON_VERSION: '3.12' steps: - task: UsePythonVersion@0 inputs: diff --git a/eng/templates/jobs/ci-tests.yml b/eng/templates/jobs/ci-tests.yml index 2bee12f8..883486ff 100644 --- a/eng/templates/jobs/ci-tests.yml +++ b/eng/templates/jobs/ci-tests.yml @@ -14,6 +14,8 @@ jobs: PYTHON_VERSION: '3.10' python-311: PYTHON_VERSION: '3.11' + python-312: + PYTHON_VERSION: '3.12' steps: - task: UsePythonVersion@0 inputs: diff --git a/setup.py b/setup.py index 704dc48a..b9e84ac5 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,13 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +import sys + from setuptools import find_packages, setup from azure.functions import __version__ EXTRA_REQUIRES = { 'dev': [ - 'flake8~=4.0.1', 'flake8-logging-format', 'mypy', 'pytest', @@ -17,6 +18,15 @@ ] } +if sys.version_info[:2] <= (3, 11): + EXTRA_REQUIRES.get('dev').append( + "flake8~=4.0.1" + ) +else: + EXTRA_REQUIRES.get('dev').append( + "flake8~=7.1.1" + ) + with open("README.md") as readme: long_description = readme.read() diff --git a/tests/decorators/test_eventgrid.py b/tests/decorators/test_eventgrid.py index 15800002..170ca573 100644 --- a/tests/decorators/test_eventgrid.py +++ b/tests/decorators/test_eventgrid.py @@ -5,8 +5,9 @@ from azure.functions.decorators.constants import EVENT_GRID_TRIGGER, EVENT_GRID from azure.functions.decorators.core import BindingDirection, \ DataType -from azure.functions.decorators.eventgrid import EventGridTrigger,\ - EventGridOutput +from azure.functions.decorators.eventgrid import ( + EventGridTrigger, + EventGridOutput) class TestEventGrid(unittest.TestCase): diff --git a/tests/test_servicebus.py b/tests/test_servicebus.py index b02635de..88592f7f 100644 --- a/tests/test_servicebus.py +++ b/tests/test_servicebus.py @@ -648,11 +648,12 @@ def _generate_single_trigger_metadata(self) -> Dict[str, meta.Datum]: "ServerBusyExceptionMessage": null } }''') - mocked_metadata['ApplicationProperties'] = meta.Datum(type='json', value=''' + mocked_metadata['ApplicationProperties'] = ( + meta.Datum(type='json', value=''' { "application": "value" } - ''') + ''')) mocked_metadata['UserProperties'] = meta.Datum(type='json', value=''' { "$AzureWebJobsParentId": "6ceef68b-0794-45dd-bb2e-630748515552",