Commit 8a24e3b7 authored by Rafael Monnerat's avatar Rafael Monnerat Committed by Xavier Thompson

[fixup] Expand the sys.path with entries from PYTHONEXTRAPATH

This commit is part of fixup the "Add setup-eggs option in zc.recipe.egg:develop."
parent 4734858b
...@@ -1450,6 +1450,7 @@ class Buildout(DictMixin): ...@@ -1450,6 +1450,7 @@ class Buildout(DictMixin):
os.write(fd, (zc.buildout.easy_install.runsetup_template % dict( os.write(fd, (zc.buildout.easy_install.runsetup_template % dict(
setupdir=os.path.dirname(setup), setupdir=os.path.dirname(setup),
setup=setup, setup=setup,
path_list=[],
__file__ = setup, __file__ = setup,
)).encode()) )).encode())
args = [sys.executable, tsetup] + args args = [sys.executable, tsetup] + args
......
...@@ -1220,9 +1220,15 @@ def develop(setup, dest, ...@@ -1220,9 +1220,15 @@ def develop(setup, dest,
undo.append(lambda: os.remove(tsetup)) undo.append(lambda: os.remove(tsetup))
undo.append(lambda: os.close(fd)) undo.append(lambda: os.close(fd))
extra_path = os.environ.get('PYTHONEXTRAPATH')
extra_path_list = []
if extra_path:
extra_path_list = extra_path.split(os.pathsep)
os.write(fd, (runsetup_template % dict( os.write(fd, (runsetup_template % dict(
setupdir=directory, setupdir=directory,
setup=setup, setup=setup,
path_list=extra_path_list,
__file__ = setup, __file__ = setup,
)).encode()) )).encode())
...@@ -1673,6 +1679,10 @@ import sys ...@@ -1673,6 +1679,10 @@ import sys
sys.path.insert(0, %%(setupdir)r) sys.path.insert(0, %%(setupdir)r)
sys.path[0:0] = %r sys.path[0:0] = %r
for extra_path in %%(path_list)r:
sys.path.insert(0, extra_path)
import os, setuptools import os, setuptools
__file__ = %%(__file__)r __file__ = %%(__file__)r
......
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