File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1- VERSION = (1 , 2 , 0 , "final " )
1+ VERSION = (1 , 3 , 0 , "alpha " )
22__version__ = VERSION # alias
33
44
55def get_version ():
66 version = "%s.%s" % (VERSION [0 ], VERSION [1 ])
7- if VERSION [2 ]:
7+ # For non-final versions, always include patch version
8+ if VERSION [2 ] or (len (VERSION ) > 3 and VERSION [3 ] != "final" ):
89 version = "%s.%s" % (version , VERSION [2 ])
910 if VERSION [3 :] == ("alpha" , 0 ):
1011 version = "%s pre-alpha" % version
@@ -14,5 +15,9 @@ def get_version():
1415 rev = VERSION [4 ]
1516 except IndexError :
1617 rev = 0
17- version = "%s%s%s" % (version , VERSION [3 ][0 :1 ], rev )
18+ # Don't append revision number if it's 0
19+ if rev == 0 :
20+ version = "%s%s" % (version , VERSION [3 ][0 :1 ])
21+ else :
22+ version = "%s%s%s" % (version , VERSION [3 ][0 :1 ], rev )
1823 return version
You can’t perform that action at this time.
0 commit comments