File size: 431 Bytes
3d99d06
 
 
 
 
 
 
 
 
 
 
 
73fd2fd
 
 
3d99d06
 
73fd2fd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from packaging.version import Version
from pathlib import Path

import toml

c_file = Path(__file__)
pyproject = c_file.parent.parent / "pyproject.toml"


with pyproject.open("r") as f:
    data = toml.load(f)
    version = Version(data["project"]["version"])
    data["project"]["version"] = str(
        Version(f"{version.major}.{version.minor}.{version.micro + 1}")
    )

with pyproject.open("w") as f:
    toml.dump(data, f)