Skip to content

Commit

Permalink
refactor(cli) Remove version command from the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwilter committed Feb 19, 2025
1 parent 7308652 commit 736bd8d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
6 changes: 0 additions & 6 deletions src/py/flwr/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,5 @@ def version_callback(
raise typer.Exit()


@app.command()
def version() -> None:
"""Show the version and exit."""
typer.secho(f"Flower version: {package_version}", fg="blue")


if __name__ == "__main__":
app()
19 changes: 0 additions & 19 deletions src/py/flwr/cli/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ def test_version_args() -> None:
assert f"Flower version: {package_version}\n" in result.output


def test_version_command() -> None:
"""Add appropriate assertions for the version command."""
result = runner.invoke(app, ["version"])
assert result.exit_code == 0
assert f"Flower version: {package_version}\n" in result.output


def test_help_command() -> None:
"""Test the -h flag."""
result = runner.invoke(app, ["-h"])
Expand Down Expand Up @@ -121,15 +114,3 @@ def test_invalid_command() -> None:
result = runner.invoke(app, ["nonexistent-command"])
assert result.exit_code != 0
assert "No such command" in result.output

# Test invalid argument for existing command
result = runner.invoke(app, ["version", "--nonexistent-flag"])
assert result.exit_code != 0
assert "Error" in result.output
assert "No such option" in result.output

# Test invalid extra argument for existing command
result = runner.invoke(app, ["version", "nonexistent-arg"])
assert result.exit_code != 0
assert "Error" in result.output
assert "Got unexpected extra argument" in result.output

0 comments on commit 736bd8d

Please sign in to comment.