danish-dynaword / src /bump_version.py
KennethEnevoldsen's picture
moved tests to allow for imports
936cd0c unverified
raw
history blame contribute delete
472 Bytes
from pathlib import Path
import tomlkit
from packaging.version import Version
c_file = Path(__file__)
pyproject = c_file.parent.parent / "pyproject.toml"
with pyproject.open("r") as f:
data = tomlkit.load(f)
version = Version(data["project"]["version"]) # type: ignore
data["project"]["version"] = str( # type: ignore
Version(f"{version.major}.{version.minor}.{version.micro + 1}")
)
with pyproject.open("w") as f:
tomlkit.dump(data, f)