Skip to content

Commit f93cb66

Browse files
committed
doctor for smoke test to run only the latest version from checkout
1 parent ca6402f commit f93cb66

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

GSASII/install/save-versions.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
f' with path {path2repo}')
3131
sys.exit()
3232
commit = g2repo.head.commit
33+
commitm1 = '?'
3334
#ctim = commit.committed_datetime.strftime('%d-%b-%Y %H:%M')
3435
now = dt.datetime.now().replace(
3536
tzinfo=commit.committed_datetime.tzinfo)
@@ -67,15 +68,18 @@
6768
fp.write(f'git_prevtags = []\n')
6869
# get the latest version number
6970
releases = [i for i in g2repo.tags if '.' in i.name]
70-
majors = [i.name.split('.')[0] for i in releases]
71-
major = max([int(i) for i in majors if i.isdecimal()])
72-
minors = [i.name.split('.')[1] for i in releases if i.name.startswith(f'{major}.')]
73-
minor = max([int(i) for i in minors if i.isdecimal()])
74-
minis = [i.name.split('.',2)[2] for i in releases if i.name.startswith(f'{major}.{minor}')]
75-
# mini can be integer, float or even have letters (5.2.1.1rc1)
76-
# for now, ignore anything with letters or decimals
77-
mini = max([int(i) for i in minis if i.isdecimal()])
78-
versiontag = f'{major}.{minor}.{mini}'
71+
if releases:
72+
majors = [i.name.split('.')[0] for i in releases]
73+
major = max([int(i) for i in majors if i.isdecimal()])
74+
minors = [i.name.split('.')[1] for i in releases if i.name.startswith(f'{major}.')]
75+
minor = max([int(i) for i in minors if i.isdecimal()])
76+
minis = [i.name.split('.',2)[2] for i in releases if i.name.startswith(f'{major}.{minor}')]
77+
# mini can be integer, float or even have letters (5.2.1.1rc1)
78+
# for now, ignore anything with letters or decimals
79+
mini = max([int(i) for i in minis if i.isdecimal()])
80+
versiontag = f'{major}.{minor}.{mini}'
81+
else:
82+
versiontag = '?'
7983
fp.write(f'git_versiontag = {versiontag!r}\n')
8084
#
8185
fp.close()

0 commit comments

Comments
 (0)