Repository navigation
{Core} Read latest CLI versions from pyproject.toml in AME storage - #34360
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the version-lookup update.
No open issues 🎉
What changed in this PR
Updates Azure CLI’s latest-version lookup to support package metadata in pyproject.toml, while preserving compatibility with AME storage that still contains only setup.py.
Changes:
- Fetches
pyproject.tomlfirst and falls back tosetup.pyif fetching fails or no version is found. - Replaces line-by-line parsing with a regex over the response text.
- Adds unit tests for successful lookup, fallback behavior, and request failures.
| File | Description |
|---|---|
src/azure-cli-core/azure/cli/core/util.py |
Adds pyproject.toml version lookup with legacy fallback and updates storage documentation. |
src/azure-cli-core/azure/cli/core/tests/test_util.py |
Adds four unit tests covering version lookup and fallback behavior. |
Review effort: Balanced
Contributor
|
Hi Ethan Yang (@necusjz), |
Ethan Yang (necusjz)
marked this pull request as ready for review
November 5, 2026 02:22
Collaborator
|
Core |
Naga Nandyala (naga-nandyala)
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🤖 PR Validation —⚠️ Review suggested
This PR adds warning or check suppressions. Fix the underlying warning where possible and justify each remaining suppression in a code comment or the PR description.
1 added suppression
src/azure-cli-core/azure/cli/core/util.pyexcept Exception as ex: # pylint: disable=broad-exceptRelated command
Description
resolve: https://github.com/Azure/CLIPS/issues/987
get_latest_version_from_ame_storagefinds the latest released versions ofazure-cli,azure-cli-coreandazure-cli-telemetry. It does this by fetching{package}/setup.pyfrom the AME storage account and parsing theVERSION = "..."line. The packages have moved topyproject.toml, sosetup.pyno longer exists in the repo.Changes:
version = "..."from{AME_STORAGE_BASE_URL}/{package}/pyproject.tomlfirst.setup.py(VERSION = "...") whenpyproject.tomlcan't be fetched or has no version line. Onlysetup.pyis in storage today, so this keepsaz version/az upgradeworking until the release pipeline uploadspyproject.toml. The fallback can be removed after that.TestGetLatestVersionFromAmeStoragecovering:pyproject.tomlsetup.pyon a 404pyproject.tomlhas no version lineNonewhen both requests failTesting Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.