Skip to content

Commit beb53da

Browse files
committed
Change version scheme: use .dev#, increment PATCH of #.#.# by one
when .dev exists. Maybe this is an ok compromise to fit better with PEP 440...
1 parent e185933 commit beb53da

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

dynd/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@ def fix_version(v):
1818
vlst = vlst[:-1] + vlst[-1].split('-')
1919

2020
if len(vlst) <= 3:
21-
v = '.'join('vlst')
21+
v = '.'.join('vlst')
2222
vtup = tuple(int(x) for x in vlst)
2323
else:
2424
# The first 3 numbers are always integer
2525
vtup = tuple(int(x) for x in vlst[:3])
2626
# The 4th one may not be, so trap it
2727
try:
2828
vtup = vtup + (int(vlst[3]),)
29-
# Zero pad the post version #, so it sorts lexicographically
30-
vlst[3] = 'post%03d' % int(vlst[3])
29+
# Zero pad the dev version #, so it sorts lexicographically
30+
vlst[3] = 'dev%03d' % int(vlst[3])
31+
# increment the third version number, so
32+
# the '.dev##' versioning convention works
33+
vlst[2] = str(int(vlst[2]) + 1)
3134
except ValueError:
3235
pass
3336
ver = '.'.join(vlst[:4]) + '+' + '.'.join(vlst[4:])

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,11 @@ def get_outputs(self):
122122
if len(vlst) > 3:
123123
# The 4th one may not be, so trap it
124124
try:
125-
# Zero pad the post version #, so it sorts lexicographically
126-
vlst[3] = 'post%03d' % int(vlst[3])
125+
# Zero pad the dev version #, so it sorts lexicographically
126+
vlst[3] = 'dev%03d' % int(vlst[3])
127+
# increment the third version number, so
128+
# the '.dev##' versioning convention works
129+
vlst[2] = str(int(vlst[2]) + 1)
127130
except ValueError:
128131
pass
129132
ver = '.'.join(vlst[:4]) + '+' + '.'.join(vlst[4:])

0 commit comments

Comments
 (0)