Skip to content

Commit

Permalink
refactor: change deprecated autocompletion to shell_complete
Browse files Browse the repository at this point in the history
Before this fix, we sometimes got this warning running unit tests:
.../envs/ev-py310/lib/python3.10/site-packages/typer/core.py:304: DeprecationWarning: 'autocompletion' is renamed to 'sh>
  _typer_param_setup_autocompletion_compat(self, autocompletion=autocompletion)

Also, the click documentation confirms autocompletion is deprecated:
https://click.palletsprojects.com/en/stable/changes/#version-8-0-0
  • Loading branch information
joanise committed Nov 19, 2024
1 parent 6943c70 commit eb8dc9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fs2/cli/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def benchmark(
dir_okay=False,
file_okay=True,
help="The path to your model configuration file.",
autocompletion=complete_path,
shell_complete=complete_path,
),
benchmark_type: BenchmarkType = BenchmarkType.training,
gpu: bool = True,
Expand Down
10 changes: 5 additions & 5 deletions fs2/cli/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def synthesize( # noqa: C901
exists=True,
dir_okay=False,
help="The path to a trained text-to-spec (i.e., feature prediction) or e2e EveryVoice model.",
autocompletion=complete_path,
shell_complete=complete_path,
),
output_dir: Path = typer.Option(
"synthesis_output",
Expand All @@ -291,7 +291,7 @@ def synthesize( # noqa: C901
file_okay=False,
dir_okay=True,
help="The directory where your synthesized audio should be written",
autocompletion=complete_path,
shell_complete=complete_path,
),
texts: list[str] = typer.Option(
[],
Expand Down Expand Up @@ -330,7 +330,7 @@ def synthesize( # noqa: C901
file_okay=True,
dir_okay=False,
help="The path to a file containing a list of utterances (a.k.a filelist). Use --text if you want to just synthesize one sample.",
autocompletion=complete_path,
shell_complete=complete_path,
),
text_representation: DatasetTextRepresentation = typer.Option(
DatasetTextRepresentation.characters,
Expand All @@ -354,7 +354,7 @@ def synthesize( # noqa: C901
help="ADVANCED. The path to preprocessed folder containing spec and duration folders to use for teacher-forcing the synthesized outputs.",
dir_okay=True,
file_okay=False,
autocompletion=complete_path,
shell_complete=complete_path,
),
vocoder_path: Path = typer.Option(
None,
Expand All @@ -363,7 +363,7 @@ def synthesize( # noqa: C901
help="The path to a trained vocoder (aka spec-to-wav model).",
dir_okay=False,
file_okay=True,
autocompletion=complete_path,
shell_complete=complete_path,
),
batch_size: int = typer.Option(
4,
Expand Down

0 comments on commit eb8dc9a

Please sign in to comment.