diff --git a/.github/workflows/ci_e2e_workflow.yml b/.github/workflows/ci_e2e_workflow.yml index 096a7ef74..54ddef009 100644 --- a/.github/workflows/ci_e2e_workflow.yml +++ b/.github/workflows/ci_e2e_workflow.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ 3.7, 3.8, 3.9, "3.10" ] + python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ] steps: - name: Checkout code. @@ -113,6 +113,18 @@ jobs: AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString310 }} run: | python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend + - name: Running 3.11 Tests + if: matrix.python-version == 3.11 + env: + AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString311 }} + AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString311 }} + AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString311 }} + AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString311 }} + AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString311 }} + AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString311 }} + AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString311 }} + run: | + python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend - name: Codecov uses: codecov/codecov-action@v1.0.13 with: diff --git a/.github/workflows/ci_ut_workflow.yml b/.github/workflows/ci_ut_workflow.yml index 4c7422f4a..965a4489c 100644 --- a/.github/workflows/ci_ut_workflow.yml +++ b/.github/workflows/ci_ut_workflow.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ 3.7, 3.8, 3.9, "3.10" ] + python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/azure_functions_worker/logging.py b/azure_functions_worker/logging.py index 5b38c22c9..0e6bc79c6 100644 --- a/azure_functions_worker/logging.py +++ b/azure_functions_worker/logging.py @@ -28,7 +28,7 @@ def format_exception(exception: Exception) -> str: etype=type(exception), tb=exception.__traceback__, value=exception)) - elif (sys.version_info.major, sys.version_info.minor) == (3, 10): + elif (sys.version_info.major, sys.version_info.minor) >= (3, 10): msg += ''.join(traceback.format_exception(exception)) else: msg = str(exception) diff --git a/setup.py b/setup.py index 257db4eb3..890509a9a 100644 --- a/setup.py +++ b/setup.py @@ -106,13 +106,19 @@ ] INSTALL_REQUIRES = [ - "grpcio~=1.43.0", - "grpcio-tools~=1.43.0", - "protobuf~=3.19.3", 'azure-functions==1.13.0b1', "python-dateutil~=2.8.2" ] +if sys.version_info[:3] < (3, 11, 0): + INSTALL_REQUIRES.append("protobuf~=3.19.3") + INSTALL_REQUIRES.append("grpcio-tools~=1.43.0") + INSTALL_REQUIRES.append("grpcio~=1.43.0") +else: + INSTALL_REQUIRES.append("protobuf~=4.21.9") + INSTALL_REQUIRES.append("grpcio-tools~=1.50.0") + INSTALL_REQUIRES.append("grpcio~=1.50.0") + EXTRA_REQUIRES = { "dev": [ "azure-eventhub~=5.7.0", # Used for EventHub E2E tests diff --git a/tests/unittests/test_utilities.py b/tests/unittests/test_utilities.py index 7112a27c5..70feb7429 100644 --- a/tests/unittests/test_utilities.py +++ b/tests/unittests/test_utilities.py @@ -318,13 +318,15 @@ def test_is_python_version(self): is_python_version_38 = common.is_python_version('3.8') is_python_version_39 = common.is_python_version('3.9') is_python_version_310 = common.is_python_version('3.10') + is_python_version_311 = common.is_python_version('3.11') self.assertTrue(any([ is_python_version_36, is_python_version_37, is_python_version_38, is_python_version_39, - is_python_version_310 + is_python_version_310, + is_python_version_311 ])) def test_get_sdk_from_sys_path(self):