Skip to content

💥 Make typer-slim a shallow wrapper around typer, always requiring rich and shellingham#1522

Merged
tiangolo merged 23 commits intofastapi:masterfrom
svlandeg:drop/slim
Feb 11, 2026
Merged

💥 Make typer-slim a shallow wrapper around typer, always requiring rich and shellingham#1522
tiangolo merged 23 commits intofastapi:masterfrom
svlandeg:drop/slim

Conversation

@svlandeg
Copy link
Member

@svlandeg svlandeg commented Feb 6, 2026

From a recent survey we've run on Typer, we've learned that less than 5% of users specifically use typer-slim. We had originally introduced this package to provide users the option to not install shellingham & rich. However, even with these two packages, the typer library is still pretty small (25Mb) and the code base is more complex by having to cater for custom logic whether or not Rich is present or not. Additionally, we've run into issues (#1503) with publishing typer and typer-slim from the same codebase, so we can't keep the current situation. All of this has resulted in the conclusion to drop support for typer-slim. It will just be a shallow wrapper around typer.

We are aware that some users do not prefer some of the Rich formatting, and we'll look into options of customizing this further in the future. For now, there is always the option of setting Typer(rich_markup_mode=None) for each app, or setting a global environment variable TYPER_USE_RICH to False to disable any Rich formatting.

I've built the wheel locally (with TIANGOLO_BUILD_PACKAGE="typer-slim") and installed it in a clean venv, and got:

$ pip list
Package           Version
----------------- -------
click             8.3.1
colorama          0.4.6
markdown-it-py    4.0.0
mdurl             0.1.2
pip               25.2
Pygments          2.19.2
rich              14.3.2
shellingham       1.5.4
typer             0.21.1
typer-slim        0.21.1
typing_extensions 4.15.0

WIP

  • Document new env var
  • Fix redistribute tests

@svlandeg svlandeg linked an issue Feb 6, 2026 that may be closed by this pull request
7 tasks
@svlandeg svlandeg self-assigned this Feb 6, 2026
@svlandeg svlandeg marked this pull request as ready for review February 9, 2026 09:31
@svlandeg svlandeg removed their assignment Feb 9, 2026
@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Feb 11, 2026
@github-actions

This comment was marked as resolved.

@github-actions github-actions bot removed the conflicts Automatically generated when a PR has a merge conflict label Feb 11, 2026
Copy link
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.

Great, thank you! 🙌


The PDM hook and config logic is a bit cumbersome, strange, and hard to test. 😅

I added some tweaks for that:

  • Tweak the PDM hook script and config in pyproject.toml to make typer-slim do not include any code and only depend on typer (it was including the typer code in typer-slim)
  • Add a custom README for typer-slim to tell users to not use it
  • Make typer-slim and typer-cli depend on typer>={version} instead of typer=={version}, so that we can remove all this stuff later at some point
  • Update the logic in the PDM hook and configs so that by default, even if we removed all that extra logic, it would build regular typer, without needing any extra custom config
  • Update the test-redistribute in CI to only test for typer

This will be available in Typer 0.22.0 in the next few hours. 🚀

@tiangolo tiangolo merged commit b66a370 into fastapi:master Feb 11, 2026
23 checks passed
@svlandeg svlandeg deleted the drop/slim branch February 11, 2026 13:24
musicinmybrain added a commit to musicinmybrain/jaraco.text that referenced this pull request Feb 12, 2026
Upstream has deprecated `typer-slim`, and it’s now just a shallow
wrapper around `typer`. See fastapi/typer#1522,
https://github.com/fastapi/typer/blob/0.23.0/docs/release-notes.md#0220.
musicinmybrain added a commit to musicinmybrain/openneuro-py that referenced this pull request Feb 12, 2026
Upstream has deprecated `typer-slim`, and it’s now just a shallow
wrapper around `typer`. See fastapi/typer#1522,
https://github.com/fastapi/typer/blob/0.23.0/docs/release-notes.md#0220.
ryand56 added a commit to ryand56/nixpkgs that referenced this pull request Feb 14, 2026
ryand56 added a commit to ryand56/nixpkgs that referenced this pull request Feb 14, 2026
shanjiaz pushed a commit to vllm-project/speculators that referenced this pull request Feb 17, 2026
Hi! Just a quick heads-up that we've removed support for `typer-slim`.
From v0.22.0 onwards, `typer-slim` will be the same as `typer`, with
external requirements `shellingham` and `rich` installed by default, see
fastapi/typer#1522. I saw that `rich` is already
an external dependency of this library so this should have little
influence. `huggingface-hub` has also switched to using `typer` instead
of `typer-slim`.

Let me know if you have any questions/concerns!

Signed-off-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
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.

Overlap of typer and typer-slim causes package managemers to fail

2 participants