-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuildtest.py
30 lines (28 loc) · 1.08 KB
/
buildtest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
###############################################################################
# Get version specified in appveyor.yml file
appveyor_version = 'appveyor?'
with open('appveyor.yml', 'r') as f:
lines = f.readlines()
for line in lines:
if line.startswith('version:'):
v_long = line.split()[1]
v_parts = v_long.split('.')
appveyor_version = '{}.{}.{}'.format(
v_parts[0], v_parts[1], v_parts[2])
break
###############################################################################
# Get version specified in setup.py file
setup_version = 'setup?'
with open('setup.py', 'r') as f:
lines = f.readlines()
for line in lines:
if line.strip().startswith('version='):
setup_version = line.split("'")[1]
###############################################################################
# Compare
if appveyor_version == setup_version:
print('SUCCESS! Versions match')
else:
print('ERROR! Appveyor version {} dont match setup.py version {}'.format(
appveyor_version, setup_version))
exit(1)