Skip to content

Add --version flag to CLI#19

Open
sammmiksha wants to merge 1 commit into
dcondrey:mainfrom
sammmiksha:add-cli-version-flag
Open

Add --version flag to CLI#19
sammmiksha wants to merge 1 commit into
dcondrey:mainfrom
sammmiksha:add-cli-version-flag

Conversation

@sammmiksha

Copy link
Copy Markdown

Summary

Adds a --version flag to the CLI using importlib.metadata.version() so the package version is retrieved dynamically at runtime.

Example:

location-tracker --version
location-tracker 2.1.3

Changes

  • Added from importlib.metadata import version
  • Added argparse --version action in cli()

Verification

  • Installed package in editable mode (pip install -e .)
  • Verified location-tracker --version outputs the package version
  • Ran test suite successfully (51 passed)

@dcondrey

dcondrey commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Good feature, but not passing CI yet:

  • ruff format --check fails: the ArgumentParser(...) block got re-indented, leave it as-is.
  • ruff check fails (I001): sort the new import.

Run ruff format . + ruff check --fix . and it's good to go.

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.

2 participants