Skip to content

Commit 0282bb9

Browse files
committed
MAINT: Add wheel requirement on-the-fly, improve comments
1 parent c032138 commit 0282bb9

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

setup.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,27 @@
99
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
1010
"""Build helper."""
1111

12+
import sys
1213
import os
1314

14-
import setuptools
15+
from setuptools import setup
1516

16-
# Commit hash writing
17+
# nisext is nipy setup extensions, which we're mostly moving away from
18+
# get_comrec_build stores the current commit in COMMIT_HASH.txt at build time
19+
# read_vars_from evaluates a python file and makes variables available
1720
from nisext.sexts import get_comrec_build, read_vars_from
1821

1922
INFO = read_vars_from(os.path.join('nibabel', 'info.py'))
2023

24+
# Give setuptools a hint to complain if it's too old a version
25+
# 30.3.0 allows us to put most metadata in setup.cfg
26+
# Should match pyproject.toml
27+
SETUP_REQUIRES = ['setuptools >= 30.3.0']
28+
# This enables setuptools to install wheel on-the-fly
29+
SETUP_REQUIRES += ['wheel'] if 'bdist_wheel' in sys.argv else []
30+
2131
if __name__ == "__main__":
22-
setuptools.setup(name='nibabel',
23-
version=INFO.VERSION,
24-
setup_requires=['setuptools>=30.3.0'],
25-
cmdclass={'build_py': get_comrec_build('nibabel')})
32+
setup(name='nibabel',
33+
version=INFO.VERSION,
34+
setup_requires=SETUP_REQUIRES,
35+
cmdclass={'build_py': get_comrec_build('nibabel')})

0 commit comments

Comments
 (0)