[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

to distribute_setup() or not, that is the question



I've had a few conversations about this between Scott and Jakub, but I think
it's worth opening up to all of debian-python.

Upstream, my flufl.* packages all have the following two lines at the top of
their setup.py files:

-----snip snip-----
import distribute_setup
distribute_setup.use_setuptools()
-----snip snip-----

This is useful when developing the package because it ensures that I'll have a
new enough distribute when doing upstream development.  In fact, if a new
enough distribute is not available, one will be downloaded from the
Cheeseshop.  This works great for platform-independent upstream development.

It does not work so well for packaging on Debian though.  The biggest problem
is that if you build this package on an older version of Debian, you'll end up
downloading distribute from PyPI during the build process, which
understandably is a no no.

Note that if you build the current-in-svn flufl.enum for example, on Wheezy
you'll be fine, because it has a newer distribute than the minimum
requirement.  If you build it on Squeeze however, you get the download.

One partial solution to this is to set the minimum version in the d/control's
B-D so that at least on Squeeze, the build will fail instead of downloading:

Build-Depends: python-all (>= 2.6.6-3~),
               python-setuptools (>= 0.6.19),
               python-pkg-resources,
               python-sphinx (>= 1.0.7+dfsg-1~),
               debhelper (>= 8),
               python3-all,
               python3-setuptools (>= 0.6.19),
               python3-pkg-resources

Given that I really don't want to change upstream, the question then is what
the best approach is for the Debian packaging.

1) Leave it as above because it's okay that the build fails on Squeeze.

2) Add a quilt patch to comment out the distribute_setup lines above, and then
   don't version python*-setuptools.  In my particular case, it doesn't help
   without further modifications, because the package isn't buildable on
   Squeeze anyway (there's no dh sphinxdoc I think).

3) Some combination of the B-D versioning and #2.

4) Or something else (e.g. specify a minimum version in .use_setuptools() that
   gets satisfied on Squeeze.

Scott and Jakub both expressed support for #3, which isn't difficult.  I'm
happy to do that for my own packages, but I think it's worthwhile making sure
everyone's on the same page.

Cheers,
-Barry

Attachment: signature.asc
Description: PGP signature


Reply to: