Skip to content

fix: cap click below 8.2 to restore CLI compatibility with typer 0.12 - #370

Open
aculich wants to merge 1 commit into
Undertone0809:mainfrom
aculich:fix/click-8.2-incompatibility
Open

aculich wants to merge 1 commit into
Undertone0809:mainfrom
aculich:fix/click-8.2-incompatibility

Conversation

@aculich

@aculich aculich commented Jun 12, 2026

Copy link
Copy Markdown

Summary

  • Fresh installs of gcop are currently broken: every command crashes at startup with TypeError: Secondary flag is not valid for non-boolean flag.
  • Root cause: pyproject.toml pins typer = "^0.12.3" but allows click = "^8.1.7". Click 8.2 changed flag option validation and rejects the secondary flag form that typer < 0.16 generates for boolean options, so any fresh resolution (which picks click 8.2+, currently 8.4.x) produces an unusable CLI. Existing environments with an older click are unaffected, which is why this only surfaces on new installs or venv rebuilds.
  • Fix: cap click at >=8.1.7,<8.2. The locked version (8.1.7) already satisfies the constraint, so poetry.lock only changes its content-hash (regenerated with Poetry 1.8.3 to preserve the existing lock format).

A longer-term alternative is upgrading typer to >= 0.16, which supports the new click behavior — happy to rework the PR that way if preferred.

Test plan

  • Reproduced the crash with click 8.4.1 + typer 0.12.5 (gcop --help raises the TypeError)
  • Verified gcop --help and gcop commit work with click 8.1.8 + typer 0.12.5
  • poetry lock --no-update (Poetry 1.8.3) succeeds with the new constraint; no package version changes

Closes #369

click 8.2 changed flag option validation and rejects the secondary flag
form that typer < 0.16 generates for boolean options. Since pyproject
allowed click ^8.1.7, any fresh dependency resolution picks up click
8.2+ and every gcop command crashes at startup while typer builds the
CLI:

    TypeError: Secondary flag is not valid for non-boolean flag.

Cap click at <8.2 until the typer dependency is upgraded to >= 0.16.
The locked click version (8.1.7) already satisfies the new constraint,
so only the lock content-hash changes.

Fixes Undertone0809#369
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.

TypeError: Secondary flag is not valid for non-boolean flag (typer 0.12 incompatible with click >= 8.2)

1 participant