Commit 487e5226 authored by Kazuhiko's avatar Kazuhiko Committed by Kirill Smelkov

setup: specify setuptools location explicitly when calling make.

If wendelin.core is built under buildout and setuptools exists only in
buildout environment, 'python setup.py' called inside make will fail
without this change.

    Building 'wendelin.core'
    Running easy_install:
    "/path/to/python2.7" "-c" "import sys; sys.path[0:0] = ['/path/to/setuptools-19.6.2-py2.7.egg']; from setuptools.command.easy_install import main; main()"...
    path_list=['/path/to/setuptools-19.6.2-py2.7.egg']
    ...
    <<< setup.py: os.system('make %s PYTHON="%s"' % (target, sys.executable))
    ...
    make[1]: Leaving directory '/tmp/xxx/wendelin.core-0.6/3rdparty/ccan'
    /path/to/python2.7 setup.py ll_build_ext --inplace
    Traceback (most recent call last):
      File "setup.py", line 18, in <module>
        from setuptools import setup, Extension, Command, find_packages
    ImportError: No module named setuptools
    Makefile:40: recipe for target 'bigfile/_bigfile.so' failed
    make: *** [bigfile/_bigfile.so] Error 1
    error: Setup script exited with error: Failed to execute `make all`

[ @kirr: as a solution we are propagating whole python path via make.

  This should cover both setuptools case, and any other future potential
  "preloaded-by-buildout" egg. ]

/reviewed-on nexedi/wendelin.core!1
parent e6beab19
...@@ -112,7 +112,8 @@ class build_py(_build_py): ...@@ -112,7 +112,8 @@ class build_py(_build_py):
# run `make <target>` # run `make <target>`
def runmake(target): def runmake(target):
err = os.system('make %s PYTHON="%s"' % (target, sys.executable)) err = os.system('make %s PYTHON="%s" PYTHONPATH="%s"' % \
(target, sys.executable, ':'.join(sys.path)))
if err: if err:
raise DistutilsExecError('Failed to execute `make %s`' % target) raise DistutilsExecError('Failed to execute `make %s`' % target)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment