From 5f9cee12eee9b355bf6fb64276519cc060ba2e18 Mon Sep 17 00:00:00 2001 From: pdthummar <101662222+pdthummar@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:40:31 -0600 Subject: [PATCH 1/5] testing e2e and unittests for py3.11 --- .github/workflows/ci_e2e_workflow.yml | 20 ++++++++++---------- .github/workflows/ci_ut_workflow.yml | 2 +- setup.py | 12 +++++++++--- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci_e2e_workflow.yml b/.github/workflows/ci_e2e_workflow.yml index 096a7ef74..932525270 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. @@ -101,16 +101,16 @@ jobs: AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString39 }} run: | python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend - - name: Running 3.10 Tests - if: matrix.python-version == 3.10 + - name: Running 3.11 Tests + if: matrix.python-version == 3.11 env: - AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }} - AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString310 }} - AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString310 }} - AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString310 }} - AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString310 }} - AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString310 }} - AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString310 }} + 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 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/setup.py b/setup.py index 257db4eb3..1afcda207 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, 10, 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 From 547f27cb7cb300cdaf3335e24b388312f686708d Mon Sep 17 00:00:00 2001 From: pdthummar <101662222+pdthummar@users.noreply.github.com> Date: Wed, 11 Jan 2023 12:28:30 -0600 Subject: [PATCH 2/5] update --- .github/workflows/ci_e2e_workflow.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci_e2e_workflow.yml b/.github/workflows/ci_e2e_workflow.yml index 932525270..54ddef009 100644 --- a/.github/workflows/ci_e2e_workflow.yml +++ b/.github/workflows/ci_e2e_workflow.yml @@ -101,6 +101,18 @@ jobs: AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString39 }} run: | python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend + - name: Running 3.10 Tests + if: matrix.python-version == 3.10 + env: + AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }} + AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString310 }} + AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString310 }} + AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString310 }} + AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString310 }} + AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString310 }} + 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: From 71925bdcc426526b2dbdf2b32ba9510977d0afc5 Mon Sep 17 00:00:00 2001 From: pdthummar <101662222+pdthummar@users.noreply.github.com> Date: Tue, 17 Jan 2023 18:26:17 -0600 Subject: [PATCH 3/5] updating file to use format_traceback's change of signature for 3.11 --- azure_functions_worker/logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 355793bd8d226607663e9dcddc63cbb0d54bc906 Mon Sep 17 00:00:00 2001 From: pdthummar <101662222+pdthummar@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:59:40 -0600 Subject: [PATCH 4/5] updated unittest to check python version for 3.11 --- tests/unittests/test_utilities.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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): From 55153db78701999590b1945046b8a4b99a32d776 Mon Sep 17 00:00:00 2001 From: pdthummar <101662222+pdthummar@users.noreply.github.com> Date: Thu, 19 Jan 2023 11:42:22 -0600 Subject: [PATCH 5/5] reverted protobuf and grpcio version for py3.10 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1afcda207..890509a9a 100644 --- a/setup.py +++ b/setup.py @@ -110,7 +110,7 @@ "python-dateutil~=2.8.2" ] -if sys.version_info[:3] < (3, 10, 0): +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")