Conversation
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
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.
Summary
TypeError: Secondary flag is not valid for non-boolean flag.pyproject.tomlpinstyper = "^0.12.3"but allowsclick = "^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.>=8.1.7,<8.2. The locked version (8.1.7) already satisfies the constraint, sopoetry.lockonly 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
gcop --helpraises the TypeError)gcop --helpandgcop commitwork with click 8.1.8 + typer 0.12.5poetry lock --no-update(Poetry 1.8.3) succeeds with the new constraint; no package version changesCloses #369