Skip to content

fix: pin typer>=0.24.0 and click>=8.2.1 to fix import crash#2136

Merged
mnriem merged 1 commit intogithub:mainfrom
mnriem:fix/pin-typer-click-versions
Apr 8, 2026
Merged

fix: pin typer>=0.24.0 and click>=8.2.1 to fix import crash#2136
mnriem merged 1 commit intogithub:mainfrom
mnriem:fix/pin-typer-click-versions

Conversation

@mnriem
Copy link
Copy Markdown
Collaborator

@mnriem mnriem commented Apr 8, 2026

Summary

Fixes #2134

Pin typer>=0.24.0 and click>=8.2.1 in pyproject.toml to prevent an import-time crash.

Problem

typer versions prior to 0.24.0 under-constrain their click dependency (click>=8.0.0), allowing dependency resolvers to pick click <8.2. Those older click versions lack __class_getitem__ on click.Choice, causing:

TypeError: type 'Choice' is not subscriptable

at import time on any Python version (3.11, 3.12, 3.13).

Fix

  • Pin typer>=0.24.0 — this version correctly requires click>=8.2.1
  • Pin click>=8.2.1 — this version supports the generic subscript syntax typer uses

Both packages still support Python >=3.10, so our requires-python = ">=3.11" is unaffected.

Testing

All 1195 existing tests pass.

typer <0.24.0 under-constrains its click dependency (click>=8.0.0),
allowing resolvers to pick click <8.2 which lacks __class_getitem__
on click.Choice. This causes 'TypeError: type Choice is not
subscriptable' at import time on any Python version.

Pin typer>=0.24.0 (which correctly requires click>=8.2.1) and
click>=8.2.1 to prevent incompatible combinations.

Fixes github#2134
Copilot AI review requested due to automatic review settings April 8, 2026 22:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pins CLI framework dependencies to avoid an import-time crash caused by older click versions being selected by dependency resolvers (fixes #2134).

Changes:

  • Require typer>=0.24.0 to ensure proper downstream click constraints.
  • Require click>=8.2.1 to prevent TypeError: type 'Choice' is not subscriptable at import time.
Show a summary per file
File Description
pyproject.toml Tightens runtime dependency minimums for typer and click to prevent resolver-selected incompatible click versions.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@mnriem mnriem merged commit 1c41aac into github:main Apr 8, 2026
12 checks passed
@mnriem mnriem deleted the fix/pin-typer-click-versions branch April 8, 2026 22:49
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.

[Bug]: Broken install from homebrew or uv

2 participants