Skip to content

[BUG] __version__ in __init__.py (0.5.0) out of sync with pyproject.toml (0.6.3) #25

Closed

Description

@inference-gateway-maintainer

Description

The __version__ attribute in inference_gateway/__init__.py is set to "0.5.0" but pyproject.toml declares version = "0.6.3". These are out of sync.

Impact

  • inference_gateway.__version__ reports the wrong version to consumers
  • Any tooling that reads __version__ (e.g. user-agent headers, telemetry) will report 0.5.0 instead of the actual package version 0.6.3

Location

  • inference_gateway/__init__.py line 37: __version__ = "0.5.0"
  • pyproject.toml line 3: version = "0.6.3"

Suggested Fix

Update __version__ in __init__.py to match pyproject.toml, or better yet, derive it dynamically from the package metadata to prevent future drift.

Activity

  1. added
    bug
    on Jun 6, 2026
  2. added theissue type on Jun 6, 2026
  3. edenreich commented on Jun 6, 2026

    @edenreich
    Contributor

    @claude Can you validate it's true? and if so can you fix it? use /maintainer

  4. claude commented on Jun 6, 2026

    @claude
    Contributor

    Claude finished @edenreich's task in 5m 34s —— View job • fix/issue-25-20260606-1228 • [Create PR ➔](https://github.com/inference-gateway/python-sdk/compare/main...fix/issue-25-20260606-1228?quick_pull=1&title=Issue%20%2325%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%2325%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Version sync fix — issue #25

    Validated: confirmed true. __version__ was out of sync, and I've fixed it.

    Tasks

    • Read issue & gather repo context
    • Validate the version mismatch claim
    • Implement fix (derive __version__ from package metadata)
    • Add regression test
    • Verify (syntax + metadata logic) — see caveat below
    • Commit & open PR

    What was wrong

    • inference_gateway/__init__.py:37 → __version__ = "0.5.0"
    • pyproject.toml:3 → version = "0.6.3"

    Root cause: semantic-release (.releaserc.yaml:52,63) only rewrites and commits pyproject.toml on release — it never touches __init__.py, so the hardcoded __version__ drifts on every release.

    The fix

    Rather than just bumping the literal to 0.6.3 (which would drift again next release), __version__ is now derived from installed package metadata, making pyproject.toml the single source of truth:

    from importlib.metadata import PackageNotFoundError, version
    
    try:
        __version__ = version("inference-gateway")
    except PackageNotFoundError:  # pragma: no cover
        __version__ = "0.0.0"

    Added tests/test_version.py asserting __version__ == importlib.metadata.version("inference-gateway") to guard against future drift.

    Verification

    • python -m py_compile on both files → OK
    • Verified importlib.metadata.version() resolves an installed dist (returned pip's version) and that the PackageNotFoundError fallback fires for an uninstalled name → both paths OK
    • ⚠️ Could not run the full pytest/black suite: dependencies aren't installed in this environment and pip install -e ".[dev]" required an approval that wasn't granted. CI on the PR will run black --check + pytest. If you'd like me to run them here, add pip/task to my allowed tools.

    Maintainer notes

    • No cross-repo impact — SDK-only change, no schemas/openapi.yaml involvement.
    • No [DOCS] ticket needed — this is a fix:, not a feat:/public-surface refactor, and adds no new documented surface.

    PR: #30
    · branch fix/issue-25-20260606-1228

  5. moved this to Todo in 2026on Jun 6, 2026
  6. moved this from Todo to Done in 2026on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions