Skip to content
This repository was archived by the owner on May 22, 2026. It is now read-only.

Commit 10b1465

Browse files
author
iscai-msft
committed
Merge branch 'main' of https://github.com/Azure/autorest.python into optionsCleanup
2 parents 8909767 + c1a85c5 commit 10b1465

14 files changed

Lines changed: 236 additions & 104 deletions

File tree

eng/pipelines/ci.yml

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ resources:
1818
name: Azure/azure-sdk-tools
1919

2020
variables:
21-
PythonVersion: "3.12"
22-
AUTOREST_TESTSERVER_COVERAGE_DIRECTORY: "$(Build.SourcesDirectory)/autorest.python/packages/autorest.python/coverage/"
23-
PROXY_URL: http://localhost:5000
24-
PROXY_MANUAL_START: true
21+
- template: /eng/pipelines/templates/variables/image.yml
22+
- name: PythonVersion
23+
value: "3.12"
24+
- name: AUTOREST_TESTSERVER_COVERAGE_DIRECTORY
25+
value: "$(Build.SourcesDirectory)/autorest.python/packages/autorest.python/coverage/"
26+
- name: PROXY_URL
27+
value: http://localhost:5000
28+
- name : PROXY_MANUAL_START
29+
value: true
2530

2631
parameters:
2732
- name: VerificationPackages
@@ -46,32 +51,40 @@ jobs:
4651
matrix:
4752
Linux_Python3.9:
4853
OSName: "Linux"
49-
OSVmImage: "MMSUbuntu18.04"
54+
Pool: ${{ variables.LINUXPOOL }}
55+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
5056
PythonVersion: "3.9"
5157
Windows_Python3.9:
5258
OSName: "Windows"
53-
OSVmImage: "MMS2020"
54-
PythonVersion: "3.9"
59+
# TODO: Update to WINDOWSPOOL and WINDOWSVMIMAGE once tests pass
60+
Pool: ${{ variables.LINUXPOOL }}
61+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
62+
PythonVersion: "3.9"
5563
Linux_Python3.10:
5664
OSName: "Linux"
57-
OSVmImage: "MMSUbuntu20.04"
65+
Pool: ${{ variables.LINUXPOOL }}
66+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
5867
PythonVersion: "3.10"
5968
Linux_Python3.11:
6069
OSName: "Linux"
61-
OSVmImage: "MMSUbuntu22.04"
70+
Pool: ${{ variables.LINUXPOOL }}
71+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
6272
PythonVersion: "3.11"
6373
Linux_Python3.12:
6474
OSName: "Linux"
65-
OSVmImage: "MMSUbuntu22.04"
75+
Pool: ${{ variables.LINUXPOOL }}
76+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
6677
PythonVersion: "3.12"
6778
Windows_Python3.12:
6879
OSName: "Windows"
69-
OSVmImage: "MMS2023"
80+
# TODO: Update to WINDOWSPOOL and WINDOWSVMIMAGE once tests pass
81+
Pool: ${{ variables.LINUXPOOL }}
82+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
7083
PythonVersion: "3.12"
7184

7285
pool:
73-
name: azsdk-pool-mms-ubuntu-2004-general
74-
vmImage: $(OSVmImage)
86+
name: $(Pool)
87+
demands: ImageOverride -equals $(OSVmImage)
7588

7689
steps:
7790
- template: ci-template.yml
@@ -139,32 +152,40 @@ jobs:
139152
matrix:
140153
Linux_Python3.9:
141154
OSName: "Linux"
142-
OSVmImage: "MMSUbuntu18.04"
155+
Pool: ${{ variables.LINUXPOOL }}
156+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
143157
PythonVersion: "3.9"
144158
Windows_Python3.9:
145159
OSName: "Windows"
146-
OSVmImage: "MMS2020"
160+
# TODO: Update to WINDOWSPOOL and WINDOWSVMIMAGE once tests pass
161+
Pool: ${{ variables.LINUXPOOL }}
162+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
147163
PythonVersion: "3.9"
148164
Linux_Python310:
149165
OSName: "Linux"
150-
OSVmImage: "MMSUbuntu20.04"
166+
Pool: ${{ variables.LINUXPOOL }}
167+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
151168
PythonVersion: "3.10"
152169
Linux_Python311:
153170
OSName: "Linux"
154-
OSVmImage: "MMSUbuntu22.04"
171+
Pool: ${{ variables.LINUXPOOL }}
172+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
155173
PythonVersion: "3.11"
156174
Linux_Python312:
157175
OSName: "Linux"
158-
OSVmImage: "MMSUbuntu22.04"
176+
Pool: ${{ variables.LINUXPOOL }}
177+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
159178
PythonVersion: "3.12"
160179
Windows_Python312:
161180
OSName: "Windows"
162-
OSVmImage: "MMS2023"
181+
# TODO: Update to WINDOWSPOOL and WINDOWSVMIMAGE once tests pass
182+
Pool: ${{ variables.LINUXPOOL }}
183+
OSVmImage: ${{ variables.LINUXVMIMAGE}}
163184
PythonVersion: "3.12"
164185

165186
pool:
166-
name: azsdk-pool-mms-ubuntu-2004-general
167-
vmImage: $(OSVmImage)
187+
name: $(Pool)
188+
demands: ImageOverride -equals $(OSVmImage)
168189

169190
steps:
170191
- template: ci-template.yml

eng/pipelines/preview.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ resources:
3030
ref: refs/heads/main
3131

3232
variables:
33-
PythonVersion: "3.10"
33+
- template: /eng/pipelines/templates/variables/image.yml
34+
- name: PythonVersion
35+
value: "3.10"
3436

3537
pool:
36-
name: azsdk-pool-mms-ubuntu-2004-general
37-
vmImage: MMSUbuntu20.04
38+
name: $(LINUXPOOL)
39+
demands: ImageOverride -equals $(LINUXVMIMAGE)
3840

3941
extends:
4042
template: eng/pipelines/templates/stages/archetype-autorest-preview.yml@azure-sdk-tools

eng/pipelines/sdk_regenerate.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ schedules:
1212

1313
pr: none
1414

15-
pool:
16-
name: "azsdk-pool-mms-ubuntu-2004-general"
17-
vmImage: "MMSUbuntu20.04"
18-
1915
variables:
20-
- group: Release Secrets for GitHub
16+
- template: /eng/pipelines/templates/variables/image.yml
17+
- name: group
18+
value: Release Secrets for GitHub
2119

20+
pool:
21+
name: $(LINUXPOOL)
22+
demands: ImageOverride -equals $(LINUXVMIMAGE)
2223

2324
resources:
2425
repositories:

eng/pipelines/templates/stages/1es-redirect.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ extends:
2323
skipBuildTagsForGitHubPullRequests: true
2424
sdl:
2525
sourceAnalysisPool:
26-
name: azsdk-pool-mms-win-2022-general
27-
image: azsdk-pool-mms-win-2022-1espt
26+
name: azsdk-pool
27+
image: windows-2022
2828
os: windows
2929
psscriptanalyzer:
3030
compiled: true

eng/pipelines/templates/variables/image.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
variables:
44
- name: LINUXPOOL
5-
value: azsdk-pool-mms-ubuntu-2004-general
5+
value: azsdk-pool
66
- name: WINDOWSPOOL
7-
value: azsdk-pool-mms-win-2022-general
7+
value: azsdk-pool
88
- name: MACPOOL
99
value: Azure Pipelines
1010

1111
- name: LINUXVMIMAGE
12-
value: azsdk-pool-mms-ubuntu-2004-1espt
12+
value: ubuntu-24.04
1313
- name: LINUXNEXTVMIMAGE
14-
value: ubuntu-22.04
14+
value: ubuntu-24.04
1515
- name: WINDOWSVMIMAGE
16-
value: azsdk-pool-mms-win-2022-1espt
16+
value: windows-2022
1717
- name: MACVMIMAGE
1818
value: macos-11
1919

packages/autorest.python/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release
22

3+
## 6.35.5
4+
5+
No changes, version bump only.
6+
37
## 6.35.4
48

59
### Bump dependencies

packages/autorest.python/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@autorest/python",
3-
"version": "6.35.4",
3+
"version": "6.35.5",
44
"description": "The Python extension for generators in AutoRest.",
55
"scripts": {
66
"start": "node ./scripts/run-python3.js ./scripts/start.py",

packages/typespec-python/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Release
22

3+
## 0.45.5
4+
5+
### Features
6+
7+
- [#3116](https://github.com/Azure/autorest.python/pull/3116) [typespec-python] Add support for uv package manager alongside pip
8+
9+
310
## 0.45.4
411

512
### Bump dependencies

packages/typespec-python/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure-tools/typespec-python",
3-
"version": "0.45.4",
3+
"version": "0.45.5",
44
"author": "Microsoft Corporation",
55
"description": "TypeSpec emitter for Python SDKs",
66
"homepage": "https://github.com/Azure/autorest.python",

packages/typespec-python/scripts/install.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,35 @@
1111
raise Exception("Autorest for Python extension requires Python 3.9 at least")
1212

1313
try:
14-
import pip
15-
except ImportError:
16-
raise Exception("Your Python installation doesn't have pip available")
14+
from package_manager import detect_package_manager, PackageManagerNotFoundError
15+
16+
detect_package_manager() # Just check if we have a package manager
17+
except (ImportError, ModuleNotFoundError, PackageManagerNotFoundError):
18+
raise Exception("Your Python installation doesn't have a suitable package manager (pip or uv) available")
1719

1820
try:
1921
import venv
2022
except ImportError:
2123
raise Exception("Your Python installation doesn't have venv available")
2224

2325

24-
# Now we have pip and Py >= 3.9, go to work
26+
# Now we have a package manager (uv or pip) and Py >= 3.9, go to work
2527

2628
from pathlib import Path
2729

28-
from venvtools import ExtendedEnvBuilder, python_run
29-
3030
_ROOT_DIR = Path(__file__).parent.parent
3131

3232

3333
def main():
3434
venv_path = _ROOT_DIR / "venv"
35-
if venv_path.exists():
36-
env_builder = venv.EnvBuilder(with_pip=True)
37-
venv_context = env_builder.ensure_directories(venv_path)
38-
else:
39-
env_builder = ExtendedEnvBuilder(with_pip=True, upgrade_deps=True)
40-
env_builder.create(venv_path)
41-
venv_context = env_builder.context
42-
43-
python_run(venv_context, "pip", ["install", "-U", "pip"])
44-
python_run(venv_context, "pip", ["install", "-U", "black"])
35+
36+
# Create virtual environment using package manager abstraction
37+
from package_manager import create_venv_with_package_manager, install_packages
38+
39+
venv_context = create_venv_with_package_manager(venv_path)
40+
41+
# Install required packages - install_packages handles package manager logic
42+
install_packages(["-U", "black"], venv_context)
4543

4644

4745
if __name__ == "__main__":

0 commit comments

Comments
 (0)