Skip to content

Commit 97d0543

Browse files
committed
cli: remove deprecated --force-progress argument
1 parent 9ca7660 commit 97d0543

File tree

3 files changed

+7
-29
lines changed

3 files changed

+7
-29
lines changed

src/streamlink_cli/argparser.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -739,13 +739,6 @@ def build_parser():
739739
Default is yes.
740740
""",
741741
)
742-
output.add_argument(
743-
"--force-progress",
744-
action="store_true",
745-
help="""
746-
Deprecated in favor of --progress=force.
747-
""",
748-
)
749742

750743
stream = parser.add_argument_group("Stream options")
751744
stream.add_argument(

src/streamlink_cli/main.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,6 @@ def output_stream(stream, formatter: Formatter):
387387
args.progress == "force"
388388
or args.progress == "yes" and (sys.stderr.isatty() if sys.stderr else False)
389389
)
390-
if args.force_progress:
391-
show_progress = True
392-
warnings.warn(
393-
"The --force-progress option has been deprecated in favor of --progress=force",
394-
StreamlinkDeprecationWarning,
395-
stacklevel=1,
396-
)
397390
# TODO: finally clean up the global variable mess and refactor the streamlink_cli package
398391
# noinspection PyUnboundLocalVariable
399392
stream_runner = StreamRunner(stream_fd, output, show_progress=show_progress)

tests/cli/main/test_output_stream.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55

66
import streamlink_cli.main
7-
from streamlink.exceptions import StreamError, StreamlinkDeprecationWarning
7+
from streamlink.exceptions import StreamError
88
from streamlink.stream.stream import Stream
99
from streamlink_cli.exceptions import StreamlinkCLIError
1010
from streamlink_cli.main import build_parser, setup_args
@@ -67,27 +67,23 @@ def test_stream_failure_no_output_open(
6767

6868

6969
@pytest.mark.parametrize(
70-
("argv", "isatty", "deprecation", "expected"),
70+
("argv", "isatty", "expected"),
7171
[
72-
pytest.param(["--retry-open=1", "--progress=yes"], True, False, True, id="progress-tty"),
73-
pytest.param(["--retry-open=1", "--progress=no"], True, False, False, id="no-progress-tty"),
74-
pytest.param(["--retry-open=1", "--progress=yes"], False, False, False, id="progress-no-tty"),
75-
pytest.param(["--retry-open=1", "--progress=no"], False, False, False, id="no-progress-no-tty"),
76-
pytest.param(["--retry-open=1", "--progress=force"], False, False, True, id="force-progress-no-tty"),
77-
pytest.param(["--retry-open=1", "--progress=yes", "--force-progress"], False, True, True, id="force-progress-yes"),
78-
pytest.param(["--retry-open=1", "--progress=no", "--force-progress"], False, True, True, id="force-progress-no"),
72+
pytest.param(["--retry-open=1", "--progress=yes"], True, True, id="progress-tty"),
73+
pytest.param(["--retry-open=1", "--progress=no"], True, False, id="no-progress-tty"),
74+
pytest.param(["--retry-open=1", "--progress=yes"], False, False, id="progress-no-tty"),
75+
pytest.param(["--retry-open=1", "--progress=no"], False, False, id="no-progress-no-tty"),
76+
pytest.param(["--retry-open=1", "--progress=force"], False, True, id="force-progress-no-tty"),
7977
],
8078
indirect=["argv"],
8179
)
8280
def test_show_progress(
8381
monkeypatch: pytest.MonkeyPatch,
8482
caplog: pytest.LogCaptureFixture,
85-
recwarn: pytest.WarningsRecorder,
8683
argv: list,
8784
output: Mock,
8885
stream: Stream,
8986
isatty: bool,
90-
deprecation: bool,
9187
expected: bool,
9288
):
9389
streamio = BytesIO(b"0" * 8192 * 2)
@@ -103,8 +99,4 @@ def test_show_progress(
10399
("debug", "main", "Pre-buffering 8192 bytes"),
104100
("debug", "main", "Writing stream to output"),
105101
]
106-
assert [(record.category, str(record.message)) for record in recwarn.list] == ([(
107-
StreamlinkDeprecationWarning,
108-
"The --force-progress option has been deprecated in favor of --progress=force",
109-
)] if deprecation else [])
110102
assert mock_streamrunner.call_args_list == [call(streamio, output, show_progress=expected)]

0 commit comments

Comments
 (0)