💥 Update metavar printing - #1863
Merged
Merged
Conversation
Contributor
svlandeg
commented
Jul 14, 2026
svlandeg
marked this pull request as ready for review
July 14, 2026 18:46
tiangolo
approved these changes
Jul 15, 2026
tiangolo
left a comment
Member
There was a problem hiding this comment.
Everything looks good! 🙌
This must have been painful to make, going through all the docs. 😅
Thank you!
Member
Author
Quite 😅 Had to do several sections multiple times, too, after making fixes and going back to make sure everything was consistent 🙈 |
11 tasks
This was referenced Jul 28, 2026
llewelld
added a commit
to alan-turing-institute/data-safe-haven
that referenced
this pull request
Jul 28, 2026
In release 0.27.0 Typer introduced breaking changes in the way metavars are output: https://github.com/fastapi/typer/releases In particular, objects are now surrounded by {braces} in usage strings. See the following PR: fastapi/typer#1863 This broke one of our tests, which expected to see the string "Usage: run [OPTIONS] SRE_NAME COMMAND" in stdout but in fact received the string "Usage: run [OPTIONS] {sre_name} {command}". This change updates the test to expect the new string, which is correctly following the updated Typer rules.
llewelld
added a commit
to alan-turing-institute/data-safe-haven
that referenced
this pull request
Jul 28, 2026
In release 0.27.0 Typer introduced breaking changes in the way metavars are output: https://github.com/fastapi/typer/releases In particular, objects are now surrounded by {braces} in usage strings. See the following PR: fastapi/typer#1863 This broke one of our tests, which expected to see the string "Usage: run [OPTIONS] SRE_NAME COMMAND" in stdout but in fact received the string "Usage: run [OPTIONS] {sre_name} {command}". This change updates the test to expect the new string, which is correctly following the updated Typer rules.
llewelld
added a commit
to alan-turing-institute/data-safe-haven
that referenced
this pull request
Jul 28, 2026
Updates the Myst parser so that it aligns with the updated sphinx. Without this change the "colon_fence" plugin causes the documentation build to fail. Adjusts StorageAccountListKeysResult usage for AzureSdk 25.0.0. AzureSdk 25.0.0 (2026-05-19) introduced breaking changes to StorageAccountListKeysResult. This change adjusts the code to accommodate this. See the AzureSDK ChangeLog: https://github.com/Azure/azure-sdk-for-python/blob/42f59593caec801dabfe3d222ddb8561b46b5e72/sdk/storage/azure-mgmt-storage/CHANGELOG.md Updates tests to accommodate breaking changes in Typer. In release 0.27.0 Typer introduced breaking changes in the way metavars are output: https://github.com/fastapi/typer/releases In particular, objects are now surrounded by {braces} in usage strings. See the following PR: fastapi/typer#1863 This broke one of our tests, which expected to see the string "Usage: run [OPTIONS] SRE_NAME COMMAND" in stdout but in fact received the string "Usage: run [OPTIONS] {sre_name} {command}". This change updates the test to expect the new string, which is correctly following the updated Typer rules. Fixes a linter error. Switches from using single to double quotes to denote a specific string, in order to pass the linter checks.
d3rky
added a commit
to softwareone-platform/mpt-tool
that referenced
this pull request
Aug 4, 2026
…SDK (#95) 🤖 AI-generated PR — Please review carefully. ## Problem mpt-tool 6.0.3 cannot be installed alongside `mpt-extension-sdk` 6.6.x, so extension repos cannot pick up SDK 6.6.2. Resolution fails outright: > `mpt-extension-sdk==6.6.1 depends on typer==0.26.*` and `mpt-tool==6.0.3 depends on typer==0.27.*`, we can conclude that [they are] incompatible. The cap is not arbitrary: `mrok` (latest 0.10.5, a dependency of the SDK) requires `typer<0.27.0,>=0.26.0`, and the SDK keeps mrok/fastapi/typer pinned in lockstep for that reason (MPT-22658). The SDK cannot move to typer 0.27 until mrok lifts its cap — mpt-tool has no such constraint of its own, so it is the side that should hold. typer reached 0.27 here through an unreviewed Dependabot bump (commit `0e9b43e`, 2026-07-27), which touched only `pyproject.toml` and `uv.lock` — nothing in mpt-tool actually needed 0.27. ## What was done - `pyproject.toml`: `typer==0.27.*` → `==0.26.*`, with a comment recording why the cap exists. `mpt-api-client==6.4.*` is left untouched. - `uv.lock`: refreshed — typer 0.27.0 → 0.26.8. Nothing else moves. - `.github/dependabot.yml`: ignore `typer >=0.27` so the next scheduled run cannot silently reintroduce the conflict. This mirrors the guard the SDK already carries for the same reason. Reverting typer is behaviourally safe: the only breaking change in 0.27.0 is metavar rendering in `--help` output ([typer#1863](fastapi/typer#1863)) — types shown as `<str>` instead of `TEXT`, choices as `<a|b>` instead of `[a|b]` — and 0.27.1 only adjusts epilog formatting. No API or argument-parsing changes. mpt-tool declares its metavars explicitly in `mpt_tool/cli.py`, which both versions honour. ## Testing - `ruff format --check`, `ruff check`, `flake8`, `mypy`, `uv lock --check` all pass. - Full test suite passes (54 tests) — no test expectations needed changing in either direction. - End-to-end resolution check in a scratch project depending on this branch plus `mpt-extension-sdk[azure-monitor]==6.6.*` and `mpt-extension-contrib-custom-notifications[teams]==1.2.*` resolves cleanly to **SDK 6.6.2** with mpt-api-client 6.4.0 and typer 0.26.8, confirming no further hidden conflict. ## Follow-up This needs a release (6.0.4) to reach PyPI before extensions can move to SDK 6.6.2; the currently published 6.0.3 stays unusable with 6.6.x. Once mrok lifts its `typer<0.27` cap, the ignore rule here and in the SDK can both be dropped and the two can move up together. Jira: [MPT-23808](https://softwareone.atlassian.net/browse/MPT-23808) 🤖 Generated with [Claude Code](https://claude.com/claude-code) [MPT-23808]: https://softwareone.atlassian.net/browse/MPT-23808?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> - Update `mpt-tool` to use `typer 0.26.*`. - Update `uv.lock` to `typer 0.26.8`. - Prevent Dependabot from updating `typer` to version `0.27` or later. - Enable installation with `mpt-extension-sdk` 6.6.x. - Release version 6.0.4 to publish the fix. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.
Description
We've decided to change a bit the "metavar" printing functionality of Typer. In short, the new rules are:
<>for displaying the type (including enum choices etc)[]for displaying something optional in the usage string{}for referencing an object (i.e. not a literal string) in the usage string if neither of the other 2 applyBreaking changes
<>, so"<str>"instead of"TEXT"and"<int>"instead of"INTEGER"etc.<simple|conv|lstm>instead of[simple|conv|lstm]or{simple|conv|lstm>}. Check the new testtest_param_type_help_metavarfor an overview.test_parameter_name_casing.{}, unless they're already surrounded with the "optional" denoting brackets[].master, optional ones were enclosed with[]which felt inconsistent with optional options)Edits in custom.js
When updating the documentation to show e.g.
<str>instead ofTEXT, this would be treated as an HTML tag and not actually displayed in our tutorial pages 😭 Hence the fixes tocustom.js.Tangiantel fixes
Default: Nonein the help text, PR 1120. I updated those as part of the documentation update here. I could also do this in a separate PR if preferred, but it would cause a lot of merge conflicts and duplicate work as I've now been going through all the docs in detail anyway.How to review this PR
Please mostly look at the test/documentation changes, and not so much the actual code changes in the Python files.
The Python edits will become obsolete with the Pydantic refactor that is in the works. In fact, this PR is a "spinoff" of the Pydantic refactor (#1831, WIP) in an attempt to make that one more "reviewable". Only the docs & tests changes will be brought over from here - the code changes from this PR will be subsumed by PR 1831.
AI Disclaimer
Created through pair-programming with Cursor, manually reviewed in detail. Also went through all the Typer docs manually & in detail.
Checklist