INNER CODE UNIT · Python

read_project_version

hadriansecurity/OpenHack · setup.py:9

def read_project_version() -> str:
    in_project = False
    for line in (ROOT / "pyproject.toml").read_text(encoding="utf-8").splitlines():
        stripped = line.strip()
        if stripped == "[project]":
            in_project = True
            continue
        if in_project and stripped.startswith("["):
            break
        if in_project and stripped.startswith("version"):
            return stripped.split("=", 1)[1].strip().strip('"')
    raise RuntimeError("Unable to read project.version from pyproject.toml")


setup(
    name="openhack",
    version=read_project_version(),
    description=(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…