Skip to content

fix(cli): drop deprecated get_text_stream - #82

Merged
danthompson merged 1 commit into
mainfrom
fix/click-text-stream-deprecation
Nov 23, 2026
Merged

danthompson merged 1 commit into
mainfrom
fix/click-text-stream-deprecation

Conversation

@danthompson

Copy link
Copy Markdown
Member

click 8.5.0 deprecates get_text_stream and serves it through a module-level __getattr__ typed as object, so ty check fails on the color detection in _emit_report (the lint failure on #63). This reads sys.stdout.isatty() directly.

  • Color detection behaves the same on click 8.4.2 and 8.5.0, and no longer emits a DeprecationWarning on 8.5.0 or breaks when click 9.0 removes the function.
  • New tests cover when color turns on, using a real pseudo-terminal: on for a TTY, off for a non-TTY, off when NO_COLOR is set.

Once this merges, @dependabot rebase on #63 should pass lint.

Refs #63

click 8.5.0 deprecates get_text_stream and serves it through a module
__getattr__ typed as object, so ty rejects the call. Color detection
now reads sys.stdout directly; new tests drive it with a real pty.
@danthompson
danthompson merged commit 2d875f1 into main Nov 23, 2026
5 checks passed
@danthompson
danthompson deleted the fix/click-text-stream-deprecation branch November 23, 2026 19:16
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