Skip to content

➖ Vendor Click and streamline Typer's functionality and code base - #1774

Merged
tiangolo merged 25 commits into
masterfrom
drop-click
May 26, 2026
Merged

tiangolo merged 25 commits into
masterfrom
drop-click

Conversation

@svlandeg

@svlandeg svlandeg commented May 20, 2026 •

Copy link
Copy Markdown
Member

⚠️ Breaking change ⚠️

This PR vendors Click 8.3.1, removes some unused functionality, drops support for Click-only features, and adds a bunch of unit tests to bring Typer's test coverage back to 100%.

There should be no breaking features with respect to functionality documented in Typer's documentation / Typer's public-facing API. But users relying on the fact that Typer used Click underneath, might have to refactor their application. Any code in the new subfolder typer/_click should not be used by external applications, as it will be subject to change in the near future.

More information about how & why we vendored Click can be found here, and we'd love to take this opportunity to thank the Click team for all their work over the years 🙏

Process

  1. Moved all Click 8.3.1 code as-is into a subdir with the original license present: Remove external Click dependency #1525
  2. Removed code that isn't used by public Typer functionality: Remove unused Click code #1601
  3. Merge Click and Typer functionality (Path, Argument, Option, Group, Choice, ShellComplete): Merge Click and Typer functionality #1680
  4. Further remove unused code paths and expand the test suite for functionality Typer does rely on: Increase coverage #1690
  5. Ensure that the new Click-based code passes our ty type checker: Enable ty and resolve typing issues #1770
  6. Update docs: this PR, cf. 1c936a9

@tiangolo: as you've already reviewed 1-5 in detail, you can focus on the docs changes in 6. Feel free to push to the branch directly if you want to reword some of this.

svlandeg and others added 14 commits February 13, 2026 11:32
* vendor click 8.1.8 into subdir _click for now

* use full version to avoid confusion (for now)

* few import fixes in the vendored files

* fix stderr test

* switch to Click 8.3.1

* remove deprecation warnings for Click 9.0

* update uv lock

* 🎨 Auto format

* remove Python 3.9 test

* avoid ruff E402 warning

* remove code paths for Click < 8.2

* 🎨 Auto format

* remove unused variable

* remove more code specific only to <8.2

* 🎨 Auto format

* remove using_click documentation

* remove reference to Click design difference

* clean up click decorators code

* remove command and group from click's core

* remove Click's shell_complete (Typer overwrites it)

* restore Click's shell_complete for now

* format

* 🎨 Auto format

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
# Conflicts:
#	typer/main.py
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
@svlandeg svlandeg self-assigned this May 20, 2026
Comment thread docs/index.md Resolved
Comment thread docs/index.md Resolved
@svlandeg svlandeg removed their assignment May 20, 2026
@svlandeg svlandeg changed the title ➖ Vendor Click and clean up functionality not required in Typer ➖ Vendor Click and streamline Typer's functionality and code base May 20, 2026
@svlandeg
svlandeg marked this pull request as ready for review May 20, 2026 15:59
Comment thread docs/index.md Resolved
@github-actions github-actions Bot removed the conflicts Automatically generated when a PR has a merge conflict label May 26, 2026
@svlandeg svlandeg removed their assignment May 26, 2026

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thank you! Let's release this! 🚀

@tiangolo
tiangolo merged commit 1829d73 into master May 26, 2026
26 checks passed
@tiangolo
tiangolo deleted the drop-click branch May 26, 2026 11:31
@svlandeg svlandeg mentioned this pull request Jun 16, 2026
8 of 11 tasks
Cielquan added a commit to rstcheck/rstcheck that referenced this pull request Jul 26, 2026
due to the vendored version of click with fastapi/typer#1774
an `isinstance` check fails in sphinx-click
@JeyKip JeyKip mentioned this pull request Aug 15, 2026
3 tasks done
quixoticmonk added a commit to quixoticmonk/context-ontology-accelerator that referenced this pull request Nov 7, 2026
The preprocessing image build failed at `python -m spacy download
en_core_web_sm` with `ModuleNotFoundError: No module named 'click'`.

spaCy 3.8.7 imports click directly (spacy/cli/_util.py) but declares only
typer>=0.3.0,<1.0.0. Typer 0.26.0 (fastapi/typer#1774) vendored click and
dropped it as a dependency, so an unpinned install now resolves no click and
even `import spacy` fails. spaCy declares click from 3.8.15
(explosion/spaCy#13971, #13973); this image still pins 3.8.7.

Install "click>=8.1,<9" next to spacy==3.8.7 as a stopgap. Upstream v0.3.9
has the same pin and the same failure; bumping spaCy to >=3.8.15 is the
cleaner long-term fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants