-
-
Notifications
You must be signed in to change notification settings - Fork 839
💥 Make typer-slim a shallow wrapper around typer, always requiring rich and shellingham
#1522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| The `standard` extra dependencies are `rich` and `shellingham`. | ||
|
|
||
| **Note**: The `typer` command is only included in the `typer` package. | ||
| However, since version 0.22.0, we have stopped supporting this, and `typer-slim` now simply installs (all of) Typer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: update version here right before merging/releasing.
|
|
||
| HAS_RICH = importlib.util.find_spec("rich") is not None | ||
| HAS_SHELLINGHAM = importlib.util.find_spec("shellingham") is not None | ||
| HAS_RICH = os.getenv("TYPER_USE_RICH", True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to rename this one to USE_RICH instead of HAS_RICH but that causes errors in the redistribution tests as they'd use an old pip-installed typer.
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 installshellingham&rich. However, even with these two packages, thetyperlibrary is still pretty small (25Mb) and the code base is more complex by having to cater for custom logic whether or notRichis present or not. Additionally, we've run into issues (#1503) with publishingtyperandtyper-slimfrom the same codebase, so we can't keep the current situation. All of this has resulted in the conclusion to drop support fortyper-slim. It will just be a shallow wrapper aroundtyper.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 variableTYPER_USE_RICHtoFalseto 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:WIP