fix ModuleNotFoundError for click on fresh installs - #222
Open
cartertemm wants to merge 1 commit into
Open
Conversation
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.
Thanks for your work on this library, it has already saved me quite a bit of money!
pipx install flightsanduv tool install flightsare all broken on a fresh install right now. Any environment that resolves dependencies from scratch today gets typer 0.26 or newer, and the CLI dies on import:Cause
fli/cli/utils.pydoesfrom click import Context, Parameter, butclickwas never declared as a dependency. It worked by accident, because typer pulled in click.As of typer 0.26.0, this is no longer the case. Typer now vendors click as
typer._click. Its only declared dependencies areshellingham,rich,annotated-doc, andcolorama.Fix
Instead of adding
clickas a dependency, I switched to typer's public re-exports,typer.Contextandtyper.CallbackParam. Newer versions of typer use these, and they are backward compatible.I also declared two packages in
pyproject.tomlthat are imported directly but only installed because they are required by third-party modules, to prevent this from happening in another release:rich>=13.8.0in the main dependencies (imported infli/cli/, currently imported by typer)mcp>=1.2.0in themcpextra (imported infli/mcp/, currently imported by fastmcp)Verification
Reproduced the failure on
mainwith a plainpip install .into a clean venv, then confirmed the following against the patched tree:pip install .into a fresh venv,fli --helpworksuv tool install .,fli --helpworks, all four subcommands listeduv tool install ".[mcp]",import fli.mcp.serversucceeds--currencyand a bad date each produce the right error)uv run ruff check .passestests/cliandtests/mcp: 236 passedNot all the tests pass, but that looks to be mostly Google's fault, plus a windows encoding issue. The same number of tests pass here as on
main.Greptile Summary
Updates dependency declarations to keep fresh installations importable.
Confidence Score: 5/5
The PR appears safe to merge, with the import fix and dependency metadata aligned across the source and package configuration.
The changed callback annotations preserve Typer callback behavior while eliminating the undeclared Click import, and the newly explicit dependencies are reflected consistently in the project manifest and lockfile.
Important Files Changed
Reviews (1): Last reviewed commit: "fix ModuleNotFoundError for click on fre..." | Re-trigger Greptile
Context used:
fli/cli/)fli/mcp)