Skip to content

Commit ad1c96a

Browse files
committed
Bug fix in setup.py (get version number without requiring dependencies to already be installed)
1 parent c6950a1 commit ad1c96a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@
2424

2525
from setuptools import setup
2626

27-
# Get package version
28-
from pybobyqa import __version__
27+
# Get package version without "import pybobyqa" (which requires dependencies to already be installed)
28+
import os
29+
version = {}
30+
with open(os.path.join('pybobyqa', 'version.py')) as fp:
31+
exec(fp.read(), version)
32+
__version__ = version['__version__']
2933

3034
setup(
3135
name='Py-BOBYQA',

0 commit comments

Comments
 (0)