Repository navigation
Description
Problem or Motivation
pyproject.toml pins typer; the baseline (#5065) moves it to 0.28.0. The newest is 0.29.1. Renovate (#4893) will offer it, and it needs work:
- 0.29.0: "Typer now uses Pydantic internally to validate command-line parameters".
click_typeis removed. Callback parameter objects no longer expose Click's.type,.make_metavar(),.human_readable_nameand.type_cast_value(). Help and usage output changed. - Code that reads
param.type:src/devops_cli/docs/generator.py:296,src/devops_cli/ai/mcp/generator.py:234-236,274-281,342,src/devops_cli/roadmap/stage/stage_run_allowlist.py:29-30,151(it importstyper._click.types.Fileandtyper.models.TyperPath, both gone; mypy gives import-not-found and attr-defined). - 172 test IDs fail on 0.29.1 ("'TyperOption' object has no attribute 'type'", and ImportError on
typer._click.types): MCP tool generation, the docs generator, and every CLI test that builds the MCP or docs tree.
Research of 2026-11-12 (research-python, migration typer).
Proposed Solution & Architectural Design
- Read the parameter types through the public Typer 0.29 API (or the Click command that Typer builds) in the docs generator, the MCP generator and the stage allowlist.
- Generate the command reference again (
devops docs) for the changed help and usage output. - Pin
typer0.29.1 and run the full test suite.
Done when the 172 tests pass on 0.29.1 and the generated documents are current.
Target Subsystem
FastMCP & IDE Integrations
Existing Tool Considered
Typer and Click public APIs. No new code beyond the generator fixes.
Source: #4893
Alternatives check of 2026-11-22: none.
Tool: none found.
Reason: Searches found no tool or shim that restores Typer 0.28 parameter attributes or rewrites the generators; Typer and Click are the dependency and its API, so the migration stays project work.
Lacks:
- No shim restoring removed Typer 0.28 callback parameter attributes
- No automated rewrite of docs, MCP generator and stage allowlist
- No tool regenerates the command reference or runs the suite
Proposed design
Problem statement
Typer 0.29.1 validates command-line parameters with Pydantic. It removes click_type, the Click attributes on callback parameter objects, and the private Typer imports that the docs generator, the MCP generator and the stage allowlist use. The project must migrate those readers to public Typer or Click APIs, regenerate the command reference and pin typer 0.29.1. The change is done when the 172 failing tests pass and the generated documents are current.
Acceptance criteria
Requirement: MCP parameter introspection
The MCP tool generator SHALL read command parameter types through the public Typer or Click API on Typer 0.29.1.
Scenario: MCP generation on Typer 0.29.1
- WHEN
uv run pytest tests/ai/mcpruns under typer 0.29.1 - THEN the command exits 0 and no test raises AttributeError for 'TyperOption' object has no attribute 'type'.
Requirement: Docs parameter introspection
The docs generator SHALL derive command parameter types from the public Typer or Click API on Typer 0.29.1.
Scenario: Docs generator tests on Typer 0.29.1
- WHEN
uv run pytest tests/test_docs.pyruns under typer 0.29.1 - THEN the command exits 0 and the generator produces the command reference with no removed Click attribute access.
Requirement: Stage allowlist public imports
The stage allowlist SHALL use public Click and Typer types and SHALL NOT import removed private Typer modules.
Scenario: Stage allowlist type check
- WHEN
uv run mypy src/devops_cli/roadmap/stage/stage_run_allowlist.pyruns under typer 0.29.1 - THEN the command exits 0 with no import-not-found or attr-defined error.
Requirement: Typer pin
The project SHALL pin typer to 0.29.1 and keep the lockfile consistent.
Scenario: Installed Typer version
- WHEN
uv run python -c "import importlib.metadata; assert importlib.metadata.version('typer') == '0.29.1'"runs after the pin change - THEN the command exits 0 and the installed Typer version is 0.29.1.
Requirement: Generated command reference
The generated command reference SHALL match the help and usage output of Typer 0.29.1.
Scenario: Generated docs check
- WHEN
uv run devops ci --check --only docsruns afterdevops docsregenerates the reference - THEN the command exits 0 and reports no generated document drift.
Requirement: Full test suite
The full test suite SHALL pass under typer 0.29.1.
Scenario: Full suite on Typer 0.29.1
- WHEN
uv run pytestruns under typer 0.29.1 - THEN the command exits 0 and the 172 failing test IDs from the migration no longer fail.
Existing Tool Considered
No open, maintained tool or library covers this migration. The alternatives check of 2026-11-15 found none: no shim restores the removed Typer 0.28 parameter attributes, and no library performs the generator fixes. Typer is the dependency to bump, and Click's public Parameter API is the route to the parameter types. The project builds no replacement tool, so no tool-match cost applies. The bounded cost is the three generator fixes, one document regeneration and one full test run.
Key questions
- Which API replaces the removed Click attributes on Typer 0.29 callback parameter objects?: Read the Click command that Typer builds. Use the public
click.Parameterattributes onclick.Command.params, such astype,opts,secondary_opts,is_flag,multipleandnargs. Do not read the Typer callback parameter objects. (best practice) [sources: src/devops_cli/ai/mcp/generator.py]- Chosen: Click command public API. Typer 0.29 still builds Click commands. The existing
resolve_click_commandalready returns the Click command. Public Click attributes keep the parameter data. - Rejected: Typer Pydantic model internals. The model is private and undocumented. It can change without notice.
- Rejected: Pin Typer 0.28. The item asks for 0.29.1. The baseline already uses 0.28.0.
- Chosen: Click command public API. Typer 0.29 still builds Click commands. The existing
- How does the stage allowlist identify file and path parameters after Typer removes
typer._click.types.Fileandtyper.models.TyperPath?: Use the public Click parameter type on the resolved Click command, such asclick.Fileorclick.Path, and usepathlib.Pathfor path values. Remove the private Typer imports. (best practice) [sources: src/devops_cli/roadmap/stage/stage_run_allowlist.py:29]- Chosen: Public Click types.
click.Fileandclick.Pathare public and stable. The resolved Click command exposes them. - Rejected: Private Typer modules. Typer 0.29 removes the modules. The import fails and mypy reports import-not-found.
- Rejected: String match on type name. A name match is brittle and misses subclasses.
- Chosen: Public Click types.
- Which source files need the parameter API migration?: The docs generator, the MCP generator and the stage allowlist need the migration. The MCP generator reads
param.typein_deduce_parameter_type,_build_parameter_fieldand_append_option_tokens. The docs generator readsparam.typeat line 296. The stage allowlist imports the removed private types at lines 29-30 and uses them at line 151. [sources: src/devops_cli/docs/generator.py:296, src/devops_cli/ai/mcp/generator.py, src/devops_cli/roadmap/stage/stage_run_allowlist.py:29] - Should the project pin typer exactly or allow a range?: Pin
typerto exactly 0.29.1. The project pins exact versions inpyproject.toml, and Renovate manages the update. (best practice) [sources: pyproject.toml]- Chosen: Exact pin 0.29.1. The project uses exact pins for dependencies. Renovate opens the next update.
- Rejected: Range
>=0.29,<0.30. A range hides a new release from review and differs from the project convention.
- Should the generated command reference be regenerated in this change?: Yes. Run
devops docsand commit the regenerated command reference. The help and usage output changed on Typer 0.29.1. (best practice) [sources: docs/CLI_REFERENCE.md, src/devops_cli/docs/generator.py]- Chosen: Regenerate the reference. The generated document must match its generator output. The docs check refuses drift.
- Rejected: Leave the reference stale. The docs check fails and the reference shows old help and usage.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Both are build(deps) upgrades, but #2603 adds types-docker while this candidate upgrades Typer to 0.29.1 and fixes its API changes.build(deps): take every safe version update before Renovate (#5102)
devops-cli-service commentedon Nov 15, 2026
Alternatives check: none
Reason: The searches surfaced no library that performs the Typer 0.29 parameter-API migration or that restores the removed
click_type/TyperOption.typesurface; the only relevant packages are Typer itself (the dependency to bump) and Click, whose public API the issue already names as the route to the parameter types. So the generator fixes, the failing tests and the document regeneration stay project work rather than being covered by a separate tool.Tool: none found
Lacks:
click_type,.type,.make_metavar(),.human_readable_name,.type_cast_value()) working on 0.29Tools considered:
Searches run:
Sources:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at c58b592 (see proposed design in issue body).
dan-petty commentedon Nov 26, 2026
Closed: the move is done.
pyproject.tomlpinstyper==0.29.3(#6833, #7287), andsrc/no longer imports the names that 0.29 removed.