Skip to content

Releases: fastapi/typer

0.16.1

18 Aug 19:17
Compare
Choose a tag to compare

Fixes

  • 🐛 Avoid printing additional output with no_args_is_help=True and Click 8.2. PR #1278 by @svlandeg.

Docs

  • 📝 Remove duplicated line in environment-variables.md. PR #1277 by @neirzhei.
  • 📝 Fix reference to count parameter in the documentation. PR #1201 by @PokkaKiyo.

Internal

0.16.0

26 May 14:30
Compare
Choose a tag to compare

Upgrades

When using the CliRunner with Click < 8.2, to be able to access the stderr output, you needed to set the mix_stderr parameter to True. Since Click 8.2 (and Typer 0.160 this release supporting it) this is no longer necessary, so this parameter has been removed.

Refactors

  • ✅ Refactor tests for compatibility with Click 8.2. PR #1230 by @tiangolo.

Internal

0.15.4

14 May 16:34
Compare
Choose a tag to compare

Upgrades

  • 📌 Pin Click to < 8.2, compatibility for Click >= 8.2 will be added in a future version. PR #1225 by @tiangolo.

0.15.3

28 Apr 21:40
Compare
Choose a tag to compare

Fixes

  • 🐛 Ensure that autocompletion works for Path arguments/options. PR #1138 by @svlandeg.
  • 🐛 Fix newline after header in help text, and add more tests for the behaviour of rich_markup_mode . PR #964 by @svlandeg.

Internal

0.15.2

27 Feb 19:17
Compare
Choose a tag to compare

Features

  • ✨ Allow custom styles for commands in help output. PR #1103 by @TheTechromancer.
  • ✨ Avoid the unnecessary import of typing_extensions in newer Python versions. PR #1048 by @horta.

Fixes

  • 🐛 Fix shell completions for the fish shell. PR #1069 by @goraje.

Refactors

  • 🚚 Rename test to corner-cases to make it more explicit. PR #1083 by @tiangolo.

Docs

  • ✏️ Fix small typos in the tutorial documentation. PR #1137 by @svlandeg.
  • 📝 Update optional CLI argument section in tutorial with Annotated. PR #983 by @gkeuccsr.
  • 📝 Clarify the need for mix_stderr when accessing the output of stderr in tests. PR #1045 by @mrchrisadams.

Internal

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