fix(deps): bump typer to >=0.20.0 so the CLI works with click >=8.3 (#650)#663
fix(deps): bump typer to >=0.20.0 so the CLI works with click >=8.3 (#650)#663Anai-Guo wants to merge 1 commit into
Conversation
typer 0.12.x generates an invalid secondary (--no-) flag for the list[bool] CLI options (trust_remote_code, model_warmup, compile, ...), which click >=8.2/8.3 rejects with "Secondary flag is not valid for non-boolean flag", crashing `infinity_emb v2` at startup (michaelfeil#650). The `^0.12.5` constraint pinned typer to the broken 0.12.x line. Recent typer (confirmed working: 0.20.0+, this lock resolves 0.23.2) emits click-8.3-compatible params, so the CLI imports and runs again. Closes michaelfeil#650
There was a problem hiding this comment.
Code Review
This pull request updates the typer dependency constraint in pyproject.toml from ^0.12.5 to >=0.20.0. Consequently, the poetry.lock file has been updated, upgrading typer to version 0.23.2 and adding the annotated-doc package as a dependency. No review comments were provided, so there is no additional feedback.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Greptile SummaryThis PR bumps the
Confidence Score: 4/5Safe to merge — the dependency bump directly fixes a known startup crash on click >= 8.2/8.3 with no changes to application logic. The change is a targeted fix for a well-understood compatibility breakage. The only concerns are the missing upper-bound on the typer version range and the unexpected python_version < 3.10 marker on click in the typer 0.23.2 lock entry. Neither issue affects correctness at merge time. No files require special attention beyond verifying that the production extras (server, all) continue to supply click independently of any dev-group transitive path on Python 3.10+. Important Files Changed
Reviews (1): Last reviewed commit: "fix(deps): bump typer to >=0.20.0 so the..." | Re-trigger Greptile |
| prometheus-fastapi-instrumentator = {version = ">=6.1.0", optional=true} | ||
| uvicorn = {version = "^0.32.0", optional=true, extras = ["standard"]} | ||
| typer = {version = "^0.12.5", optional=true} | ||
| typer = {version = ">=0.20.0", optional=true} |
There was a problem hiding this comment.
The new constraint has no upper bound. While removing the caret was necessary to escape the broken
0.12.x line, an uncapped >=0.20.0 means any future major version of typer (e.g., a hypothetical 1.0 with breaking API changes) will satisfy the constraint. A loose upper cap like <2 preserves flexibility for all 0.x releases while guarding against unvetted major-version upgrades.
| typer = {version = ">=0.20.0", optional=true} | |
| typer = {version = ">=0.20.0,<2", optional=true} |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| [package.dependencies] | ||
| click = ">=8.0.0" | ||
| rich = ">=10.11.0" | ||
| annotated-doc = ">=0.0.2" | ||
| click = {version = ">=8.0.0", markers = "python_version < \"3.10\""} | ||
| rich = ">=12.3.0" | ||
| shellingham = ">=1.3.0" | ||
| typing-extensions = ">=3.7.4.3" | ||
|
|
There was a problem hiding this comment.
Click declared Python-version-conditional by typer 0.23.2
The resolved typer 0.23.2 entry declares click only for python_version < "3.10". Typer is fundamentally built on click for all Python versions, so this marker looks like a metadata quirk in that specific release. In this lock file click 8.1.7 ends up as optional = false (pulled in via another path, likely jinja2-cli in the test group), so the runtime dependency chain stays intact today. However, if the non-optional click path is ever removed, users on Python 3.10+ would be missing click at import time and the CLI would crash. Worth verifying that the production extras (server, all) reliably pull in click independent of the test group.
Problem
Running the CLI (
infinity_emb v2 ...) crashes at startup whenclick >= 8.2/8.3is installed:(Reported in #650;
#649users hit it afterpip install infinity[all]pulls a recent click.)Root cause
Several CLI options in
libs/infinity_emb/infinity_emb/cli.pyare declared aslist[bool], e.g.:typer 0.12.x auto-generates a secondary
--no-<flag>for eachbool, but for a multiple (list[...]) option click 8.2+ now rejects a secondary flag, raising the error above. typer's click-param generation was fixed in later releases — as confirmed in #650, bumping typer makes the error disappear (typer0.12.5+ click8.3.0crashes; recent typer does not).Fix
The
^0.12.5constraint pinned typer to the broken0.12.xline. This bumps the lower bound to>=0.20.0(the version confirmed working in #650 by @wirthual);poetry lock --no-updateresolves typer0.23.2, which emits click-8.3-compatible params. Thepoetry.lockchange is minimal — only the typer entry, its new transitive depannotated-doc, and the content hash.poetry check --lockpasses.If you've verified an even lower typer release works, feel free to relax the bound — I used
>=0.20.0because that's the value explicitly confirmed in the thread.Closes #650
🤖 Generated with Claude Code