setup: always create a support dir and populate it with a site-packages and add same to the PYTHONPATH, just in case someone is going to do "build", "develop", or "test" or something else which triggers a build
I think there must be a much better solution for this -- probably to fix setuptools #54 and ship our own fork of setuptools and rely on it.
This commit is contained in:
parent
d3b78d86ca
commit
20127ffdf5
30
setup.py
30
setup.py
|
@ -22,17 +22,28 @@ def pylibdir(prefixdir):
|
|||
basedir = os.path.dirname(os.path.abspath(__file__))
|
||||
supportlib = pylibdir(os.path.join(basedir, "support"))
|
||||
|
||||
|
||||
prefixdirs = [] # argh! horrible kludge to work-around setuptools #54
|
||||
for i in range(len(sys.argv)):
|
||||
arg = sys.argv[i]
|
||||
prefixdir = None
|
||||
if arg.startswith("--prefix="):
|
||||
prefixdir = arg[len("--prefix="):]
|
||||
prefixdirs.append(arg[len("--prefix="):])
|
||||
if arg == "--prefix":
|
||||
if len(sys.argv) > i+1:
|
||||
prefixdir = sys.argv[i+1]
|
||||
prefixdirs.append(sys.argv[i+1])
|
||||
|
||||
if prefixdir:
|
||||
if arg.startswith("develop") or arg.startswith("build") or arg.startswith("test"): # argh! horrible kludge to workaround setuptools #17
|
||||
if sys.platform == "linux2":
|
||||
# workaround for tahoe #229 / setuptools #17, on debian
|
||||
sys.argv.extend(["--site-dirs", "/var/lib/python-support/python%d.%d" % (sys.version_info[:2])])
|
||||
elif sys.platform == "darwin":
|
||||
# this probably only applies to leopard 10.5, possibly only 10.5.5
|
||||
sd = "/System/Library/Frameworks/Python.framework/Versions/%d.%d/Extras/lib/python" % (sys.version_info[:2])
|
||||
sys.argv.extend(["--site-dirs", sd])
|
||||
|
||||
if not prefixdirs:
|
||||
prefixdirs.append("support")
|
||||
|
||||
for prefixdir in prefixdirs:
|
||||
libdir = pylibdir(prefixdir)
|
||||
try:
|
||||
os.makedirs(libdir)
|
||||
|
@ -44,15 +55,6 @@ for i in range(len(sys.argv)):
|
|||
pp.append(libdir)
|
||||
os.environ['PYTHONPATH'] = os.pathsep.join(pp)
|
||||
|
||||
if arg.startswith("develop") or arg.startswith("build") or arg.startswith("test"): # argh! horrible kludge to workaround setuptools #17
|
||||
if sys.platform == "linux2":
|
||||
# workaround for tahoe #229 / setuptools #17, on debian
|
||||
sys.argv.extend(["--site-dirs", "/var/lib/python-support/python%d.%d" % (sys.version_info[:2])])
|
||||
elif sys.platform == "darwin":
|
||||
# this probably only applies to leopard 10.5, possibly only 10.5.5
|
||||
sd = "/System/Library/Frameworks/Python.framework/Versions/%d.%d/Extras/lib/python" % (sys.version_info[:2])
|
||||
sys.argv.extend(["--site-dirs", sd])
|
||||
|
||||
try:
|
||||
from ez_setup import use_setuptools
|
||||
except ImportError:
|
||||
|
|
Loading…
Reference in New Issue