|
17 | 17 | # update it when the contents of directories change.
|
18 | 18 | if os.path.exists('MANIFEST'): os.remove('MANIFEST')
|
19 | 19 |
|
20 |
| -from distutils.core import setup |
21 |
| - |
22 |
| -# For some commands, use setuptools. |
| 20 | +# For some commands, use setuptools. |
23 | 21 | if len(set(('develop', 'bdist_egg', 'bdist_rpm', 'bdist', 'bdist_dumb',
|
24 | 22 | 'bdist_wininst', 'install_egg_info', 'egg_info', 'easy_install',
|
25 | 23 | )).intersection(sys.argv)) > 0:
|
26 |
| - # setup_egg imports setuptools setup, thus monkeypatching distutils. |
27 |
| - from setup_egg import extra_setuptools_args |
| 24 | + # setup_egg imports setuptools setup, thus monkeypatching distutils. |
| 25 | + import setup_egg |
28 | 26 |
|
29 |
| -# extra_setuptools_args can be defined from the line above, but it can |
30 |
| -# also be defined here because setup.py has been exec'ed from |
31 |
| -# setup_egg.py. |
32 |
| -if not 'extra_setuptools_args' in globals(): |
33 |
| - extra_setuptools_args = dict() |
| 27 | +from distutils.core import setup |
34 | 28 |
|
35 | 29 | # Python 2 to 3 build
|
36 |
| -try: |
37 |
| - from distutils.command.build_py import build_py_2to3 as build_py |
38 |
| -except ImportError: |
39 |
| - # 2.x |
40 |
| - from distutils.command.build_py import build_py |
41 |
| - |
| 30 | +from nisext.py3builder import build_py |
| 31 | +# Commit hash writing, and dependency checking |
42 | 32 | from nisext.sexts import get_comrec_build, package_check
|
43 | 33 | cmdclass = {'build_py': get_comrec_build('nibabel', build_py)}
|
44 | 34 |
|
|
49 | 39 | # Do dependency checking
|
50 | 40 | package_check('numpy', NUMPY_MIN_VERSION)
|
51 | 41 | package_check('dicom', PYDICOM_MIN_VERSION, optional=True)
|
| 42 | +extra_setuptools_args = {} |
52 | 43 | if 'setuptools' in sys.modules:
|
53 |
| - extra_setuptools_args['extras_require'] = dict( |
54 |
| - doc='Sphinx>=0.3', |
55 |
| - test='nose>=0.10.1', |
56 |
| - nicom = 'dicom>=' + PYDICOM_MIN_VERSION) |
| 44 | + extra_setuptools_args = dict( |
| 45 | + tests_require=['nose'], |
| 46 | + test_suite='nose.collector', |
| 47 | + zip_safe=False, |
| 48 | + extras_require = dict( |
| 49 | + doc='Sphinx>=0.3', |
| 50 | + test='nose>=0.10.1', |
| 51 | + nicom = 'dicom>=' + PYDICOM_MIN_VERSION) |
| 52 | + ) |
57 | 53 |
|
58 | 54 | def main(**extra_args):
|
59 | 55 | setup(name=NAME,
|
|
0 commit comments