8000 Fix setuptools sdist by charris · Pull Request #7131 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Fix setuptools sdist #7131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions numpy/distutils/command/egg_info.py
Original file line number Diff line number Diff line change
@@ -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 "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charris @rgommers I ran into this issue with one of the skimage tools, which checks to see whether our MANIFEST file is complete. It says to look at gh-7127, but I'm not sure what to look at! Could we point to a likely fix in this message instead? I am happy to make the patch, but was hoping you could point me in the right direction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the tool executing python setup.py sdist, for what it's worth: https://github.com/stefanv/scikit-image/blob/check_sdist/tools/check_sdist.py#L12

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is in this PR: 6770f98

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the skimage setup.py you don't have any sdist handling, so you also have to add something like cmdclass={'sdist': sdist} or (better) the sdist_checked version that numpy and scipy have.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @rgommers, that's very helpful.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're welcome. I'll try to get around to tweaking the warning message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took a while, but addressed in gh-8761

"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.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
15 changes: 14 additions & 1 deletion tools/travis-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
0