[MERGE] Better warnings when pyrex is not available

James Westby jw+debian at jameswestby.net
Mon Jul 16 19:27:38 BST 2007


On (16/07/07 13:10), John Arbash Meinel wrote:
> That sounds like a packaging issue. Pyrex should depend on python-dev if it is
> required to work.

On Debian python-pyrex Recommends: python-all-dev.

This is the correct dependency. pyrex itself doesn't need the header
files to generate the C, but gcc needs them to compile it.

The definition of Recommends: is that only unusual requirements would
mean that it is not installed. However this is subverted by the fact
that Recommends aren't installed by default with many tools. This has
meant that Depends: is more often used for this sort of thing, lessening
the impetus to fix it and make Recommends what they are defined to be.

Whether this means that pyrex should depend on python-all-dev is an open
question, and one that we don't actually control. We could file a
wishlist bug against python-pyrex to change the dependency to get the
maintainer's opinion.

> Do you know a way to detect if python-dev is installed for your machine?
> 
> Preferably something along the lines of 'import foo', rather than
> 'os.subsystem("apt-cache search python-dev")'
> 

Looking at the file list in python2.4-dev there is no file included in
the default PYTHONPATH. This means that os.system is probably the best
you can do, though there would probably be more efficient commands that
that for getting the information. (Though apt-cache isn't the tool here,
dpkg -l is for whether the package is installed, but just looking for
the files, or trying a test compile as autotools would is probably
better for those that don't use packages and those not on Debian based
systems.)

Thanks,

James

-- 
  James Westby   --    GPG Key ID: B577FE13    --     http://jameswestby.net/
  seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256



More information about the bazaar mailing list