Skip to content

Commit 48a5758

Browse files
hallvictoriaVictoria Hall
and
Victoria Hall
authored
test: run tests for 312 (#254)
* run tests for python 3.12 * update readme * readme fix * update codeowners and lint * flake8 version for 3.12 * formatting for setup.py * syntax --------- Co-authored-by: Victoria Hall <[email protected]>
1 parent 2e8ba4b commit 48a5758

File tree

9 files changed

+41
-21
lines changed

9 files changed

+41
-21
lines changed

CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
# For all file changes, github would automatically include the following people in the PRs.
1111
#
1212

13-
* @vrdmr @gavin-aguiar @YunchuWang @pdthummar @hallvictoria
13+
* @vrdmr @gavin-aguiar @hallvictoria

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77

88
## Overview
99

10-
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.
10+
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.
1111

1212
Here is the current status of Python in Azure Functions:
1313

1414
_What are the supported Python versions?_
1515

16-
| Azure Functions Runtime | Python 3.6 | Python 3.7 | Python 3.8 | Python 3.9 | Python 3.10 | Python 3.11 |
17-
|-------------------------|--------|-------|-------|--------|--------------|-------------|
18-
| 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)| - |- |
19-
| Azure Functions 4.0 | [EOL](https://azure.microsoft.com/en-au/updates/azure-functions-support-for-python-36-is-ending-on-30-september-2022/) | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; |
16+
| Azure Functions Runtime | Python 3.8 | Python 3.9 | Python 3.10 | Python 3.11 | Python 3.12 |
17+
|-------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|-------------|-------------|-------------|
18+
| 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) | - | - | - |
19+
| Azure Functions 4.0 | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; |
2020

2121
_What's available?_
2222
- Build, test, debug and publish using Azure Functions Core Tools (CLI) or Visual Studio Code
23-
- Triggers / Bindings : HTTP, Blob, Queue, Timer, Cosmos DB, Event Grid, Event Hubs and Service Bus
23+
- Triggers / Bindings : Blob, Cosmos DB, Event Grid, Event Hub, HTTP, Kafka, MySQL, Queue, ServiceBus, SQL, Timer, and Warmup
2424
- Create a Python Function on Linux using a custom docker image
2525
- Triggers / Bindings : Custom binding support
2626

azure/functions/_servicebus.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def correlation_id(self) -> Optional[str]:
7575

7676
@property
7777
def dead_letter_error_description(self) -> Optional[str]:
78-
"""Optionally describes the dead letter error description for the message.
78+
"""Optionally describes the dead letter error description
79+
for the message.
7980
8081
Returns:
8182
--------
@@ -87,7 +88,8 @@ def dead_letter_error_description(self) -> Optional[str]:
8788

8889
@property
8990
def dead_letter_reason(self) -> Optional[str]:
90-
"""Optionally describes the dead letter reason description for the message.
91+
"""Optionally describes the dead letter reason description
92+
for the message.
9193
9294
Returns:
9395
--------
@@ -404,11 +406,12 @@ def to(self) -> Optional[str]:
404406

405407
@property
406408
def transaction_partition_key(self) -> Optional[str]:
407-
"""If a message is sent via a transfer queue in the scope of a transaction,
408-
this value selects the transfer queue partition: This is functionally
409-
equivalent to PartitionKey and ensures that messages are kept together
410-
and in order as they are transferred. Optionally describes the
411-
partition key. Maximum length is 128 characters.
409+
"""If a message is sent via a transfer queue in the scope of a
410+
transaction, this value selects the transfer queue partition:
411+
This is functionally equivalent to PartitionKey and ensures
412+
that messages are kept together and in order as they are
413+
transferred. Optionally describes the partition key. Maximum
414+
length is 128 characters.
412415
413416
Returns:
414417
--------

azure/functions/decorators/function_app.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ def __str__(self):
8080
return self.get_function_json()
8181

8282
def __call__(self, *args, **kwargs):
83-
"""This would allow the Function object to be directly callable
84-
and runnable directly using the interpreter locally.
83+
"""This would allow the Function object to be directly
84+
callable and runnable directly using the interpreter
85+
locally.
8586
8687
Example:
8788
@app.route(route="http_trigger")

eng/templates/ci-tests.yml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
PYTHON_VERSION: '3.10'
1515
python-311:
1616
PYTHON_VERSION: '3.11'
17+
python-312:
18+
PYTHON_VERSION: '3.12'
1719
steps:
1820
- task: UsePythonVersion@0
1921
inputs:

eng/templates/jobs/ci-tests.yml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
PYTHON_VERSION: '3.10'
1515
python-311:
1616
PYTHON_VERSION: '3.11'
17+
python-312:
18+
PYTHON_VERSION: '3.12'
1719
steps:
1820
- task: UsePythonVersion@0
1921
inputs:

setup.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4+
import sys
5+
46
from setuptools import find_packages, setup
57
from azure.functions import __version__
68

79
EXTRA_REQUIRES = {
810
'dev': [
9-
'flake8~=4.0.1',
1011
'flake8-logging-format',
1112
'mypy',
1213
'pytest',
@@ -17,6 +18,15 @@
1718
]
1819
}
1920

21+
if sys.version_info[:2] <= (3, 11):
22+
EXTRA_REQUIRES.get('dev').append(
23+
"flake8~=4.0.1"
24+
)
25+
else:
26+
EXTRA_REQUIRES.get('dev').append(
27+
"flake8~=7.1.1"
28+
)
29+
2030
with open("README.md") as readme:
2131
long_description = readme.read()
2232

tests/decorators/test_eventgrid.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
from azure.functions.decorators.constants import EVENT_GRID_TRIGGER, EVENT_GRID
66
from azure.functions.decorators.core import BindingDirection, \
77
DataType
8-
from azure.functions.decorators.eventgrid import EventGridTrigger,\
9-
EventGridOutput
8+
from azure.functions.decorators.eventgrid import (
9+
EventGridTrigger,
10+
EventGridOutput)
1011

1112

1213
class TestEventGrid(unittest.TestCase):

tests/test_servicebus.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -648,11 +648,12 @@ def _generate_single_trigger_metadata(self) -> Dict[str, meta.Datum]:
648648
"ServerBusyExceptionMessage": null
649649
}
650650
}''')
651-
mocked_metadata['ApplicationProperties'] = meta.Datum(type='json', value='''
651+
mocked_metadata['ApplicationProperties'] = (
652+
meta.Datum(type='json', value='''
652653
{
653654
"application": "value"
654655
}
655-
''')
656+
'''))
656657
mocked_metadata['UserProperties'] = meta.Datum(type='json', value='''
657658
{
658659
"$AzureWebJobsParentId": "6ceef68b-0794-45dd-bb2e-630748515552",

0 commit comments

Comments
 (0)