Skip to content

feat(cli): add --version flag#5

Open
slai11 wants to merge 1 commit intomainfrom
feat/add-version-flag
Open

feat(cli): add --version flag#5
slai11 wants to merge 1 commit intomainfrom
feat/add-version-flag

Conversation

@slai11
Copy link

@slai11 slai11 commented Mar 18, 2026

Summary

  • Add --version flag using Click's built-in version_option decorator
  • Reads version dynamically from package metadata (importlib.metadata)
  • allium --version now outputs allium, version X.Y.Z

Test plan

  • uv run pytest tests/test_main.py -v — 10 tests pass (2 new)
  • uv run ruff check . && uv run ruff format --check . — clean
  • Manual: allium --version outputs version string

🤖 Generated with Claude Code

Use click.version_option with package_name to read version from
importlib.metadata automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@click.group(help=_HELP)
@click.version_option(
version=None,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tough. we can set it here and control when we do releases?

In a compiled-binary-world, the version can be 'baked' into the build. But for python, there's no real "build" step is there?

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.

1 participant