Fix CLI import crash on Typer 0.27, release 0.4.1 - #34
Merged
Merged
Conversation
A fresh install of discolike-cli 0.4.0 fails on every command with ImportError: cannot import name 'Abort' from 'typer._click.exceptions'. Typer 0.27 moved Abort to typer.exceptions. CI never saw it because it tests against uv.lock, which pins Typer 0.26.8, while the published constraint (typer>=0.12) let users resolve 0.27.2. Import the public typer.Abort instead. The remaining imports still reach into Typer's vendored Click (typer._click), which only exists from 0.26 and is private, so bound the dependency to >=0.26,<0.28 rather than let the next minor break installs the same way.
Every CI job installed exactly what uv.lock pins, so the Typer 0.27 break that shipped in 0.4.0 was invisible: users resolve fresh from the pyproject ranges. The new test-resolution job runs the suite and a wheel install at both ends of those ranges. Running it locally found two more problems. Typer 0.26.0 drops the env-var API key in auth status, so the floor is 0.26.1. Two entrypoint tests pinned Typer's exact error wording, which 0.27 changed; they now check the flag or argument name the envelope must carry.
discolike[cli]==0.4.1 required discolike-cli==0.4.0, which requires discolike==0.4.0, so the extra could not be installed.
Contributor
Author
|
@greptileai review |
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.
discolike-cli 0.4.0 on PyPI crashes on every command in a fresh install: Typer 0.27 moved
Abortout oftyper._click.exceptions. CI tests only the lockfile (Typer 0.26.8), so it passed.typer.Abort; boundtyper>=0.26.1,<0.28(other imports still use privatetyper._click, absent before 0.26; 0.26.0 drops the env-var key inauth status).test-resolutionCI job: suite + built-wheel smoke athighest(3.14) andlowest-direct(3.10) resolution, so pyproject ranges are tested, not just uv.lock.The PR appears safe to merge; both previous findings are fixed or resolved, and no actionable new defect remains.
Fix with agent prompt
Summary
This PR fixes the CLI import failure under Typer 0.27 and prepares the coordinated 0.4.1 release.
Abortthrough Typer’s public API and narrows the supported Typer range to>=0.26.1,<0.28.discolike[cli]extra is fixed by updating it todiscolike-cli==0.4.1; the earlier Typer 0.27 coverage thread is resolved.Reviews (2) · Last reviewed commit: "Pin the cli extra to the matching 0.4.1 ..."