summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2020-12-10 11:58:47 -0700
committerCharles Harris <charlesr.harris@gmail.com>2020-12-10 11:58:47 -0700
commitfed2509471e77e0357c5252e69fc6159881f6cb2 (patch)
tree6823964aa7c72e836f6f7defe996b4658856439c /setup.py
parentd06d38c10080ebdbc928e69131116e6a9d45100d (diff)
downloadnumpy-fed2509471e77e0357c5252e69fc6159881f6cb2.tar.gz
BUG: Make sdist use distutils.
If sdist uses setuptools there can be problems, see gh-7127.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 4335e417a..5e8290a7a 100755
--- a/setup.py
+++ b/setup.py
@@ -60,8 +60,10 @@ if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
# We need to import setuptools here in order for it to persist in sys.modules.
-# Its presence/absence is used in subclassing setup in numpy/distutils/core.py,
-# which may not be the most robust design.
+# Its presence/absence is used in subclassing setup in numpy/distutils/core.py.
+# However, we need to run the distutils version of sdist, so import that first
+# so that it is in sys.modules
+import numpy.distutils.command.sdist
import setuptools
# Initialize cmdclass from versioneer
@@ -158,13 +160,14 @@ class concat_license_files():
f.write(self.bsd_text)
-sdist_class = cmdclass['sdist']
-class sdist_checked(sdist_class):
+# Need to inherit from versioneer version of sdist to get the encoded
+# version information.
+class sdist_checked(cmdclass['sdist']):
""" check submodules on sdist to prevent incomplete tarballs """
def run(self):
check_submodules()
with concat_license_files():
- sdist_class.run(self)
+ super().run()
def get_build_overrides():