Skip to content

Add __version__ attribute to sgraph package - #163

Merged
villelaitila merged 2 commits into
softagram:mainfrom
villelaitila:feature/version-attribute
Jul 12, 2026
Merged

Add __version__ attribute to sgraph package#163
villelaitila merged 2 commits into
softagram:mainfrom
villelaitila:feature/version-attribute

Conversation

@villelaitila

Copy link
Copy Markdown
Contributor

Summary

Expose the standard sgraph.__version__ attribute, resolved at import time from installed package metadata via importlib.metadata.version().

  • Single source of truth: the version comes from package metadata (setup.cfg), nothing to keep in sync manually.
  • Falls back to "unknown" when the package is not installed (e.g. running from a plain source checkout), so importing never breaks.
  • Useful for bug reports, runtime diagnostics, and downstream consumers such as sgraph-mcp-server that want to report or check the library version.

Originally authored on the supporting-__version__ branch (Feb 2026); rebased onto current main with a test added.

Test plan

  • New test test_version_attribute asserts the attribute exists and is a non-empty string (passes both installed and uninstalled thanks to the fallback).
  • Full suite: 162 passed.

🤖 Generated with Claude Code

villelaitila and others added 2 commits July 12, 2026 11:26
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@softagram-bot

Copy link
Copy Markdown

Softagram Impact Report for pull/163 (head commit: 4444b07)

TL;DR Changed code files: 2 | Directly impacted code files: 0

⭐ Change Overview

Showing the changed files, dependency changes and the impact - click for full size
(Open in Softagram Desktop for full details)

[]

📄 Full report

Impact Report explained. Give feedback on this report to support@softagram.com

@villelaitila villelaitila reopened this Jul 12, 2026
@villelaitila
villelaitila merged commit da79e51 into softagram:main Jul 12, 2026
1 check 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.

2 participants