[Distutils] [zc.buildout] distutils "scripts" keyword
Pascoe, S (Stephen)
stephen.pascoe at stfc.ac.uk
Fri Dec 12 13:34:55 CET 2008
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.
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:
=====================
[buildout]
parts = buildbot
[buildbot]
recipe = zc.recipe.egg
interpreter = python
=====================
I can then run the script with
$ bin/python -c "import pkg_resources;
pkg_resources.working_set.run_script('buildbot', 'buildbot')"
although I can't send it any arguments. Also the following hand-crafted
script works:
==================
#!/usr/bin/python
import sys
sys.path[0:0] = [
'/crypt/home/spascoe/expt/buildbot/eggs/buildbot-0.7.9-py2.5.egg',
'/crypt/home/spascoe/expt/buildbot/eggs/Twisted-8.1.0-py2.5-linux-i686.e
gg',
'/crypt/home/spascoe/expt/buildbot/eggs/zope.interface-3.5.0-py2.5-linux
-i686.egg',
'/usr/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg',
]
import pkg_resources
pkg_resources.working_set.run_script('buildbot', 'buildbot')
==================
Can anyone think of a catch that would make this not work in general?
Cheers,
Stephen.
---
Stephen Pascoe +44 (0)1235 445980
British Atmospheric Data Centre
Rutherford Appleton Laboratory
--
Scanned by iCritical.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20081212/06d61ac8/attachment.htm>
More information about the Distutils-SIG
mailing list