Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: run tests for 312 #254

Merged
merged 9 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 10 additions & 7 deletions azure/functions/_servicebus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
--------
Expand All @@ -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:
--------
Expand Down Expand Up @@ -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:
--------
Expand Down
5 changes: 3 additions & 2 deletions azure/functions/decorators/function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions eng/templates/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions eng/templates/jobs/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 11 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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(
hallvictoria marked this conversation as resolved.
Show resolved Hide resolved
"flake8~=7.1.1"
)

with open("README.md") as readme:
long_description = readme.read()

Expand Down
5 changes: 3 additions & 2 deletions tests/decorators/test_eventgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
5 changes: 3 additions & 2 deletions tests/test_servicebus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down