>> zc.buildout+pip+setuptools can do that automatically with entry_points even
>> when their sources end in .py.
>
> I'm a Python newbie. I don't understand what that last sentence means. :)
Heh, no worries!
In a Python package's "setup.py", you can list a series of "entry points".
Entry points describe the high-level morphology of your package. Entry points
include things like:
- Scripts that should be installed to be run from the command-line (bin)
- System-admin scripts (sbin)
- WSGI web applications
- Twisted services
- Django/Zope/Plone add-ons
- And more!
For example, suppose you had in your setup.py:
setup(
'demo',
...
entry_points={
'console_scripts': [
'vote = demo.cmdline.vote',
'tally = demo.cmdline.tally',
],
'z3c.autoinclude.plugin': [
'target = plone',
]
...
)
If a user installs the package "demo", then she'll get:
- bin/vote (generated from demo/cmdline/vote.py)
- bin/tally (generated from demo/cmdline/tally.py)
- And a Zope auto-include plugin for Plone
Nice, huh?
--k