summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-01-27 15:35:27 -0700
committerCharles Harris <charlesr.harris@gmail.com>2016-01-27 15:35:27 -0700
commit2b34f4bf652189e0415d5bf48ef7aa3294302871 (patch)
tree93d408cede70f43ffa8ef3fe26ae9f87170601dd
parentcc2b0495118e4855acfeaea3253abf449f3e91dd (diff)
parent6ae1ff280b3a6c115fe468c79c5cf4f16f998f89 (diff)
downloadnumpy-2b34f4bf652189e0415d5bf48ef7aa3294302871.tar.gz
Merge pull request #7131 from charris/fix-setuptools-sdist
Fix setuptools sdist
-rw-r--r--.travis.yml2
-rw-r--r--numpy/distutils/command/egg_info.py8
-rwxr-xr-xsetup.py2
-rwxr-xr-xtools/travis-test.sh15
4 files changed, 25 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index c14994d0d..ccb182816 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -62,6 +62,8 @@ matrix:
env: USE_WHEEL=1
- python: 3.5
env: USE_WHEEL=1
+ - python: 3.5
+ env: USE_SDIST=1
- python: 2.7
env:
- PYTHONOPTIMIZE=2
diff --git a/numpy/distutils/command/egg_info.py b/numpy/distutils/command/egg_info.py
index b7104de5b..972a27df3 100644
--- a/numpy/distutils/command/egg_info.py
+++ b/numpy/distutils/command/egg_info.py
@@ -1,9 +1,17 @@
from __future__ import division, absolute_import, print_function
+import sys
+
from setuptools.command.egg_info import egg_info as _egg_info
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)
+
# We need to ensure that build_src has been executed in order to give
# setuptools' egg_info command real filenames instead of functions which
# generate files.
diff --git a/setup.py b/setup.py
index a7f66a03d..c68f5a399 100755
--- a/setup.py
+++ b/setup.py
@@ -188,7 +188,7 @@ def check_submodules():
raise ValueError('Submodule not clean: %s' % line)
-from setuptools.command.sdist import sdist
+from distutils.command.sdist import sdist
class sdist_checked(sdist):
""" check submodules on sdist to prevent incomplete tarballs """
def run(self):
diff --git a/tools/travis-test.sh b/tools/travis-test.sh
index 3de1ca78d..6ed51ee91 100755
--- a/tools/travis-test.sh
+++ b/tools/travis-test.sh
@@ -71,7 +71,7 @@ setup_chroot()
# linux32 python setup.py build
# when travis updates to ubuntu 14.04
#
- # Numpy may not distinquish between 64 and 32 bit atlas in the
+ # Numpy may not distinguish between 64 and 32 bit ATLAS in the
# configuration stage.
DIR=$1
set -u
@@ -149,6 +149,19 @@ if [ -n "$USE_WHEEL" ] && [ $# -eq 0 ]; then
pip install nose
popd
run_test
+elif [ -n "$USE_SDIST" ] && [ $# -eq 0 ]; then
+ # use an up-to-date pip / setuptools inside the venv
+ $PIP install -U virtualenv
+ $PYTHON setup.py sdist
+ # Make another virtualenv to install into
+ virtualenv --python=`which $PYTHON` venv-for-wheel
+ . venv-for-wheel/bin/activate
+ # Move out of source directory to avoid finding local numpy
+ pushd dist
+ pip install numpy*
+ pip install nose
+ popd
+ run_test
elif [ -n "$USE_CHROOT" ] && [ $# -eq 0 ]; then
DIR=/chroot
setup_chroot $DIR