<br><br><div class="gmail_quote">On Wed, Oct 26, 2011 at 9:22 AM, Andrea Crotti <span dir="ltr"><<a href="mailto:andrea.crotti.0@gmail.com">andrea.crotti.0@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 10/25/2011 09:59 PM, PJ Eby wrote:<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
If you use the "-m" option to easy_install, the easy-install.pth won't be changed (or even created, if it doesn't exist). Instead, the application scripts will simply add the needed eggs to their path at runtime.<br>
<br>
This is the most flexible approach; the only downside to it is if you just start a Python interpreter, none of the eggs will be on sys.path unless you explicitly pkg_resources.require() them. But for stable app deployment, or even app development (using "setup.py develop" or "setup.py test") it works rather well.<br>
<br>
</blockquote>
<br></div>
Another thing, how should I call a setup.py from python itself?<br>
I don't like too much the idea of using subprocess to pass arguments to something which<br>
is already in python, but it appears that this is how it's done...<br>
<br>
I've also seen doing for example<br>
sys.argv = ['develop']<br>
execfile('setup.py')<br>
<br>
which also doesn't look very nice.<br>
<br>
And last thing, do you have any example of using "-m" and where/how I have to<br>
require the needed packages with pkg_resources?<br></blockquote><div><br></div><div>See the official setuptools documentation links at <a href="http://pypi.python.org/pypi/setuptools#using-setuptools-and-easyinstall">http://pypi.python.org/pypi/setuptools#using-setuptools-and-easyinstall</a></div>
<div><br></div><div>(Note, however, that if your application consists of scripts that you run from a location they were installed to with either setup.py develop or easy_install, then you don't need to require() them; just list them in your setup.py's install_requires.)</div>
<div><br></div><div><br></div><div><br></div></div><br>