diff options
| author | Ralf Gommers <ralf.gommers@gmail.com> | 2017-03-09 15:16:36 +1300 |
|---|---|---|
| committer | Ralf Gommers <ralf.gommers@gmail.com> | 2017-03-09 15:16:36 +1300 |
| commit | a574fecc083902b201cea004909bfd6edf5b2c46 (patch) | |
| tree | 23e8b681c4a5e93f614c4690a64f36a8ae47b917 /numpy/distutils/command | |
| parent | 485b099cd4b82d65dc38cb2b28c7119f003c76c4 (diff) | |
| download | numpy-a574fecc083902b201cea004909bfd6edf5b2c46.tar.gz | |
MAINT: better warning message when running build_src from sdist
Addresses comment of @stefanv on gh-7131.
Diffstat (limited to 'numpy/distutils/command')
| -rw-r--r-- | numpy/distutils/command/egg_info.py | 14 |
1 files changed, 11 insertions, 3 deletions
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 |
