Skip to content

cli: report the version from both command-line tools #89

Description

@L4XB

Goal

Neither command-line tool can say which version it is. sixsentences --version
and six-community --version both fail. That is the first thing anyone is asked
for in a bug report, and right now the answer involves reading pyproject.toml
inside a container.

Where

  • src/sixsentences/cli.py_parser() builds an argparse.ArgumentParser
    with subcommands = parser.add_subparsers(dest="command", required=True).
    Note the required=True: a naive --version will still fail because argparse
    demands a subcommand first. Check the behaviour, do not assume it.
  • services/api/src/sixsentences_server/cli.py — a typer.Typer application.
    Typer solves this with a callback and is_eager; the version must print and
    exit before any subcommand runs.

What to do

Read the version from the installed package metadata
(importlib.metadata.version), not from a second hard-coded string. A literal
in the source would be one more place for release.py validate to catch drifting
out of sync, and that gate already has enough to check.

How to verify

uv run sixsentences --version
uv run --directory services/api six-community --version

Both print the version and exit 0, and both still work with no arguments and
with a real subcommand.

Add a test to tests/test_cli.py for the engine side.

Acceptance criteria

  • sixsentences --version prints the version and exits 0
  • six-community --version prints the version and exits 0
  • No new hard-coded version string anywhere
  • uv run pytest -q passes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:apiPublic Python and serialization contractsclaimedA contributor holds this issue via /claim; released after 14 quiet dayseffort:smallA few files, no system-wide knowledge neededgood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions