Skip to content

Commit 0a7bd73

Browse files
authored
{LTS} Backport #31895: Support Python 3.13 (#32349)
1 parent cdbae4a commit 0a7bd73

File tree

12 files changed

+55
-93
lines changed

12 files changed

+55
-93
lines changed

.azure-pipelines/breaking-change-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
fetchTags: true
2323
persistCredentials: true
2424
- task: UsePythonVersion@0
25-
displayName: 'Use Python 3.12'
25+
displayName: 'Use Python 3.13'
2626
inputs:
27-
versionSpec: 3.12
27+
versionSpec: 3.13
2828
- template: ${{ variables.Pipeline.Workspace }}/.azure-pipelines/templates/azdev_setup.yml
2929
- bash: |
3030
set -ev

azure-pipelines-full-tests.yml

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ jobs:
7373
fullTest: true
7474
jobName: 'FullTest'
7575

76-
- job: AutomationFullTestPython39ProfileLatest
77-
displayName: Automation Full Test Python39 Profile Latest
76+
- job: AutomationFullTestPython312ProfileLatest
77+
displayName: Automation Full Test Python312 Profile Latest
7878
timeoutInMinutes: 9999
7979
strategy:
8080
maxParallel: 8
@@ -100,15 +100,15 @@ jobs:
100100
steps:
101101
- template: .azure-pipelines/templates/automation_test.yml
102102
parameters:
103-
pythonVersion: '3.9'
103+
pythonVersion: '3.12'
104104
profile: 'latest'
105105
instance_cnt: '8'
106106
instance_idx: '$(Instance_idx)'
107107
fullTest: true
108108
jobName: 'FullTest'
109109

110-
- job: AutomationFullTestPython312ProfileLatest
111-
displayName: Automation Full Test Python312 Profile Latest
110+
- job: AutomationFullTestPython313ProfileLatest
111+
displayName: Automation Full Test Python313 Profile Latest
112112
timeoutInMinutes: 9999
113113
strategy:
114114
maxParallel: 8
@@ -134,43 +134,9 @@ jobs:
134134
steps:
135135
- template: .azure-pipelines/templates/automation_test.yml
136136
parameters:
137-
pythonVersion: '3.12'
137+
pythonVersion: '3.13'
138138
profile: 'latest'
139139
instance_cnt: '8'
140140
instance_idx: '$(Instance_idx)'
141141
fullTest: true
142142
jobName: 'FullTest'
143-
144-
- job: NotifyCIErrors
145-
dependsOn:
146-
- AutomationTest20200901
147-
- AutomationTest20190301
148-
- AutomationTest20180301
149-
- AutomationFullTestPython39ProfileLatest
150-
condition: and(failed(), in(variables['Build.Reason'], 'BatchedCI'))
151-
displayName: Notify CI Errors
152-
pool:
153-
name: ${{ variables.ubuntu_pool }}
154-
steps:
155-
- task: UsePythonVersion@0
156-
displayName: 'Use Python 3.12'
157-
inputs:
158-
versionSpec: 3.12
159-
- task: AzureCLI@2
160-
inputs:
161-
azureSubscription: 'Azure CLI'
162-
scriptType: 'bash'
163-
scriptLocation: 'inlineScript'
164-
inlineScript: |
165-
pip install requests
166-
teams_api_url=$(az keyvault secret show --vault-name $(TEAMS_BOT_VAULT_NAME) --name $(TEAMS_BOT_API_URL_SECRET_NAME) --query value -otsv)
167-
teams_api_key=$(az keyvault secret show --vault-name $(TEAMS_BOT_VAULT_NAME) --name $(TEAMS_BOT_API_KEY_SECRET_NAME) --query value -otsv)
168-
echo "If any task fails, notify to teams channel"
169-
python scripts/ci/notify_ci_errors.py $teams_api_url $teams_api_key $(TEAMS_CHANNEL_ID)
170-
displayName: 'Notify To Teams Channel'
171-
env:
172-
BASE_URI: $(System.CollectionUri)
173-
PROJECT_TYPE: $(System.TeamProject)
174-
BUILD_ID: $(Build.BuildId)
175-
JOB_ID: $(System.JobId)
176-
enabled: false

azure-pipelines.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ jobs:
129129

130130
steps:
131131
- task: UsePythonVersion@0
132-
displayName: 'Use Python 3.12'
132+
displayName: 'Use Python 3.13'
133133
inputs:
134-
versionSpec: 3.12
134+
versionSpec: 3.13
135135

136136
- bash: ./scripts/ci/dependency_check.sh
137137
displayName: 'Verify src/azure-cli/requirements.py3.Linux.txt'
@@ -144,9 +144,9 @@ jobs:
144144

145145
steps:
146146
- task: UsePythonVersion@0
147-
displayName: 'Use Python 3.12'
147+
displayName: 'Use Python 3.13'
148148
inputs:
149-
versionSpec: 3.12
149+
versionSpec: 3.13
150150

151151
- bash: ./scripts/ci/dependency_check.sh
152152
displayName: 'Verify src/azure-cli/requirements.py3.Darwin.txt'
@@ -159,9 +159,9 @@ jobs:
159159

160160
steps:
161161
- task: UsePythonVersion@0
162-
displayName: 'Use Python 3.12'
162+
displayName: 'Use Python 3.13'
163163
inputs:
164-
versionSpec: 3.12
164+
versionSpec: 3.13
165165

166166
- task: BatchScript@1
167167
inputs:
@@ -176,9 +176,9 @@ jobs:
176176
name: ${{ variables.ubuntu_pool }}
177177
steps:
178178
- task: UsePythonVersion@0
179-
displayName: 'Use Python 3.12'
179+
displayName: 'Use Python 3.13'
180180
inputs:
181-
versionSpec: 3.12
181+
versionSpec: 3.13
182182
- template: .azure-pipelines/templates/azdev_setup.yml
183183
- bash: |
184184
set -ev
@@ -440,9 +440,9 @@ jobs:
440440
name: ${{ variables.ubuntu_pool }}
441441
steps:
442442
- task: UsePythonVersion@0
443-
displayName: 'Use Python 3.12'
443+
displayName: 'Use Python 3.13'
444444
inputs:
445-
versionSpec: 3.12
445+
versionSpec: 3.13
446446

447447
- task: PipAuthenticate@1
448448
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/release')
@@ -475,10 +475,10 @@ jobs:
475475
displayName: Test Python Wheels
476476
strategy:
477477
matrix:
478-
Python39:
479-
python.version: '3.9'
480478
Python312:
481479
python.version: '3.12'
480+
Python313:
481+
python.version: '3.13'
482482
dependsOn: BuildPythonWheel
483483
condition: succeeded()
484484
pool:
@@ -515,10 +515,10 @@ jobs:
515515
name: ${{ variables.ubuntu_pool }}
516516
strategy:
517517
matrix:
518-
Python39:
519-
python.version: '3.9'
520518
Python312:
521519
python.version: '3.12'
520+
Python313:
521+
python.version: '3.13'
522522
steps:
523523
- template: .azure-pipelines/templates/automation_test.yml
524524
parameters:
@@ -532,10 +532,10 @@ jobs:
532532
name: ${{ variables.ubuntu_pool }}
533533
strategy:
534534
matrix:
535-
Python39:
536-
python.version: '3.9'
537535
Python312:
538536
python.version: '3.12'
537+
Python313:
538+
python.version: '3.13'
539539
steps:
540540
- template: .azure-pipelines/templates/automation_test.yml
541541
parameters:
@@ -552,10 +552,10 @@ jobs:
552552
name: ${{ variables.ubuntu_pool }}
553553
strategy:
554554
matrix:
555-
Python39:
556-
python.version: '3.9'
557555
Python312:
558556
python.version: '3.12'
557+
Python313:
558+
python.version: '3.13'
559559
steps:
560560
- task: UsePythonVersion@0
561561
displayName: 'Use Python $(python.version)'
@@ -575,8 +575,8 @@ jobs:
575575
name: ${{ variables.ubuntu_pool }}
576576
strategy:
577577
matrix:
578-
Python312:
579-
python.version: '3.12'
578+
Python313:
579+
python.version: '3.13'
580580
steps:
581581
- task: UsePythonVersion@0
582582
displayName: 'Use Python $(python.version)'
@@ -1040,9 +1040,9 @@ jobs:
10401040
name: ${{ variables.ubuntu_pool }}
10411041
steps:
10421042
- task: UsePythonVersion@0
1043-
displayName: 'Use Python 3.12'
1043+
displayName: 'Use Python 3.13'
10441044
inputs:
1045-
versionSpec: 3.12
1045+
versionSpec: 3.13
10461046
- template: .azure-pipelines/templates/azdev_setup.yml
10471047
- bash: |
10481048
set -ev
@@ -1057,9 +1057,9 @@ jobs:
10571057
name: ${{ variables.ubuntu_pool }}
10581058
steps:
10591059
- task: UsePythonVersion@0
1060-
displayName: 'Use Python 3.12'
1060+
displayName: 'Use Python 3.13'
10611061
inputs:
1062-
versionSpec: 3.12
1062+
versionSpec: 3.13
10631063
- template: .azure-pipelines/templates/azdev_setup.yml
10641064
- bash: |
10651065
set -ev
@@ -1072,10 +1072,10 @@ jobs:
10721072
displayName: "PerformanceCheck"
10731073
strategy:
10741074
matrix:
1075-
Python39:
1076-
python.version: '3.9'
10771075
Python312:
10781076
python.version: '3.12'
1077+
Python313:
1078+
python.version: '3.13'
10791079
pool:
10801080
name: ${{ variables.ubuntu_pool }}
10811081
steps:
@@ -1103,9 +1103,9 @@ jobs:
11031103
name: ${{ variables.ubuntu_pool }}
11041104
steps:
11051105
- task: UsePythonVersion@0
1106-
displayName: 'Use Python 3.12'
1106+
displayName: 'Use Python 3.13'
11071107
inputs:
1108-
versionSpec: 3.12
1108+
versionSpec: 3.13
11091109
- template: .azure-pipelines/templates/azdev_setup.yml
11101110
- bash: |
11111111
set -ev
@@ -1126,9 +1126,9 @@ jobs:
11261126
name: ${{ variables.ubuntu_pool }}
11271127
steps:
11281128
- task: UsePythonVersion@0
1129-
displayName: 'Use Python 3.12'
1129+
displayName: 'Use Python 3.13'
11301130
inputs:
1131-
versionSpec: 3.12
1131+
versionSpec: 3.13
11321132
- template: .azure-pipelines/templates/azdev_setup.yml
11331133
- bash: |
11341134
set -ev

doc/command_guidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ Follow the [Error Handling Guidelines](https://github.com/Azure/azure-cli/blob/d
426426

427427
## Coding Practices
428428

429-
- All code must support Python 3.8 ~ 3.12
429+
- All code must support Python 3.9 ~ 3.13
430430
- PRs to Azure/azure-cli and Azure/azure-cli-extensions must pass CI
431431
- Code must pass style checks with pylint and pep8
432432
- (*) All commands should have tests

doc/extensions/authoring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ See [Extension Metadata](metadata.md) for more information.
130130

131131
### Test your extension on Python 3
132132

133-
- The Azure CLI supports Python 3.8 ~ 3.12 so verify that your extension does the same.
133+
- The Azure CLI supports Python 3.9 ~ 3.13 so verify that your extension does the same.
134134
- You can create virtual environments for different versions and run your extension in them.
135135
- e.g. `python3.8 -m venv env38` and `python3.10 -m venv env310`.
136136

doc/install_linux_prerequisites.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Some native Linux packages are required when installing the CLI with:
66
- Interactive installation script
77
- `pip`
88

9-
Current supported Python versions are Python 3.8 ~ 3.10.
9+
Current supported Python versions are Python 3.9 ~ 3.13.
1010

1111
The commands to run to install the dependencies for some common distributions are listed below.
1212

13-
### Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, Ubuntu 22.04 LTS, Debian 9, Debian 10, Debian 11
13+
### Ubuntu 22.04 LTS, Ubuntu 24.04 LTS, Debian 11, Debian 12
1414
```
1515
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev build-essential
1616
```
@@ -21,12 +21,3 @@ Install the latest Python 3.9 available in the software repo.
2121
sudo dnf install -y gcc libffi-devel python39-devel openssl-devel
2222
```
2323

24-
### SUSE OpenSUSE 13.2
25-
Install Python 3.8+ if needed.
26-
```
27-
sudo zypper refresh && sudo zypper --non-interactive install gcc libffi-devel python-devel openssl-devel
28-
```
29-
30-
### Flatcar
31-
32-
Python is installed in the Azure-specific distribution of Flatcar, but is installed into the non-standard location `/usr/share/oem/python/bin/python`.

scripts/ci/test_extensions.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ exit_code=0
2525
# Disable alias temporarily: https://github.com/Azure/azure-cli/pull/27717
2626
# hybridaks is going to be deprecated: https://github.com/Azure/azure-cli/pull/29838
2727
# db-up is going to be deprecated: https://github.com/Azure/azure-cli/pull/29887
28-
ignore_list='azure-cli-ml fzf arcappliance arcdata connectedk8s k8s-extension alias hybridaks db-up'
28+
# serviceconnector-passwordless's dependency is not compatible with 3.13 https://github.com/Azure/azure-cli/pull/31895
29+
ignore_list='azure-cli-ml fzf arcappliance arcdata connectedk8s k8s-extension alias hybridaks db-up serviceconnector-passwordless'
2930

3031
# Does not exit if az extension add fails until all extensions have been tested
3132
set +e
@@ -53,7 +54,7 @@ az self-test --debug
5354
if [ $? != 0 ]
5455
then
5556
exit_code=1
56-
echo "Failed to verify:" $ext
57+
echo "Failed to verify"
5758
fi
5859

5960
exit $exit_code

scripts/regression_test/regression_test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
steps:
2121
- task: UsePythonVersion@0
2222
inputs:
23-
versionSpec: '3.12'
24-
displayName: "Use Python 3.12"
25-
- task: AzureCLI@1
23+
versionSpec: '3.13'
24+
displayName: "Use Python 3.13"
25+
- task: AzureCLI@2
2626
displayName: 'update version'
2727
inputs:
2828
azureSubscription: $(AZURE_SDK_INFRA_SUB_CONNECTED_SERVICE)
@@ -88,9 +88,9 @@ jobs:
8888
steps:
8989
- task: UsePythonVersion@0
9090
inputs:
91-
versionSpec: '3.12'
92-
displayName: "Use Python 3.12"
93-
- task: AzureCLI@1
91+
versionSpec: '3.13'
92+
displayName: "Use Python 3.13"
93+
- task: AzureCLI@2
9494
displayName: 'Checkout Target Branch'
9595
inputs:
9696
azureSubscription: $(AZURE_SDK_INFRA_SUB_CONNECTED_SERVICE)

src/azure-cli-core/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
'Programming Language :: Python :: 3.10',
4141
'Programming Language :: Python :: 3.11',
4242
'Programming Language :: Python :: 3.12',
43+
'Programming Language :: Python :: 3.13',
4344
'License :: OSI Approved :: MIT License',
4445
]
4546

src/azure-cli-telemetry/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
'Programming Language :: Python :: 3.10',
2222
'Programming Language :: Python :: 3.11',
2323
'Programming Language :: Python :: 3.12',
24+
'Programming Language :: Python :: 3.13',
2425
'License :: OSI Approved :: MIT License',
2526
]
2627

0 commit comments

Comments
 (0)