diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2022-02-01 11:50:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-01 11:50:57 -0700 |
commit | b6e6b838f1dd5f689ef8bac7a40ee814be7cd362 (patch) | |
tree | 0dcedb9777ac5187807d255a163a6448b3081f38 | |
parent | 5e2c1e8afcc446bc17e78f4ead1d9bd03e841ef9 (diff) | |
parent | dedc0954e7fabd6059b4c3e233ddc1028e4d7361 (diff) | |
download | numpy-b6e6b838f1dd5f689ef8bac7a40ee814be7cd362.tar.gz |
Merge pull request #20963 from ahesford/its-a-setup
MAINT: be more tolerant of setuptools>=60
-rwxr-xr-x | setup.py | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -86,9 +86,16 @@ if os.path.exists('MANIFEST'): import numpy.distutils.command.sdist import setuptools if int(setuptools.__version__.split('.')[0]) >= 60: - raise RuntimeError( - "Setuptools version is '{}', version < '60.0.0' is required. " - "See pyproject.toml".format(setuptools.__version__)) + # setuptools >= 60 switches to vendored distutils by default; this + # may break the numpy build, so make sure the stdlib version is used + try: + setuptools_use_distutils = os.environ['SETUPTOOLS_USE_DISTUTILS'] + except KeyError: + os.environ['SETUPTOOLS_USE_DISTUTILS'] = "stdlib" + else: + if setuptools_use_distutils != "stdlib": + raise RuntimeError("setuptools versions >= '60.0.0' require " + "SETUPTOOLS_USE_DISTUTILS=stdlib in the environment") # Initialize cmdclass from versioneer from numpy.distutils.core import numpy_cmdclass |