From 6f2b925c42e014dcfb616efea14b3c9cc7c51a7f Mon Sep 17 00:00:00 2001 From: Hang Date: Fri, 2 Aug 2024 10:57:37 +0800 Subject: [PATCH] [Packaging] Support Python 3.12 (#29465) --- .azure-pipelines/breaking-change-tests.yml | 4 +-- azure-pipelines-full-tests.yml | 40 +++++++++++++++++++++ doc/command_guidelines.md | 2 +- scripts/regression_test/regression_test.yml | 8 ++--- src/azure-cli-core/setup.py | 1 + src/azure-cli-telemetry/setup.py | 1 + src/azure-cli-testsdk/setup.py | 1 + src/azure-cli/setup.py | 1 + 8 files changed, 51 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines/breaking-change-tests.yml b/.azure-pipelines/breaking-change-tests.yml index 619b2e1b367..80091f7e703 100644 --- a/.azure-pipelines/breaking-change-tests.yml +++ b/.azure-pipelines/breaking-change-tests.yml @@ -22,9 +22,9 @@ jobs: fetchTags: true persistCredentials: true - task: UsePythonVersion@0 - displayName: 'Use Python 3.10' + displayName: 'Use Python 3.11' inputs: - versionSpec: 3.10 + versionSpec: 3.11 - template: ${{ variables.Pipeline.Workspace }}/.azure-pipelines/templates/azdev_setup.yml - bash: | set -ev diff --git a/azure-pipelines-full-tests.yml b/azure-pipelines-full-tests.yml index dae3b2ce5ae..d3f8a3e0d96 100644 --- a/azure-pipelines-full-tests.yml +++ b/azure-pipelines-full-tests.yml @@ -27,6 +27,8 @@ jobs: python.version: '3.9' Python311: python.version: '3.11' + Python312: + python.version: '3.12' steps: - template: .azure-pipelines/templates/automation_test.yml parameters: @@ -46,6 +48,8 @@ jobs: python.version: '3.9' Python311: python.version: '3.11' + Python312: + python.version: '3.12' steps: - template: .azure-pipelines/templates/automation_test.yml parameters: @@ -65,6 +69,8 @@ jobs: python.version: '3.9' Python311: python.version: '3.11' + Python312: + python.version: '3.12' steps: - template: .azure-pipelines/templates/automation_test.yml parameters: @@ -141,6 +147,40 @@ jobs: fullTest: true jobName: 'FullTest' +- job: AutomationFullTestPython312ProfileLatest + displayName: Automation Full Test Python312 Profile Latest + timeoutInMinutes: 9999 + strategy: + maxParallel: 8 + matrix: + instance1: + Instance_idx: 1 + instance2: + Instance_idx: 2 + instance3: + Instance_idx: 3 + instance4: + Instance_idx: 4 + instance5: + Instance_idx: 5 + instance6: + Instance_idx: 6 + instance7: + Instance_idx: 7 + instance8: + Instance_idx: 8 + pool: + name: ${{ variables.ubuntu_pool }} + steps: + - template: .azure-pipelines/templates/automation_test.yml + parameters: + pythonVersion: '3.12' + profile: 'latest' + instance_cnt: '8' + instance_idx: '$(Instance_idx)' + fullTest: true + jobName: 'FullTest' + - job: NotifyCIErrors dependsOn: - AutomationTest20200901 diff --git a/doc/command_guidelines.md b/doc/command_guidelines.md index 210998c996e..ff2b24dfdeb 100644 --- a/doc/command_guidelines.md +++ b/doc/command_guidelines.md @@ -426,7 +426,7 @@ Follow the [Error Handling Guidelines](https://github.com/Azure/azure-cli/blob/d ## Coding Practices -- All code must support Python 3.8 ~ 3.10 +- All code must support Python 3.8 ~ 3.12 - PRs to Azure/azure-cli and Azure/azure-cli-extensions must pass CI - Code must pass style checks with pylint and pep8 - (*) All commands should have tests diff --git a/scripts/regression_test/regression_test.yml b/scripts/regression_test/regression_test.yml index df94668f002..27890a81d98 100644 --- a/scripts/regression_test/regression_test.yml +++ b/scripts/regression_test/regression_test.yml @@ -20,8 +20,8 @@ jobs: steps: - task: UsePythonVersion@0 inputs: - versionSpec: '3.10' - displayName: "Use Python 3.10" + versionSpec: '3.11' + displayName: "Use Python 3.11" - task: AzureCLI@1 displayName: 'update version' inputs: @@ -88,8 +88,8 @@ jobs: steps: - task: UsePythonVersion@0 inputs: - versionSpec: '3.10' - displayName: "Use Python 3.10" + versionSpec: '3.11' + displayName: "Use Python 3.11" - task: AzureCLI@1 displayName: 'Checkout Target Branch' inputs: diff --git a/src/azure-cli-core/setup.py b/src/azure-cli-core/setup.py index 9cadc7f2a67..07ce00d7549 100644 --- a/src/azure-cli-core/setup.py +++ b/src/azure-cli-core/setup.py @@ -39,6 +39,7 @@ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'License :: OSI Approved :: MIT License', ] diff --git a/src/azure-cli-telemetry/setup.py b/src/azure-cli-telemetry/setup.py index 55a52d35252..d188fa71f95 100755 --- a/src/azure-cli-telemetry/setup.py +++ b/src/azure-cli-telemetry/setup.py @@ -20,6 +20,7 @@ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'License :: OSI Approved :: MIT License', ] diff --git a/src/azure-cli-testsdk/setup.py b/src/azure-cli-testsdk/setup.py index 56ffeb6be42..4f567ef6705 100644 --- a/src/azure-cli-testsdk/setup.py +++ b/src/azure-cli-testsdk/setup.py @@ -19,6 +19,7 @@ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'License :: OSI Approved :: MIT License', ] diff --git a/src/azure-cli/setup.py b/src/azure-cli/setup.py index 21fbc84283a..c6682f7b163 100644 --- a/src/azure-cli/setup.py +++ b/src/azure-cli/setup.py @@ -46,6 +46,7 @@ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'License :: OSI Approved :: MIT License', ]