From eb6be7c4765665724cd12431bfefb050ba0f2d4b Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Thu, 6 Jan 2022 16:51:20 -0700 Subject: [PATCH] MAINT: Raise RuntimeError if setuptools version is too recent. NumPy does not build with setuptools versions greater than '60.0.0'. Check the version when setuptools is imported in setup.py and raise a RuntimeError if the version is too recent. That way we avoid people opening issues when their build fails for that reason. Closes #20692. --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index 703fe79e169..06170df51ac 100755 --- a/setup.py +++ b/setup.py @@ -80,6 +80,10 @@ # so that it is in sys.modules 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__)) # Initialize cmdclass from versioneer from numpy.distutils.core import numpy_cmdclass