Skip to content

CM-78466: Upgrade click to 8.3.3 and typer to 0.25.1 - #595

Merged
omer-roth merged 1 commit into
mainfrom
CM-78466-upgrade-click
Nov 18, 2026
Merged

omer-roth merged 1 commit into
mainfrom
CM-78466-upgrade-click

Conversation

@omer-roth

Copy link
Copy Markdown
Collaborator

Why

click was pinned to >=8.1.0,<8.2.0, which resolves to 8.1.8. That version is affected by CVE-2026-7246, and installs fail in environments that require click>=8.3.3, for example pre-commit hook setups behind a package proxy that enforces the CVE floor. typer 0.15 caps click below 8.2, so typer has to move too.

What changed

Before After Locked
click >=8.1.0,<8.2.0 >=8.3.3,<8.4.0 8.1.8 → 8.3.3
typer ^0.15.3 >=0.25.1,<0.26.0 0.15.4 → 0.25.1

typer 0.25 also pulls in a new transitive dependency, annotated-doc.

Why these caps

  • click 8.3.3 is the first version with the CVE fix: the pager and editor commands are split with shlex instead of running with shell=True.

  • click <8.4: with typer 0.25, click 8.4+ prints the typo hint twice ("Did you mean 'scan'? Did you mean 'scan'?"). typer's own maintainers pinned <8.4 for this pairing.

  • typer <0.26: typer 0.26+ vendors its own copy of Click. When tested against typer 0.29:

    • our click.ClickException errors show up as raw tracebacks;
    • the raw-click platform group crashes;
    • root option introspection drifts.

    Moving to typer 0.26+ is a separate migration (follow-up ticket).

New tests: tests/cli/test_click_typer_compat.py covers the Typer/Click seam:

  • ClickException renders as an error box;
  • the platform group mounts and its commands run;
  • a misspelled command gets exactly one suggestion;
  • running a group with no args prints help with usage and exits 2.

These tests fail on typer 0.29 and on click 8.5 with typer 0.25, so a future bump that breaks these paths fails CI.

User-visible behavior changes (click 8.2+)

  • Running cycode or a command group like cycode scan with no arguments still shows help, but exits 2 instead of 0.
  • Misspelled commands get a suggestion: cycode scna → "Did you mean 'scan'?"
  • Help no longer prints [default: None] for options without a default.
  • "No such option" errors read No such option '--bogus'. Did you mean '--verbose'?

Where to start reading

pyproject.toml (two lines), then tests/cli/test_click_typer_compat.py. The lock diff is mechanical.

Verification

  • Full suite passes: 1516 passed, 1 skipped. Ruff is clean.
  • Ran the real CLI by hand: --help, version, error paths, an unknown option, a misspelled command, platform --help and --show-completion zsh.
  • Built the PyInstaller binary from pyinstaller.spec. It runs version and renders errors and suggestions correctly.

🤖 Generated with Claude Code

click was pinned to <8.2 (resolving to 8.1.8), which is affected by
CVE-2026-7246 and blocks installs in environments that require
click >= 8.3.3. typer 0.15 caps click below 8.2, so it moves too.

- click >=8.3.3,<8.4: 8.3.3 carries the CVE fix. 8.4+ duplicates the
  "Did you mean" hint with typer 0.25, which pinned click <8.4 for it.
- typer >=0.25.1,<0.26: 0.26+ vendors its own Click, so it no longer
  renders click.ClickException and cannot mount the raw click `platform`
  group. Moving there is a separate migration.

Behavior changes from click 8.2+: a group run with no args shows help
and exits 2 instead of 0; misspelled commands get a suggestion; help no
longer prints "[default: None]".

Add tests for the Typer/Click seam so a future bump that breaks error
rendering, the platform group or the typo hint fails CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omer-roth
omer-roth merged commit 4d33488 into main Nov 18, 2026
25 checks passed
@omer-roth
omer-roth deleted the CM-78466-upgrade-click branch November 18, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants