Skip to content

Commit

Permalink
BLD: fix build issue introduced by scikit-learngh-5492.
Browse files Browse the repository at this point in the history
pip installs would fail when compiling against ATLAS.
This is due to a distutils-setuptools issue with monkeypatching that
is triggered if Cython is imported.

See numpy/numpy#7235 for details.
  • Loading branch information
rgommers committed Feb 14, 2016
1 parent 97015de commit 6ffc85e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@

VERSION = sklearn.__version__

from sklearn._build_utils import cythonize

# Optional setuptools features
# We need to import setuptools early, if we want setuptools features,
# as it monkey-patches the 'setup' function
Expand Down Expand Up @@ -178,7 +176,12 @@ def get_numpy_status():
def generate_cython():
cwd = os.path.abspath(os.path.dirname(__file__))
print("Cythonizing sources")
cythonize.main(cwd)
p = subprocess.call([sys.executable, os.path.join(cwd, 'sklearn',
'_build_utils', 'cythonize.py'),
'sklearn'],
cwd=cwd)
if p != 0:
raise RuntimeError("Running cythonize failed!")


def setup_package():
Expand Down
2 changes: 1 addition & 1 deletion sklearn/_build_utils/cythonize.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def process_pyx(fromfile, tofile):
raise Exception('Cython failed')
except OSError:
# There are ways of installing Cython that don't result in a cython
# executable on the path, see gh-2397.
# executable on the path, see scipy issue gh-2397.
r = subprocess.call([sys.executable, '-c',
'import sys; from Cython.Compiler.Main '
'import setuptools_main as main;'
Expand Down

0 comments on commit 6ffc85e

Please sign in to comment.