Skip to content

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

Open
svlandeg wants to merge 24 commits into
masterfrom
drop-click
Open

➖ Vendor Click and streamline Typer's functionality and code base#1774
svlandeg wants to merge 24 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.

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
Copy link
Copy Markdown
Contributor

This pull request has a merge conflict that needs to be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking conflicts Automatically generated when a PR has a merge conflict

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants