|
29 | 29 | from distutils.core import setup
|
30 | 30 |
|
31 | 31 | # Commit hash writing, and dependency checking
|
32 |
| -from nisext.sexts import get_comrec_build, package_check, install_scripts_bat |
| 32 | +from nisext.sexts import (get_comrec_build, package_check, install_scripts_bat, |
| 33 | + read_vars_from) |
33 | 34 | cmdclass = {'build_py': get_comrec_build('nibabel'),
|
34 | 35 | 'install_scripts': install_scripts_bat}
|
35 | 36 |
|
36 |
| -# Get version and release info, which is all stored in nibabel/info.py |
37 |
| -ver_file = os.path.join('nibabel', 'info.py') |
38 |
| -exec(open(ver_file).read()) |
| 37 | +# Get project related strings. |
| 38 | +INFO = read_vars_from(pjoin('nibabel', 'info.py')) |
39 | 39 |
|
40 | 40 | # Prepare setuptools args
|
41 | 41 | if 'setuptools' in sys.modules:
|
|
53 | 53 | pkg_chk = package_check
|
54 | 54 |
|
55 | 55 | # Do dependency checking
|
56 |
| -pkg_chk('numpy', NUMPY_MIN_VERSION) |
| 56 | +pkg_chk('numpy', INFO.NUMPY_MIN_VERSION) |
| 57 | +pkg_chk('six', INFO.SIX_MIN_VERSION) |
57 | 58 | custom_pydicom_messages = {'missing opt': 'Missing optional package "%s"'
|
58 | 59 | ' provided by package "pydicom"'
|
59 | 60 | }
|
60 | 61 | pkg_chk('dicom',
|
61 |
| - PYDICOM_MIN_VERSION, |
| 62 | + INFO.PYDICOM_MIN_VERSION, |
62 | 63 | optional='dicom',
|
63 | 64 | messages = custom_pydicom_messages)
|
64 | 65 |
|
65 | 66 | def main(**extra_args):
|
66 |
| - setup(name=NAME, |
67 |
| - maintainer=MAINTAINER, |
68 |
| - maintainer_email=MAINTAINER_EMAIL, |
69 |
| - description=DESCRIPTION, |
70 |
| - long_description=LONG_DESCRIPTION, |
71 |
| - url=URL, |
72 |
| - download_url=DOWNLOAD_URL, |
73 |
| - license=LICENSE, |
74 |
| - classifiers=CLASSIFIERS, |
75 |
| - author=AUTHOR, |
76 |
| - author_email=AUTHOR_EMAIL, |
77 |
| - platforms=PLATFORMS, |
78 |
| - version=VERSION, |
79 |
| - requires=REQUIRES, |
80 |
| - provides=PROVIDES, |
| 67 | + setup(name=INFO.NAME, |
| 68 | + maintainer=INFO.MAINTAINER, |
| 69 | + maintainer_email=INFO.MAINTAINER_EMAIL, |
| 70 | + description=INFO.DESCRIPTION, |
| 71 | + long_description=INFO.LONG_DESCRIPTION, |
| 72 | + url=INFO.URL, |
| 73 | + download_url=INFO.DOWNLOAD_URL, |
| 74 | + license=INFO.LICENSE, |
| 75 | + classifiers=INFO.CLASSIFIERS, |
| 76 | + author=INFO.AUTHOR, |
| 77 | + author_email=INFO.AUTHOR_EMAIL, |
| 78 | + platforms=INFO.PLATFORMS, |
| 79 | + version=INFO.VERSION, |
| 80 | + requires=INFO.REQUIRES, |
| 81 | + provides=INFO.PROVIDES, |
81 | 82 | packages = ['nibabel',
|
82 | 83 | 'nibabel.externals',
|
83 | 84 | 'nibabel.externals.tests',
|
|
0 commit comments