Skip to content

Commit

Permalink
update check_version to support py version ahead of git version
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoffrin committed May 25, 2018
1 parent b2be971 commit 043c4a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions check_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@

print('grg_mpdata version: {}'.format(py_version))

py_version_parts = [int(x) for x in py_version.split('.')]
git_version_parts = [int(x) for x in git_version.split('.')]

if git_version != py_version:
print('git and python versions do not match')
sys.exit(1)
assert(len(py_version_parts) == len(git_version_parts))

for i in range(len(py_version_parts)):
if git_version_parts[i] > py_version_parts[i]:
print('git version is ahead of python version')
sys.exit(1)

if git_version_parts[i] < py_version_parts[i]:
break
2 changes: 1 addition & 1 deletion grg_mpdata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""a package for reading and writing of matpower data files"""

__version__ = '0.0.1'
__version__ = '0.0.2'

# import standard entry points to the code
from grg_mpdata import io
Expand Down

0 comments on commit 043c4a9

Please sign in to comment.