Skip to content
This repository was archived by the owner on Aug 15, 2026. It is now read-only.

Fix __version__ drift by deriving from package metadata - #3

Draft
bedardandy wants to merge 1 commit into
mainfrom
cursor/fix-version-metadata-drift-cea8
Draft

bedardandy wants to merge 1 commit into
mainfrom
cursor/fix-version-metadata-drift-cea8

Conversation

@bedardandy

Copy link
Copy Markdown
Owner

Problem

src/maine_forms_engine/__init__.py hardcoded __version__ = "0.5.0" while pyproject.toml declared version = "0.6.0" (which the sibling repos pin as @v0.6.0). Any consumer keyed on __version__ read a stale value; importlib.metadata.version("maine-forms-engine") and maine_forms_engine.__version__ disagreed.

Fix

Derive __version__ from installed distribution metadata via importlib.metadata.version("maine-forms-engine"), with a PackageNotFoundError fallback of "0.6.0" so it can't silently drift from pyproject again.

Tests

  • Added tests/test_version.py asserting __version__ == importlib.metadata.version("maine-forms-engine").
  • Full suite: 150 passed, 2 skipped, 1 xfailed.

Part of a cross-repo review-fix batch; not legal advice.

Open in Web Open in Cursor 

__version__ was hardcoded to 0.5.0 while pyproject declared 0.6.0 (which
downstream siblings pin), so any check keyed on __version__ read a stale
value. Derive it from importlib.metadata with a 0.6.0 fallback, and add a
test asserting it matches the installed distribution version.

Co-authored-by: Andy Bedard <bedardandy@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants