Skip to content

feat: support for click 8.5 - #350

Closed
happykust wants to merge 11 commits into
ewels:1.9.xfrom
happykust:feat/click-8.5-support
Closed

happykust wants to merge 11 commits into
ewels:1.9.xfrom
happykust:feat/click-8.5-support

Conversation

@happykust

@happykust happykust commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Added support for click 8.5:

  • get_binary_stream and get_text_stream: removed the imports from __init__.py. The __getattr__ at the bottom of that file already falls back to click, so they still work, just lazily. Kept under TYPE_CHECKING for type checkers.
  • PacifyFlushWrapper: really used, so it now goes through a small shim in _compat_click.py - new private name if it exists, old one on click < 8.5.

About CI changes

I added 8.5.* to both matrices. And while doing that I found that click pin does not reach the tests. Usual uv run --with "click==8.0.*" ... pytest runs the pytest from the project venv and that script uses the project interpreter, so the --with packages are ignored.

I changed the step to python -m pytest, like in test-examples.yml.

Fixes #349

ewels and others added 10 commits June 3, 2026 08:10
Drop support for Python 3.8 and 3.9; minimum is now Python 3.10.

- Adopt PEP 604 unions (`X | None`) and PEP 585 builtin generics
  (`list`, `dict`, `tuple`, `type`) throughout, importing ABCs from
  `collections.abc`.
- Remove version-conditional shims for Python <3.10: the `entry_points`
  3.7 compat wrapper, the `Concatenate`/`ParamSpec` typing fork, and the
  `<3.9` skip in the type tests.
- Add the `UP` (pyupgrade) ruff rule; bump ruff to v0.15.15 and set
  black/ruff/pyright targets to py310.
- Set `warn_unused_ignores = false` so one set of `# type: ignore`s works
  across mypy >=1.14.1, and drop the CI `mypy<1.16` pin (was only needed
  for Python 3.8).
- Drop 3.8/3.9 from CI matrices; tidy `subprocess.run` to `capture_output`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Reassigning the typed headers/rows variables to zip() tuples broke their
declared list types. Use an explicit branch that preserves the list types.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Resolve conflicts with the dev-tooling overhaul on main:

- pre-commit → prek: drop `.pre-commit-config.yaml` and the old workflow;
  main's `prek.toml` already pins a newer ruff than this branch did.
- Dev/docs requirements now live in dependency groups, so the
  `optional-dependencies` edits here are obsolete. Simplified the dev group's
  `mypy` marker now that the floor is Python 3.10.
- Dropped `[tool.black]` (main replaced Black with `ruff format`) and the
  `warn_unused_ignores = false` workaround (the dev group pins mypy >=2.3, so
  a single set of ignores no longer has to span several mypy versions).
- Kept the modernised annotations in the source files, and took main's
  versions of the `RichContext.__enter__`/`__exit__` removal and the panel
  table filtering fix.
- `RichHelpFormatter.write_dl` takes `Iterable` again to stay compatible with
  the click supertype.
Follow-up to ewels#343.

- Drop the prerelease alias whenever a release supersedes the series it
  points at, not only when the series matches exactly. An rc series that
  never ships a final otherwise leaves the alias stranded forever.
- Move the alias delete after the deploy, so a failed deploy does not
  leave gh-pages with the alias already removed.
- Stream subprocess output instead of capturing it, so `mike deploy` logs
  show up in the Actions run rather than only on failure. Commands whose
  output is parsed opt in with `capture=True`.
- Probe for aliases with `check=False` rather than catching the exception,
  so a missing alias no longer prints as a command failure.
- Warn when a prerelease targets an already-released series: docs are
  published per `major.minor`, so it silently overwrites released docs.
- Use builtin generics and `collections.abc.Sequence` (script is 3.13+).
@happykust
happykust force-pushed the feat/click-8.5-support branch from 9dac158 to ef881f4 Compare September 3, 2026 22:51
@happykust
happykust marked this pull request as ready for review September 3, 2026 23:11
@dwreeves

dwreeves commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks. For approval, remove the typechecking block in init, make the comments significantly less verbose, and refactor to not rely on the <8.5 wrapper rather than sticking it in compat unless this breaks anything.

@dwreeves

dwreeves commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Thanks! Will do a few more checks when I have a chance but it looks like it's probably good to merge.

@dwreeves

dwreeves commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Sorry, I forgot to rebase before merging the other PR, so this didn't close cleanly. But your changes have been implemented in #352 and I'll be releasing 1.9.9 shortly. Thanks again!

@dwreeves dwreeves closed this Sep 5, 2026
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.

Importing rich_click shows DeprecationWarnings with click 8.5.0

4 participants