From a574fecc083902b201cea004909bfd6edf5b2c46 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Thu, 9 Mar 2017 15:16:36 +1300 Subject: MAINT: better warning message when running build_src from sdist Addresses comment of @stefanv on gh-7131. --- numpy/distutils/command/egg_info.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'numpy/distutils/command') diff --git a/numpy/distutils/command/egg_info.py b/numpy/distutils/command/egg_info.py index 7176f9212..18673ece7 100644 --- a/numpy/distutils/command/egg_info.py +++ b/numpy/distutils/command/egg_info.py @@ -8,9 +8,17 @@ class egg_info(_egg_info): def run(self): if 'sdist' in sys.argv: import warnings - warnings.warn("`build_src` is being run, this may lead to missing " - "files in your sdist! See numpy issue gh-7127 for " - "details", UserWarning, stacklevel=2) + import textwrap + msg = textwrap.dedent(""" + `build_src` is being run, this may lead to missing + files in your sdist! You want to use distutils.sdist + instead of the setuptools version: + + from distutils.command.sdist import sdist + cmdclass={'sdist': sdist}" + + See numpy's setup.py or gh-7131 for details.""") + warnings.warn(msg, UserWarning, stacklevel=2) # We need to ensure that build_src has been executed in order to give # setuptools' egg_info command real filenames instead of functions which -- cgit v1.2.1