[MERGE] Better warnings when pyrex is not available

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Jul 16 22:44:22 BST 2007


>>>>> "john" == John Arbash Meinel <john at arbash-meinel.com> writes:

    john> Vincent Ladeuil wrote:
    >>>>>>> "john" == John Arbash Meinel <john at arbash-meinel.com> writes:
    >> 

    john> Since have finally merged our first Pyrex extension
    john> into bzr, we have now started running into the user
    john> difficulties.

    >> 
    >> Don't forget dev difficulties ;-)
    >> 
    >> I ran into it yesterday, pyrex should be installed, but python-dev
    >> should be installed too or the compilation failed.
    >> 
    >> Vincent
    >> 

    john> That sounds like a packaging issue.  Pyrex should
    john> depend on python-dev if it is required to work.

Hmm, not sure, AIUI pyrex generate the C code but by itself it
may not have to require that all that is needed to *compile* the
code is present. 

    john> Alternatively, we can check for whatever python-dev
    john> provides that we think we need. But I think python from
    john> www.python.org doesn't split out a -dev package.  So it
    john> is really the distributers (debian/ubuntu/etc) that are
    john> breaking up the package, and thus need to make sure it
    john> is available when needed.

    john> Do you know a way to detect if python-dev is installed
    john> for your machine?

I encountered the problem on both edgy and feisty.

I didn't search too far though, the compilation failed on
Python.h not found. So I tried python-dev and that worked on both.

What I thought may be possible was a simple

,----
| #include "Python.h"
| 
| int main(int argc, char *argv[])
| { return 0 ; }
`----

If it can't compile, python-dev or its equivalent is missing.

Speaking of compiling, a compiler and a linker are required too...

We may need a bzr-dev package to carry all those dependencies,
but in the mean time having the test suite not failing if the
pyrex version is not available will be enough.

    john> Preferably something along the lines of 'import foo', rather than
    john> 'os.subsystem("apt-cache search python-dev")'

I'd be surprised if a pure python solution could work.

    Vincent



More information about the bazaar mailing list