()
| 3 | |
| 4 | |
| 5 | def bump_version(): |
| 6 | with open("setup.py") as f: |
| 7 | s = f.read() |
| 8 | m = re.search(r'version="(.*)\.(.*)\.(.*)",', s) |
| 9 | v1, v2, v3 = m.groups() |
| 10 | oldv = "{0}.{1}.{2}".format(v1, v2, v3) |
| 11 | newv = "{0}.{1}.{2}".format(v1, v2, str(int(v3) + 1)) |
| 12 | print("Current version is: {0}, write new version, ctrl-c to exit".format(oldv)) |
| 13 | ans = input(newv) |
| 14 | if ans: |
| 15 | newv = ans |
| 16 | s = s.replace(oldv, newv) |
| 17 | with open("setup.py", "w") as f: |
| 18 | f.write(s) |
| 19 | return newv |
| 20 | |
| 21 | |
| 22 | def release(): |