Skip to content

Derive __version__ and API version from package metadata - #43

Merged
adaamko merged 1 commit into
mainfrom
fix/version-alignment
Jul 31, 2026
Merged

adaamko merged 1 commit into
mainfrom
fix/version-alignment

Conversation

@adaamko

@adaamko adaamko commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

pyproject.toml becomes the single version source (issue #36):

  • rulechef.__version__ derives from importlib.metadata.version("rulechef"), with a 0.0.0.dev0 fallback for uninstalled source trees
  • the FastAPI app reports rulechef.__version__ instead of a second hardcoded string
  • tests/test_version.py fails on any future mismatch between the module and pyproject

Dev gotcha found while testing: a stale rulechef.egg-info/ directory (old setuptools editable install) in the project root shadows the real dist-info via the cwd path entry and reports 0.1.0 — deleted locally; it's already gitignored.

  • I certify that I have the right to submit this contribution under the project's Apache-2.0 license.

🤖 Generated with Claude Code

pyproject.toml is now the single version source: rulechef.__version__
reads importlib.metadata and the FastAPI app reuses it. A regression
test compares the module version against pyproject.

Note for dev environments: a stale rulechef.egg-info/ in the project
root shadows the installed metadata and reports the old version —
delete it if the test fails locally.

Closes #36
@adaamko
adaamko merged commit d4414b0 into main Jul 31, 2026
6 checks passed
@adaamko
adaamko deleted the fix/version-alignment branch July 31, 2026 14:03
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.

1 participant