Optimize Azure SDK CI pipeline with uv tool for faster package management #41974
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR optimizes the Azure SDK for Python CI pipeline by replacing traditional
pip
andpython -m venv
commands with the fasteruv
tool for package installation and virtual environment management. This change aims to significantly reduce CI pipeline setup time across all build jobs.Changes Made
1. Added uv installation to all CI jobs
Added global uv installation steps to all 6 CI jobs (
Build_Linux
,Build_Windows
,Build_MacOS
,Build_Extended
,Build_Documentation
, andAnalyze
) ineng/pipelines/templates/jobs/ci.yml
:2. Replaced pip commands with uv equivalents
Updated package installation commands across template files:
build-package-artifacts.yml: Replaced 3 pip commands
build-extended-artifacts.yml: Replaced 1 pip command
analyze.yml: Replaced 1 pip command
3. Updated virtual environment management
Replaced PowerShell script-based virtual environment creation in
use-venv.yml
with nativeuv venv
commands while preserving all existing parameters (VirtualEnvironmentName
,Activate
,Condition
):Benefits
uv
is significantly faster thanpip
for package installation and resolutionTesting
python -m pip
references in modified template filesFiles Modified
eng/pipelines/templates/jobs/ci.yml
- Added uv installation to 6 jobseng/pipelines/templates/steps/build-package-artifacts.yml
- Replaced 3 pip commandseng/pipelines/templates/steps/build-extended-artifacts.yml
- Replaced 1 pip commandeng/pipelines/templates/steps/analyze.yml
- Replaced 1 pip commandeng/pipelines/templates/steps/use-venv.yml
- Updated virtual environment managementThis optimization will reduce CI pipeline execution time while maintaining full backward compatibility with existing workflows.
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.