[Distutils] Setuptools/Distribute - using from a "non-installed" location

Daniel Holth dholth at gmail.com
Thu Feb 28 21:53:55 CET 2013


> Sorry, I wasn't clear. I know about that, but I don't know how to set
> up a site directory *before* starting the Python process. Thinking
> about it, I guess I could do the addsitedir thing and then execfile
> setup.py. Put all of that into a -c script. That's probably OK, just a
> bit messy. Particularly as execfile is no longer a builtin.

It is messy but you will probably wind up doing what pip does in
several places, for example:

python -c "import setuptools; __file__=%r;
exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__,
'exec'))" % self.setup_py

https://github.com/pypa/pip/blob/develop/pip/req.py#L655

Why not just reserve a separate virtualenv for building?


More information about the Distutils-SIG mailing list