Commit c431ab68 authored by Rafael Monnerat's avatar Rafael Monnerat Committed by Xavier Thompson

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 d5b29fde
......@@ -1174,6 +1174,7 @@ class Buildout(DictMixin):
setuptools=zc.buildout.easy_install.setuptools_pythonpath,
setupdir=os.path.dirname(setup),
setup=setup,
path_list=[],
__file__ = setup,
)).encode())
args = [sys.executable, tsetup] + args
......
......@@ -1047,10 +1047,16 @@ def develop(setup, dest,
undo.append(lambda: os.remove(tsetup))
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(
setuptools=setuptools_pythonpath,
setupdir=directory,
setup=setup,
path_list=extra_path_list,
__file__ = setup,
)).encode())
......@@ -1474,6 +1480,10 @@ runsetup_template = """
import sys
sys.path[:0] = %(setuptools)r, %(setupdir)r
for extra_path in %(path_list)r:
sys.path.insert(0, extra_path)
import os, setuptools
__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