Skip to content

cli: remove deprecated --force-progress argument #6196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/streamlink_cli/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,13 +739,6 @@ def build_parser():
Default is yes.
""",
)
output.add_argument(
"--force-progress",
action="store_true",
help="""
Deprecated in favor of --progress=force.
""",
)

stream = parser.add_argument_group("Stream options")
stream.add_argument(
Expand Down
7 changes: 0 additions & 7 deletions src/streamlink_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,6 @@ def output_stream(stream, formatter: Formatter):
args.progress == "force"
or args.progress == "yes" and (sys.stderr.isatty() if sys.stderr else False)
)
if args.force_progress:
show_progress = True
warnings.warn(
"The --force-progress option has been deprecated in favor of --progress=force",
StreamlinkDeprecationWarning,
stacklevel=1,
)
# TODO: finally clean up the global variable mess and refactor the streamlink_cli package
# noinspection PyUnboundLocalVariable
stream_runner = StreamRunner(stream_fd, output, show_progress=show_progress)
Expand Down
22 changes: 7 additions & 15 deletions tests/cli/main/test_output_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

import streamlink_cli.main
from streamlink.exceptions import StreamError, StreamlinkDeprecationWarning
from streamlink.exceptions import StreamError
from streamlink.stream.stream import Stream
from streamlink_cli.exceptions import StreamlinkCLIError
from streamlink_cli.main import build_parser, setup_args
Expand Down Expand Up @@ -67,27 +67,23 @@ def test_stream_failure_no_output_open(


@pytest.mark.parametrize(
("argv", "isatty", "deprecation", "expected"),
("argv", "isatty", "expected"),
[
pytest.param(["--retry-open=1", "--progress=yes"], True, False, True, id="progress-tty"),
pytest.param(["--retry-open=1", "--progress=no"], True, False, False, id="no-progress-tty"),
pytest.param(["--retry-open=1", "--progress=yes"], False, False, False, id="progress-no-tty"),
pytest.param(["--retry-open=1", "--progress=no"], False, False, False, id="no-progress-no-tty"),
pytest.param(["--retry-open=1", "--progress=force"], False, False, True, id="force-progress-no-tty"),
pytest.param(["--retry-open=1", "--progress=yes", "--force-progress"], False, True, True, id="force-progress-yes"),
pytest.param(["--retry-open=1", "--progress=no", "--force-progress"], False, True, True, id="force-progress-no"),
pytest.param(["--retry-open=1", "--progress=yes"], True, True, id="progress-tty"),
pytest.param(["--retry-open=1", "--progress=no"], True, False, id="no-progress-tty"),
pytest.param(["--retry-open=1", "--progress=yes"], False, False, id="progress-no-tty"),
pytest.param(["--retry-open=1", "--progress=no"], False, False, id="no-progress-no-tty"),
pytest.param(["--retry-open=1", "--progress=force"], False, True, id="force-progress-no-tty"),
],
indirect=["argv"],
)
def test_show_progress(
monkeypatch: pytest.MonkeyPatch,
caplog: pytest.LogCaptureFixture,
recwarn: pytest.WarningsRecorder,
argv: list,
output: Mock,
stream: Stream,
isatty: bool,
deprecation: bool,
expected: bool,
):
streamio = BytesIO(b"0" * 8192 * 2)
Expand All @@ -103,8 +99,4 @@ def test_show_progress(
("debug", "main", "Pre-buffering 8192 bytes"),
("debug", "main", "Writing stream to output"),
]
assert [(record.category, str(record.message)) for record in recwarn.list] == ([(
StreamlinkDeprecationWarning,
"The --force-progress option has been deprecated in favor of --progress=force",
)] if deprecation else [])
assert mock_streamrunner.call_args_list == [call(streamio, output, show_progress=expected)]