Skip to content

fix: Fix --version#125

Merged
johanneskoester merged 1 commit into
mainfrom
version-fix
Jun 18, 2026
Merged

fix: Fix --version#125
johanneskoester merged 1 commit into
mainfrom
version-fix

Conversation

@fxwiegand

@fxwiegand fxwiegand commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #124

Summary by CodeRabbit

  • Refactor
    • Improved version detection to dynamically retrieve version information from installed package metadata instead of static configuration. Robust fallback handling ensures the version string remains accessible when package metadata is unavailable.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1054e823-f4e8-45de-a294-f54930f1779b

📥 Commits

Reviewing files that changed from the base of the PR and between b9df76f and c6a03b6.

📒 Files selected for processing (1)
  • snakedeploy/__init__.py

📝 Walkthrough

Walkthrough

snakedeploy/__init__.py now imports importlib.metadata and sets __version__ by calling importlib.metadata.version("snakedeploy") inside a try/except PackageNotFoundError block, falling back to "unknown" when distribution metadata is absent.

Changes

Version resolution fix

Layer / File(s) Summary
importlib.metadata version resolution
snakedeploy/__init__.py
Adds try/except using importlib.metadata.version("snakedeploy") to set __version__, falling back to "unknown" on PackageNotFoundError.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: Fix --version' directly and clearly describes the main change: fixing the --version flag functionality to resolve the AttributeError reported in issue #124.
Linked Issues check ✅ Passed The PR successfully implements the fix for issue #124 by adding version attribute to the snakedeploy module via importlib.metadata, resolving the AttributeError that prevented the --version flag from working.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the --version functionality by implementing the version attribute in snakedeploy/init.py; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch version-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@johanneskoester
johanneskoester merged commit fb1ea2b into main Jun 18, 2026
6 checks passed
@johanneskoester
johanneskoester deleted the version-fix branch June 18, 2026 08:51
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.

Version subcommand not working

2 participants