MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / bump_version

Function bump_version

release.py:5–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4
5def 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
22def release():

Callers 1

releaseFunction · 0.85

Calls 2

readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected