diff options
author | Elvis Pranskevichus <elvis@magic.io> | 2018-03-30 20:03:45 -0400 |
---|---|---|
committer | Elvis Pranskevichus <elvis@magic.io> | 2018-03-30 20:50:17 -0400 |
commit | 9d59078489dc834d2afe4242bef30c88b739f14d (patch) | |
tree | 2451954250977a45002c8cee5760d8256758f685 /setup.py | |
parent | 3695b486d68b78ceba993efe21fda52f44252cdd (diff) | |
download | immutables-9d59078489dc834d2afe4242bef30c88b739f14d.tar.gz immutables-9d59078489dc834d2afe4242bef30c88b739f14d.zip |
Read version from __init__
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1,15 +1,26 @@ +import os.path import platform import setuptools -VERSION = '0.1' - CFLAGS = ['-O2'] if platform.uname().system != 'Windows': CFLAGS.extend(['-std=c99', '-fsigned-char', '-Wall', '-Wsign-compare', '-Wconversion']) +with open(os.path.join( + os.path.dirname(__file__), 'immutables', '__init__.py')) as f: + for line in f: + if line.startswith('__version__ ='): + _, _, version = line.partition('=') + VERSION = version.strip(" \n'\"") + break + else: + raise RuntimeError( + 'unable to read the version from immutables/__init__.py') + + setuptools.setup( name='immutables', version=VERSION, |