<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16735" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=950372612-12122008>I'm coming across a
lot of packages that use the distutils "scripts" keyword to identify scripts
(rather than the console_scripts entry-point). Unfortunately these don't
work with buildout, although they are installed with
easy_install.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=950372612-12122008>I think this should
be a solvable problem with a recipe that extends zc.recipe.egg. For
instance buildbot creates the "buildbot" script. When I create a buildout
with:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008>=====================</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=950372612-12122008>[buildout]<BR>parts
= buildbot</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=950372612-12122008>[buildbot]<BR>recipe
= zc.recipe.egg<BR>interpreter =
python<BR>=====================</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=950372612-12122008>I can then run the
script with</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=950372612-12122008>$ bin/python -c
"import pkg_resources; pkg_resources.working_set.run_script('buildbot',
'buildbot')"</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=950372612-12122008>although I can't
send it any arguments. Also the following hand-crafted script
works:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008>==================</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=950372612-12122008>
#!/usr/bin/python<BR> import sys<BR> <BR>
sys.path[0:0] = [<BR>
'/crypt/home/spascoe/expt/buildbot/eggs/buildbot-0.7.9-py2.5.egg',<BR>
'/crypt/home/spascoe/expt/buildbot/eggs/Twisted-8.1.0-py2.5-linux-i686.egg',<BR>
'/crypt/home/spascoe/expt/buildbot/eggs/zope.interface-3.5.0-py2.5-linux-i686.egg',<BR>
'/usr/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg',<BR>
]</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=950372612-12122008> import
pkg_resources<BR> pkg_resources.working_set.run_script('buildbot',
'buildbot')<BR>==================</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=950372612-12122008>Can anyone think of
a catch that would make this not work in general?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008>Cheers,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008>Stephen.</SPAN></FONT><FONT face=Arial size=2><SPAN
class=950372612-12122008></DIV></SPAN></FONT>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008> </DIV></SPAN></FONT>
<DIV><FONT face=Arial size=2><SPAN
class=950372612-12122008></SPAN></FONT> </DIV>
<DIV align=left><FONT face=Arial size=2>---</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Stephen Pascoe +44 (0)1235
445980</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>British Atmospheric Data
Centre</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Rutherford Appleton
Laboratory</FONT></DIV>
<DIV> </DIV>
<br><p>--
<BR>Scanned by iCritical.
</p>
<br></BODY></HTML>