version-increment
raw| 1 | #!/usr/bin/python3.9 |
| 2 | |
| 3 | import construct |
| 4 | x,y,z = construct.version |
| 5 | z += 1 |
| 6 | |
| 7 | import arrow |
| 8 | date = arrow.utcnow().datetime |
| 9 | |
| 10 | content = f""" |
| 11 | version = ({x},{y},{z}) |
| 12 | version_string = "{x}.{y}.{z}" |
| 13 | release_date = "{date.year}.{date.month:02}.{date.day:02}" |
| 14 | """.lstrip() |
| 15 | |
| 16 | with open("construct/version.py","wt") as f: |
| 17 | f.write(content) |
| 18 | |
| 19 | import os |
| 20 | os.system(f"git commit -a -m 'version uped to {x}.{y}.{z}'") |