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
Goal
Neither command-line tool can say which version it is.
sixsentences --versionand
six-community --versionboth fail. That is the first thing anyone is askedfor in a bug report, and right now the answer involves reading
pyproject.tomlinside a container.
Where
src/sixsentences/cli.py—_parser()builds anargparse.ArgumentParserwith
subcommands = parser.add_subparsers(dest="command", required=True).Note the
required=True: a naive--versionwill still fail because argparsedemands a subcommand first. Check the behaviour, do not assume it.
services/api/src/sixsentences_server/cli.py— atyper.Typerapplication.Typer solves this with a callback and
is_eager; the version must print andexit 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 literalin the source would be one more place for
release.py validateto catch driftingout of sync, and that gate already has enough to check.
How to verify
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.pyfor the engine side.Acceptance criteria
sixsentences --versionprints the version and exits 0six-community --versionprints the version and exits 0uv run pytest -qpasses