_version.py
python
sha256:a317886dc0496c4af7b285b3e41c86c4c34ea2e79afc63b8829aadb1ada7903f
chore: bump version to 0.2.0rc15 to match musehub#113 fix release
Sonnet 4.6
patch
65 days ago
| 1 | """Single source of truth for the Muse package version. |
| 2 | |
| 3 | All schema_version fields across the codebase read from here rather than |
| 4 | hardcoding a number. The version itself lives in ``pyproject.toml``. |
| 5 | |
| 6 | Editable installs read pyproject.toml directly so that bumping the version |
| 7 | is immediately reflected without reinstalling. Packaged installs (tarballs) |
| 8 | have no pyproject.toml alongside the source and fall through to |
| 9 | importlib.metadata, which reads the dist-info stamped at build time. |
| 10 | The two install modes never interfere with each other. |
| 11 | """ |
| 12 | |
| 13 | import pathlib as _pathlib |
| 14 | import re as _re |
| 15 | |
| 16 | |
| 17 | def _read_version() -> str: |
| 18 | _toml = _pathlib.Path(__file__).parent.parent / "pyproject.toml" |
| 19 | if _toml.is_file(): |
| 20 | _m = _re.search(r'^version\s*=\s*"([^"]+)"', _toml.read_text(), _re.MULTILINE) |
| 21 | if _m: |
| 22 | return _m.group(1) |
| 23 | from importlib.metadata import PackageNotFoundError, version as _meta_version |
| 24 | try: |
| 25 | return _meta_version("muse") |
| 26 | except PackageNotFoundError: |
| 27 | return "0.0.0+dev" |
| 28 | |
| 29 | |
| 30 | __version__: str = _read_version() |
File History
2 commits
sha256:a317886dc0496c4af7b285b3e41c86c4c34ea2e79afc63b8829aadb1ada7903f
chore: bump version to 0.2.0rc15 to match musehub#113 fix release
Sonnet 4.6
patch
65 days ago
sha256:f3b726b50f0aee3622bba751e0a67aa7ae4cf75a798477dbce581940b6a9cf70
feat: migrate invariants cache to .muse/cache/invariants.ms…
Sonnet 4.6
patch
132 days ago