diff options
Diffstat (limited to 'python/setup.py')
-rw-r--r-- | python/setup.py | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/python/setup.py b/python/setup.py index 4d9dc5c41..479b9f5af 100644 --- a/python/setup.py +++ b/python/setup.py @@ -5,35 +5,20 @@ from distutils.core import setup import re def get_version(): - # Try from config.py. Reads it to avoid to load the shared library. + # Try from version.py. Reads it to avoid to load the shared library. r = re.compile("^__version__ = '(.*)'\n") try: - l = open('libghdl/config.py').read() + l = open('libghdl/version.py').read() m = r.match(l) if m: return m.group(1) except: pass - # Try to extract from configure - r = re.compile('^ghdl_version="(.*)"') - try: - for l in open('../configure').readlines(): - m = r.match(l) - if m: - return m.group(1) - except: - pass raise Exception("Cannot find version") # Extract the version now, as setup() may change the current directory. version=get_version() -class MyBuildPy(distutils.command.build_py.build_py): - def run(self): - with open('libghdl/config.py', 'w') as f: - f.write("__version__ = '{}'\n".format(version)) - super(MyBuildPy, self).run() - setup( name='libghdl', version=version, @@ -46,9 +31,6 @@ write tools like linters. author_email='tgingold@free.fr', url='http://github.com/ghdl/ghdl', license='GPL-2.0-or-later', - cmdclass={ - 'build_py': MyBuildPy - }, package_dir={ 'libghdl': './libghdl' }, |