Skip to content

Commit d06c2ef

Browse files
committed
fix: remove deprecated shell_complete that we no longer need anyway
Remove shell_complete and instead, require typer >= 0.15.3, which fixes the bug for which autocompletion/shell_complete was a work-around. See EveryVoiceTTS/EveryVoice#695
1 parent 90c5a22 commit d06c2ef

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

aligner/cli.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
)
2727

2828

29-
def complete_path(ctx, param, incomplete):
30-
return []
31-
32-
3329
# We put this here for easy import into other modules that consume
3430
# the aligner, like EveryVoice
3531
EXTRACT_SEGMENTS_LONG_HELP = """
@@ -48,14 +44,10 @@ def complete_path(ctx, param, incomplete):
4844
)
4945
def extract_segments_from_textgrid(
5046
text_grid_path: Path = typer.Argument(
51-
..., exists=True, file_okay=True, dir_okay=False, shell_complete=complete_path
52-
),
53-
audio_path: Path = typer.Argument(
54-
..., exists=True, file_okay=True, dir_okay=False, shell_complete=complete_path
55-
),
56-
outdir: Path = typer.Argument(
57-
..., exists=False, file_okay=False, dir_okay=True, shell_complete=complete_path
47+
..., exists=True, file_okay=True, dir_okay=False
5848
),
49+
audio_path: Path = typer.Argument(..., exists=True, file_okay=True, dir_okay=False),
50+
outdir: Path = typer.Argument(..., exists=False, file_okay=False, dir_okay=True),
5951
tier_number: int = typer.Option(
6052
4, help="The index of the tier to extract intervals from."
6153
),
@@ -119,12 +111,8 @@ def extract_segments_from_textgrid(
119111
name="align", help=ALIGN_SINGLE_LONG_HELP, short_help=ALIGN_SINGLE_SHORT_HELP
120112
)
121113
def align_single(
122-
text_path: Path = typer.Argument(
123-
..., exists=True, file_okay=True, dir_okay=False, shell_complete=complete_path
124-
),
125-
audio_path: Path = typer.Argument(
126-
..., exists=True, file_okay=True, dir_okay=False, shell_complete=complete_path
127-
),
114+
text_path: Path = typer.Argument(..., exists=True, file_okay=True, dir_okay=False),
115+
audio_path: Path = typer.Argument(..., exists=True, file_okay=True, dir_okay=False),
128116
sample_rate: int = typer.Option(
129117
16000, help="The target sample rate for the model."
130118
),

aligner/tests/test_cli.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from typer.testing import CliRunner
2121

2222
from ..classes import Segment
23-
from ..cli import app, complete_path
23+
from ..cli import app
2424

2525

2626
class CLITest(TestCase):
@@ -112,9 +112,6 @@ def test_align_something(self):
112112

113113

114114
class MiscTests(TestCase):
115-
def test_shell_complete(self):
116-
self.assertEqual(complete_path(None, None, None), [])
117-
118115
def test_segment(self):
119116
segment = Segment("text", 500, 700, 0.42)
120117
self.assertEqual(len(segment), 200)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies = [
2727
"soundfile>=0.10.2",
2828
"torch>=2.1.0",
2929
"torchaudio>=2.1.0",
30-
"typer>=0.12.4",
30+
"typer>=0.15.3",
3131
]
3232

3333
[project.scripts]

0 commit comments

Comments
 (0)