From 01c394eb230144b41df673f8ce54f39ed162fb8e Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 25 Jun 2020 12:27:19 +0200 Subject: [PATCH] Update to latest Typer and remove hacks --- requirements.txt | 2 +- setup.cfg | 2 +- spacy/cli/_app.py | 14 ++++---------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/requirements.txt b/requirements.txt index 55b234073..654c8e278 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ murmurhash>=0.28.0,<1.1.0 wasabi>=0.7.0,<1.1.0 srsly>=2.1.0,<3.0.0 catalogue>=0.0.7,<1.1.0 -typer>=0.2.1,<1.0.0 +typer>=0.3.0,<1.0.0 # Third party dependencies numpy>=1.15.0 requests>=2.13.0,<3.0.0 diff --git a/setup.cfg b/setup.cfg index 01b18ef29..83085340d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,7 +47,7 @@ install_requires = wasabi>=0.7.0,<1.1.0 srsly>=2.1.0,<3.0.0 catalogue>=0.0.7,<1.1.0 - typer>=0.2.1,<1.0.0 + typer>=0.3.0,<1.0.0 # Third-party dependencies tqdm>=4.38.0,<5.0.0 numpy>=1.15.0 diff --git a/spacy/cli/_app.py b/spacy/cli/_app.py index d1c470b32..6f64dcb59 100644 --- a/spacy/cli/_app.py +++ b/spacy/cli/_app.py @@ -13,16 +13,10 @@ DOCS: https://spacy.io/api/cli app = typer.Typer(name=NAME, help=HELP) - -def Arg(*args, help: Optional[str] = None, **kwargs) -> typer.Argument: - """Wrapper for Typer's annotation to keep it short and set defaults.""" - # Filter out help for now until it's officially supported - return typer.Argument(*args, **kwargs) - - -def Opt(*args, **kwargs) -> typer.Option: - """Wrapper for Typer's annotation to keep it short and set defaults.""" - return typer.Option(*args, show_default=True, **kwargs) +# Wrappers for Typer's annotations. Initially created to set defaults and to +# keep the names short, but not needed at the moment. +Arg = typer.Argument +Opt = typer.Option def setup_cli() -> None: