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

➖ Vendor Click and streamline Typer's functionality and code base#1774
tiangolo merged 25 commits into
masterfrom
drop-click

Conversation

@svlandeg
Copy link
Copy Markdown
Member

@svlandeg svlandeg commented May 20, 2026

⚠️ 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
Comment thread docs/index.md Outdated
@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 Outdated
@github-actions github-actions Bot added the conflicts Automatically generated when a PR has a merge conflict label May 22, 2026
@github-actions

This comment was marked as resolved.

@github-actions github-actions Bot added conflicts Automatically generated when a PR has a merge conflict and removed conflicts Automatically generated when a PR has a merge conflict labels May 22, 2026
@github-actions

This comment was marked as resolved.

@svlandeg svlandeg self-assigned this May 26, 2026
@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
Copy link
Copy Markdown
Member

@tiangolo tiangolo left a comment

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
28 checks passed
@tiangolo tiangolo deleted the drop-click branch May 26, 2026 11:31
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