Skip to content

Commit 654b550

Browse files
committed
use two-part version number -- version is manually modified, build-number is automatically modified
1 parent 478c249 commit 654b550

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

oauth2/_version.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# This is the version of this source code.
22

3-
verstr = "1.4.131"
3+
manual_verstr = "1.4"
4+
5+
6+
7+
auto_build_num = "131"
8+
9+
10+
11+
verstr = manual_verstr + "." + auto_build_num
412
try:
513
from pyutil.version_class import Version as pyutil_Version
614
__version__ = pyutil_Version(verstr)

setup.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@
1010
except EnvironmentError:
1111
pass # Okay, there is no version file.
1212
else:
13-
VSRE = r"^verstr = ['\"]([^'\"]*)['\"]"
14-
mo = re.search(VSRE, verstrline, re.M)
13+
MVSRE = r"^manual_verstr *= *['\"]([^'\"]*)['\"]"
14+
mo = re.search(MVSRE, verstrline, re.M)
1515
if mo:
16-
verstr = mo.group(1)
16+
mverstr = mo.group(1)
1717
else:
1818
print "unable to find version in %s" % (VERSIONFILE,)
1919
raise RuntimeError("if %s.py exists, it must be well-formed" % (VERSIONFILE,))
20+
AVSRE = r"^auto_build_num *= *['\"]([^'\"]*)['\"]"
21+
mo = re.search(AVSRE, verstrline, re.M)
22+
if mo:
23+
averstr = mo.group(1)
24+
else:
25+
averstr = ''
26+
verstr = '.'.join([mverstr, averstr])
2027

2128
setup(name=PKG,
2229
version=verstr,

0 commit comments

Comments
 (0)