Skip to content

Releases: fastapi/typer

0.15.1

04 Dec 17:44
Compare
Choose a tag to compare

Features

  • 🗑️ Deprecate shell_complete and continue to use autocompletion for CLI parameters. PR #974 by @svlandeg.

Docs

  • ✏️ Fix a few typos in the source and documentation. PR #1028 by @kkirsche.
  • 📝 Fix minor inconsistencies and typos in tutorial. PR #1067 by @tvoirand.
  • ✏️ Fix a few small typos in the documentation. PR #1077 by @svlandeg.

Internal

0.15.0

03 Dec 15:36
Compare
Choose a tag to compare

Features

Internal

0.14.0

28 Nov 22:48
Compare
Choose a tag to compare

Breaking Changes

  • 🔥 Remove auto naming of groups added via add_typer based on the group's callback function name. PR #1052 by @patrick91.

Before, it was supported to infer the name of a command group from the callback function name in the sub-app, so, in this code:

import typer

app = typer.Typer()
users_app = typer.Typer()

app.add_typer(users_app)


@users_app.callback()
def users():  # <-- This was the inferred command group name
    """
    Manage users in the app.
    """


@users_app.command()
def create(name: str):
    print(f"Creating user: {name}")

...the command group would be named users, based on the name of the function def users().

Now you need to set it explicitly:

import typer

app = typer.Typer()
users_app = typer.Typer()

app.add_typer(users_app, name="users")  # <-- Explicitly set the command group name


@users_app.callback()
def users():
    """
    Manage users in the app.
    """


@users_app.command()
def create(name: str):
    print(f"Creating user: {name}")

Updated docs SubCommand Name and Help.

Note: this change will enable important features in the next release. 🤩

Internal

0.13.1

18 Nov 22:38
Compare
Choose a tag to compare

Features

  • ✨ Remove Rich tags when showing completion text. PR #877 by @svlandeg.
  • ✨ Render Rich markup as HTML in Markdown docs. PR #847 by @svlandeg.
  • ✨ Support cp850 encoding for auto-completion in PowerShell. PR #808 by @svlandeg.
  • ✨ Allow gettext translation of help message. PR #886 by @svlandeg.

Refactors

Docs

  • 📝 Update markdown includes to use the new simpler format. PR #1054 by @tiangolo.

Internal

0.13.0

07 Nov 21:12
Compare
Choose a tag to compare

Features

  • ✨ Handle KeyboardInterrupt separately from other exceptions. PR #1039 by @patrick91.
  • ✨ Update launch to not print anything when opening urls. PR #1035 by @patrick91.
  • ✨ Show help items in order of definition. PR #944 by @svlandeg.

Fixes

  • 🐛 Fix equality check for custom classes. PR #979 by @AryazE.
  • 🐛 Allow colon in zsh autocomplete values and descriptions. PR #988 by @snapbug.

Refactors

  • 🗑️ Deprecate support for is_flag and flag_value parameters. PR #987 by @svlandeg.
  • 🔥 Remove unused functionality from _typing.py file. PR #805 by @ivantodorovich.
  • ✏️ Fix typo in function name _make_rich_text. PR #959 by @svlandeg.

Internal

0.12.5

24 Aug 21:17
Compare
Choose a tag to compare

Features

  • 💄 Unify the width of the Rich console for help and errors. PR #788 by @racinmat.
  • 🚸 Improve assertion error message if a group is not a valid subclass. PR #425 by @chrisburr.

Fixes

  • 🐛 Ensure rich_markup_mode=None disables Rich formatting. PR #859 by @svlandeg.
  • 🐛 Fix sourcing of completion path for Git Bash. PR #801 by @svlandeg.
  • 🐛 Fix PowerShell completion with incomplete word. PR #360 by @patricksurry.

Refactors

Docs

  • ♻️ Use F-strings in Click examples in docs. PR #891 by @svlandeg.
  • 📝Add missing main.py in tutorial on CLI option names. PR #868 by @fsramalho.
  • 📝 Fix broken link. PR #835 by @OhioDschungel6.
  • 📝 Update package docs with the latest versions of Typer and Poetry. PR #781 by @kinuax.
  • 📝 Update the Progress Bar tutorial with correct output. PR #199 by @n1ckdm.
  • 📝 Add docs and scripts to test completion in different shells. PR #953 by @tiangolo.
  • ✏️ Fix a typo in docs/virtual-environments.md. PR #952 by @tiangolo.
  • ✏️ Fix typo in docs/contributing.md. PR #947 by @tiangolo.
  • 📝 Add docs for virtual environments, environment variables, and update contributing. PR #946 by @tiangolo.

Internal

0.12.4

17 Aug 03:32
Compare
Choose a tag to compare

Features

  • ✨ Add support for Python 3.12, tests in CI and official marker. PR #807 by @ivantodorovich.

Fixes

  • 🐛 Fix support for UnionType (e.g. str | None) with Python 3.11. PR #548 by @jonaslb.
  • 🐛 Fix zsh autocompletion installation. PR #237 by @alexjurkiewicz.
  • 🐛 Fix usage of Annotated with future annotations in Python 3.7+. PR #814 by @ivantodorovich.
  • 🐛 Fix shell_complete not working for Arguments. PR #737 by @bckohan.

Docs

  • 📝 Update docs links, from tiangolo to new fastapi org. PR #919 by @tiangolo.
  • 📝 Add docs for team and repo management. PR #917 by @tiangolo.

Internal

  • 🔧 Add URLs to pyproject.toml, show up in PyPI. PR #931 by @tiangolo.
  • 👷 Do not sync labels as it overrides manually added labels. PR #930 by @tiangolo.
  • 👷 Update labeler GitHub Action to add only one label. PR #927 by @tiangolo.
  • 👷 Update labeler GitHub Actions permissions and dependencies. PR #926 by @tiangolo.
  • 👷 Add GitHub Action label-checker. PR #925 by @tiangolo.
  • 👷 Add GitHub Action labeler. PR #924 by @tiangolo.
  • 👷 Add GitHub Action add-to-project. PR #922 by @tiangolo.
  • 🔨 Update docs.py script to enable dirty reload conditionally. PR #918 by @tiangolo.
  • 🔧 Update MkDocs previews. PR #916 by @tiangolo.
  • 👷 Upgrade build docs configs. PR #914 by @tiangolo.
  • 🔧 Update MkDocs to have titles in Markdown files instead of config. PR #913 by @tiangolo.
  • 👷 Add alls-green for test-redistribute. PR #911 by @tiangolo.
  • 👷 Update docs-previews to handle no docs changes. PR #912 by @tiangolo.
  • 👷🏻 Show docs deployment status and preview URLs in comment. PR #910 by @tiangolo.
  • 🔧 Enable auto dark mode from system. PR #908 by @tiangolo.
  • 💄 Add dark mode logo. PR #907 by @tiangolo.
  • 🔧 Update tabs and admonitions with new syntax and new MkDocs features. PR #906 by @tiangolo.
  • 🔧 Enable MkDocs Material features. PR #905 by @tiangolo.
  • 🔧 Enable dark mode for docs. PR #904 by @tiangolo.
  • ➖ Do not install jieba for MkDocs Material as there are no chinese translations. PR #903 by @tiangolo.
  • 🙈 Add MkDocs Material cache to gitignore. PR #902 by @tiangolo.
  • 🔨 Update lint script. PR #901 by @tiangolo.
  • 🔧 Update MkDocs configs and docs build setup. PR #900 by @tiangolo.
  • ⬆ Bump actions/cache from 3 to 4. PR #839 by @dependabot[bot].
  • 🍱 Update Typer icon and logo. PR #899 by @tiangolo.
  • 👷 Update issue-manager.yml GitHub Action permissions. PR #897 by @tiangolo.
  • 👷 Refactor GitHub Action to comment docs deployment URLs and update token, preparing for GitHub org. PR #896 by @tiangolo.
  • 🔨 Update docs Termynal scripts to not include line nums for local dev. PR #882 by @tiangolo.
  • ⬆ Bump black from 23.3.0 to 24.3.0. PR #837 by @dependabot[bot].
  • ⬆ Bump pillow from 10.1.0 to 10.3.0. PR #836 by @dependabot[bot].
  • ✅ Add CI configs to run tests on Windows and MacOS. PR #824 by @svlandeg.
  • 👷 Update GitHub Actions to upload and download artifacts. PR #829 by @tiangolo.
  • 👷 Tweak CI for test-redistribute, add needed env vars for slim. PR #827 by @tiangolo.
  • ✅ Generalize test suite to run on Windows. PR #810 by @svlandeg.
  • ✅ Add __init__.py files to fix test suite. PR #809 by @svlandeg.
  • 🔧 Update MkDocs Material, enable plugins. PR #813 by @tiangolo.
  • 🔧 Tweak development scripts and configs after migration to PDM, Ruff, etc.. PR #797 by @tiangolo.

0.12.3

09 Apr 17:12
Compare
Choose a tag to compare

Fixes

  • 🐛 Fix Rich formatting with no commands. PR #796 by @svlandeg.

0.12.2

08 Apr 19:18
Compare
Choose a tag to compare

Features

  • ✨ Improve column help display, ensure commands column width is the same on all panels. PR #567 by @ssbarnea.

Fixes

  • 🐛 Add support for an argument of type Optional[Tuple] and default value None. PR #757 by @Asthestarsfalll.

Docs

0.12.1

05 Apr 00:41
Compare
Choose a tag to compare

Now you don't need to install typer[all]. When you install typer it comes with the default optional dependencies and the typer command.

If you don't want the extra optional dependencies (rich and shellingham), you can install typer-slim instead.

You can also install typer-slim[standard], which includes the default optional dependencies, but not the typer command.

Now the package typer-cli doesn't add anything on top of what typer has, it only depends on typer, and is there only for backwards compatibility, so that projects that depend on typer-cli can get the latest features of the typer command while they upgrade their dependencies to require typer directly.

Features

  • ✨ Add support for typer ./someprogram.py utils docs --title. PR #782 by @tiangolo.

Fixes

  • 🐛 Fix broken installation when upgrading from typer <0.12.0 to typer >=0.12.0, make typer independent of typer-slim, include typer command in typer package. PR #791 by @tiangolo.

This fixes a problem that would break the typer installation directory when upgrading from typer <0.12.0 to typer >=0.12.0, see issue #790.

By installing the latest version (0.12.1) it fixes it, for any previous version, even if the installation directory was already broken by the previous upgrade.

Internal