Skip to content

Print the raw version string for -dumpversion - #161

Merged
ESultanik merged 1 commit into
masterfrom
147-dumpversion-string
Sep 9, 2026
Merged

ESultanik merged 1 commit into
masterfrom
147-dumpversion-string

Conversation

@ESultanik

Copy link
Copy Markdown
Collaborator

Closes #147

-dumpversion writes Graphtage's version to STDOUT so that scripts can consume it. It built that output with ' '.join(map(str, version.__version__)). version.__version__ used to be a tuple of version components, but it is now the string "0.3.1", so the join walked the string's characters and printed 0 . 3 . 1.

The fix prints version.VERSION_STRING, the same spelling the --version option already uses. Its name states the type the option needs, so the two stay consistent and a future change to how the version is represented cannot silently reintroduce the same failure.

The regression test lives in test/test_main.py alongside the other in-process CLI tests. main() reaches this branch through the builtin exit(), which raises SystemExit rather than returning an exit status, so the test asserts on the exception's code instead of using the existing run_graphtage helper.

Before:

$ graphtage -dumpversion
0 . 3 . 1

After:

$ graphtage -dumpversion
0.3.1

Validation

  • uv run --frozen --extra dev ruff check graphtage test docs bindist — passes
  • uv run --frozen --extra dev pytest — 141 passed
  • uv run --frozen --extra dev make -C docs html SPHINXOPTS="-W --keep-going" — build succeeded
  • uv lock --check — fails in my environment because of a local exclude-newer setting; it fails the same way on an unmodified checkout of master, and this change touches no dependencies, so uv.lock is unchanged.

The test was run against the unfixed code first and failed with AssertionError: '0.3.1' != '0 . 3 . 1', then passed after the one-line fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GypKU5KdLfs2Cf8kS2TzJa

The -dumpversion option exists so that scripts can read Graphtage's
version from STDOUT. It built its output by joining over
version.__version__, which was once a tuple of version components. That
attribute is now the string "0.3.1", so the join walked its characters
and separated each one, printing "0 . 3 . 1". Any script parsing that
output saw a value it could not use as a version.

Print version.VERSION_STRING instead. That is the spelling the --version
option already uses, and its name states the type the option needs, so
the two stay consistent and a future change to the version's
representation cannot silently reintroduce the same failure.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GypKU5KdLfs2Cf8kS2TzJa
@ESultanik
ESultanik merged commit 809a541 into master Sep 9, 2026
12 checks passed
@ESultanik
ESultanik deleted the 147-dumpversion-string branch September 9, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-dumpversion prints 0 . 3 . 1

1 participant