Skip to content

fix: --version #31

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion tesseract_core/sdk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _validate_tesseract_name(name: str | None) -> str:
def version_callback(value: bool | None) -> None:
"""Typer callback for version option."""
if value:
from . import __version__
from .. import __version__

typer.echo(__version__)
raise typer.Exit()
Expand Down
6 changes: 6 additions & 0 deletions tests/sdk_tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ def test_suggestion_on_misspelled_command(cli_runner):
assert result.exit_code == 2, result.stdout
assert "No such command 'wellbloodygreatinnit'." in result.stderr
assert "Did you mean" not in result.stderr


def test_version_command(cli_runner):
result = cli_runner.invoke(cli, ["--version"])
assert result.exit_code == 0, result.stdout
assert not result.stderr
Loading