Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 042a659

Browse files
Do not load nrrd package in setup.py (#143)
Prevent importing nrrd package in setup.py because this causes an error about nptyping package missing whilst running setup.py which is in the process of installing the packages. The fix is to read the _version.py file specifically without importing the package.
1 parent 858bfc0 commit 042a659

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
from setuptools import find_packages, setup
44

5-
from nrrd._version import __version__
6-
75
currentPath = os.path.abspath(os.path.dirname(__file__))
86

7+
# Get __version__ from _version.py
8+
__version__ = None
9+
with open(os.path.join(currentPath, 'nrrd/_version.py')) as fh:
10+
exec(fh.read())
11+
912
# Get the long description from the README file
1013
with open(os.path.join(currentPath, 'README.rst')) as fh:
1114
longDescription = fh.read()

0 commit comments

Comments
 (0)