importlib.metadata.version() goes stale on editable installs
Using importlib.metadata.version('mypkg') to read a package's version at runtime from a project installed with pip install -e .
importlib.metadata reads version from installed package metadata (the .dist-info directory). For editable installs, that metadata is written ONCE at install time and does not update when you bump the version in pyproject.toml. So importlib.metadata.version('mypkg') happily returns the OLD version string from the dist-info until you re-run pip install -e .. Worst-case bug: a CI job reads version() for a release tag comparison and cuts wrong builds.
After bumping the version in pyproject.toml on an editable install, always re-run pip install -e . to refresh dist-info metadata. Never trust runtime importlib.metadata.version() against an edit made post-install.