Skip to content

Commit

Permalink
find version in setup.py the same way as in __init__.py (iiasa#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
gidden committed Nov 21, 2018
1 parent b1fee55 commit 26cc08f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@
from __future__ import print_function

import os
import re
import shutil

from setuptools import setup, find_packages
from setuptools.command.install import install

fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'message_ix', 'model', 'version.gms')
with open(fname) as f:
s = str(f.readlines())

INFO = {
'version': '1.1.0',
}
VERSION = '{}.{}.{}'.format(
re.search('VERSION_MAJOR "(.+?)"', s).group(1),
re.search('VERSION_MINOR "(.+?)"', s).group(1),
re.search('VERSION_PATCH "(.+?)"', s).group(1),
)


class Cmd(install):
Expand Down Expand Up @@ -72,7 +79,7 @@ def main():
}
setup_kwargs = {
"name": "message_ix",
"version": INFO['version'],
"version": VERSION,
"description": 'The MESSAGEix Integrated Assessment Model',
"author": 'Daniel Huppmann, Matthew Gidden, Volker Krey, '
'Oliver Fricko, Peter Kolp',
Expand Down

0 comments on commit 26cc08f

Please sign in to comment.