Skip to content

Fix CLI import crash on Typer 0.27, release 0.4.1 - #34

Merged
yudelevi merged 3 commits into
developmentfrom
fix/typer-0.27-abort
Sep 24, 2026
Merged

yudelevi merged 3 commits into
developmentfrom
fix/typer-0.27-abort

Conversation

@yudelevi

@yudelevi yudelevi commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

discolike-cli 0.4.0 on PyPI crashes on every command in a fresh install: Typer 0.27 moved Abort out of typer._click.exceptions. CI tests only the lockfile (Typer 0.26.8), so it passed.

  • Import the public typer.Abort; bound typer>=0.26.1,<0.28 (other imports still use private typer._click, absent before 0.26; 0.26.0 drops the env-var key in auth status).
  • New test-resolution CI job: suite + built-wheel smoke at highest (3.14) and lowest-direct (3.10) resolution, so pyproject ranges are tested, not just uv.lock.
  • Entrypoint tests no longer pin Typer's error wording.
  • Bump to 0.4.1.

RetriggerConfidence Score: 5/5

The PR appears safe to merge; both previous findings are fixed or resolved, and no actionable new defect remains.

Fix All in Claude CodeFindings

  1. P1 CLI extra becomes unsatisfiable ▶
Fix with agent prompt
### Issue 1
packages/discolike/src/discolike/_version.py:undefined-1
Bumping the SDK to 0.4.1 without updating its `cli` extra leaves `discolike[cli]==0.4.1` requiring `discolike-cli==0.4.0`. That CLI release requires `discolike==0.4.0`, so pip receives conflicting exact SDK requirements and cannot install the extra. Update the optional dependency to the matching CLI release.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR fixes the CLI import failure under Typer 0.27 and prepares the coordinated 0.4.1 release.

  • Imports Abort through Typer’s public API and narrows the supported Typer range to >=0.26.1,<0.28.
  • Adds source-suite and built-wheel checks at the highest and lowest direct dependency resolutions.
  • Updates parser-error tests to tolerate supported Typer wording differences.
  • Aligns the SDK, CLI, optional extra, lockfile, tests, and changelog at version 0.4.1.
  • The previously reported unsatisfiable discolike[cli] extra is fixed by updating it to discolike-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 ..."

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.
Comment thread packages/discolike/src/discolike/_version.py
Comment thread packages/discolike-cli/pyproject.toml Outdated
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.
@yudelevi

Copy link
Copy Markdown
Contributor Author

@greptileai review

@yudelevi
yudelevi merged commit 546d02d into development Sep 24, 2026
10 checks passed
@yudelevi
yudelevi deleted the fix/typer-0.27-abort branch September 24, 2026 00:44
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.

1 participant