Quantum: -o output breaks when newer extension version exists + test updates#9046
Quantum: -o output breaks when newer extension version exists + test updates#9046kairu-ms merged 5 commits intoAzure:mainfrom
Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Azure Quantum CLI extension to version 1.0.0b8, addressing an issue where the version advertisement message was interfering with formatted output when using the -o flag. The fix ensures version checks only display when formatted output options are not specified.
- Version bump from 1.0.0b7 to 1.0.0b8 with corresponding CLI reported version update
- Fix for output formatting interference by conditional version check logic
- Test configuration updates for workspace location and provider SKU
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Version bump to 1.0.0b8 |
| init.py | CLI reported version update and conditional version check fix |
| utils.py | Test workspace location change from westus2 to westus |
| test_quantum_jobs.py | Provider SKU update for test configuration |
| HISTORY.rst | Release notes for version 1.0.0b8 |
|
|
||
| # Only when formatted output (https://learn.microsoft.com/en-us/cli/azure/format-output-azure-cli?view=azure-cli-latest&tabs=bash) is NOT requested, | ||
| # we can produce the "new version is available" tip as it may interfere with the output format (ex. JSON). | ||
| if "--output" not in args and "--out" not in args and "-o" not in args: |
There was a problem hiding this comment.
The string-based argument checking is fragile and may not correctly handle all cases. For example, it would incorrectly match arguments like --output-file or commands where -o appears in a parameter value. Consider using the CLI's built-in argument parsing or a more robust method to detect output format options.
| if "--output" not in args and "--out" not in args and "-o" not in args: | |
| parser = argparse.ArgumentParser(add_help=False) | |
| parser.add_argument('--output', dest='output', nargs='?', default=None) | |
| parser.add_argument('--out', dest='output', nargs='?', default=None) | |
| parser.add_argument('-o', dest='output', nargs='?', default=None) | |
| # parse_known_args returns a tuple (Namespace, list of unknown args) | |
| parsed_args, _ = parser.parse_known_args(args) | |
| if parsed_args.output is None: |
There was a problem hiding this comment.
The args is not a string but an array so matching with in should match an entry exactly
|
|
Please fix CI issues |
|
[Release] Update index.json for extension [ quantum-1.0.0b8 ] : https://dev.azure.com/msazure/One/_build/results?buildId=133388087&view=results |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az quantumGeneral Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.