[Twisted-Python] how to depend (in a setuptools sense) upon Twisted?
Brian Warner
warner at lothar.com
Thu Apr 10 13:57:24 MDT 2008
We've hit a problem in the Tahoe packaging scheme: we kind of want to use the
setuptools install_requires= feature to declare that Tahoe depends upon
Twisted (as well as other things). This allows someone to type "easy_install
allmydata-tahoe" and get everything built for them. It also allows our build
process to download and build anything that the user doesn't already have on
their system, making the build process much easier.
The trouble that we've run into is that various flavors of linux have made
different decisions about which setuptools "distribution" names to use. (Note
that these "distribution names" are the name= arguments to setup(), as
opposed to the python package names like or module names. Distribution names
tend to map to debian package names.)
http://allmydata.org/trac/tahoe/ticket/378 has more details, but basically
Ubuntu is shipping .egg_info data that declares that the "Twisted"
distribution is installed, whereas debian sid is shipping data that says
"Twisted-Core" is installed. Since the setuptools dependency syntax is not
rich enough to provide alternatives, the Tahoe setup.py is forced to choose
between depending upon "Twisted" or upon "Twisted-Core".
The drawback for choosing the opposite of the target platform is that users
on that platform will find their tahoe builds downloading and building the
whole Twisted-8.0.1 tarball, despite having a perfectly functional
twisted-2.5.0 installation already present. This is annoying.
We haven't figured out a good resolution to this problem yet. The best answer
I can think of would be to change the tahoe setup.py script to change the
dependencies that it declares based upon what is currently installed. This
would be a bit wonky but might avoid spurious download+builds. Another answer
might be for the debian 'python-twisted' metapackage (which depends upon
python-twisted-core, python-twisted-web, etc) to provide an .egg-info that
claims to represent the 'Twisted' distribution, but I can imagine problems
with that. Another possibility would be for the Ubuntu python-twisted-core
package to install two .egg-info files, the one for 'Twisted' that they're
already doing, and another for 'Twisted-Core'.. if that were the case, we
could have Tahoe depend upon 'Twisted-Core ' and 'Twisted-Web' and be done
with it.
So, no answers, but we're bringing up the issue in case anyone else has run
into a similar problem, or has some bright ideas on the subject.
cheers,
-Brian
More information about the Twisted-Python
mailing list