Skip to content

Commit

Permalink
get correct version from HISTORY, fixes #214
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosp420 committed Jun 2, 2015
1 parent 07fceb2 commit 5ce3d26
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
9 changes: 7 additions & 2 deletions HISTORY.rst
Expand Up @@ -4,8 +4,13 @@ HISTORY
2.0.0 (2015-01-xx)
++++++++++++++++++

pre-release v2.0.0-alpha-2
++++++++++++++++++++++++++
pre-release v2.0.0-alpha-3 (2015-xx-xx)
+++++++++++++++++++++++++++++++++++++++

- **Getting correct VoSeq version number** from ``HISTORY.rst``.

pre-release v2.0.0-alpha-2 (2015-06-02)
+++++++++++++++++++++++++++++++++++++++

- **Note** that it still needs the ability to generate datasets using
the degenerated translations by Zwick et al, 2012.
Expand Down
15 changes: 14 additions & 1 deletion voseq/voseq/settings/base.py
Expand Up @@ -158,8 +158,21 @@
# so that you can show Google Maps in your voucher pages.
GOOGLE_MAPS_API_KEY = 'fake api key'


# This VoSeq version
VERSION = '2.0.0'
def get_version():
if os.path.isfile('HISTORY.rst'):
with open('HISTORY.rst', 'r') as handle:
lines = handle.readlines()
for line in lines:
if 'xx' in line:
continue
elif 'Version' in line or 'release' in line.lower():
return line
else:
return 'xyz'
VERSION = get_version()


TESTING = False

Expand Down

0 comments on commit 5ce3d26

Please sign in to comment.