MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / read_package_version

Function read_package_version

scripts/sync_plugin_manifests.py:12–18  ·  view source on GitHub ↗

Read the package version string from pyproject.toml.

(pyproject_path: Path | None = None)

Source from the content-addressed store, hash-verified

10
11
12def read_package_version(pyproject_path: Path | None = None) -> str:
13 """Read the package version string from pyproject.toml."""
14 text = (pyproject_path or ROOT / "pyproject.toml").read_text(encoding="utf-8")
15 match = re.search(r'^version\s*=\s*"([^"]+)"', text, re.MULTILINE)
16 if not match:
17 raise ValueError("Could not find version in pyproject.toml")
18 return match.group(1)
19
20
21def sync_manifests(version: str | None = None, root: Path | None = None) -> list[Path]:

Calls

no outgoing calls