diff --git a/HISTORY.rst b/HISTORY.rst index cc92c54b..6d29455d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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. diff --git a/voseq/voseq/settings/base.py b/voseq/voseq/settings/base.py index c19a01c8..793193f2 100644 --- a/voseq/voseq/settings/base.py +++ b/voseq/voseq/settings/base.py @@ -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