Skip to content

Add --version flag to the aggrete CLI - #6

Merged
aggrete-dev merged 1 commit into
aggrete:mainfrom
muhammad-a-dev:add-version-flag
Sep 4, 2026
Merged

aggrete-dev merged 1 commit into
aggrete:mainfrom
muhammad-a-dev:add-version-flag

Conversation

@muhammad-a-dev

Copy link
Copy Markdown
Contributor

Summary

Adds a --version flag to the aggrete CLI so aggrete --version prints the installed package version and exits 0.

Fixes #3

Changes

  • Register --version on the argument parser in aggrete/proxy.py (main() / CLI entry via cli())
  • Resolve the version with importlib.metadata.version("aggrete") and print aggrete <version>
  • Add tests/test_version.py covering the flag

Test plan

  • aggrete --version prints e.g. aggrete 0.5.2 and exits 0
  • pytest tests/test_version.py passes
  • Existing suite still passes (pytest)

Print the installed package version via importlib.metadata and exit.
Includes a small regression test.
@muhammad-a-dev

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing when you can — this is a first-time contribution to the repo, so Actions is waiting on Approve and run workflows for the PR checks to start.

Locally: aggrete --version prints the package version and exits 0; tests/test_version.py covers the flag.

Happy to adjust if anything needs changing.

@aggrete-dev

Copy link
Copy Markdown
Member

Welcome, and thanks for the contribution. This is a clean, focused PR: it does exactly what #3 asked, nothing more, with a real test to back it. Nice touch importing importlib.metadata lazily so the version lookup only happens when the flag is used.

One entirely optional note for the future, not a change I need here: argparse also has a built-in action="version" you could use instead of store_true plus a manual check, but honestly your version reads well and the lazy import is arguably nicer, so I am happy to take it as is.

CI is green and I am merging. Thanks again for jumping in, and it is great to have you here. If you are up for more, there are a few other good first issues open.

@aggrete-dev
aggrete-dev merged commit 5e25cff into aggrete:main Sep 4, 2026
4 checks passed
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.

Add a --version flag to the aggrete CLI

2 participants