Unable to merge pyrex code to PQM

John Arbash Meinel john at arbash-meinel.com
Tue Jul 10 15:20:33 BST 2007

Hash: SHA1

Robert Collins wrote:
> On Tue, 2007-07-10 at 08:28 -0500, John Arbash Meinel wrote:
>> We have python versions of every function we have in pyrex.
>> So if you don't want to have pyrex, then it just uses the other.
>> All of my tests have a Feature, so that the test suite will pass, and
>> just tell
>> you "could not run XX tests because of missing feature YY".
>> The *only* thing that fails right now is 'make' because it forces
>> building the
>> extensions (it will fail with an error if it cannot build them). 
> So I think that we should fix make to not error if it cannot build them;
> because that makes it hard to do 'make check' :)
> -Rob

Then again, I want it to fail on the PQM if it cannot build the pyrex extension.

So there is a bit of a difference between what I want to succeed/fail on PQM
versus what I want to fail for a generic developer.

I think PQM should have all dependencies installed, and it should fail if any
of the tests break.

It might also be nice if it could run a version with no dependencies, to make
sure that we still pass even when they are not available.

You do start getting into permutation issues, but I know we've had quite a few
tests which accidentally depended on paramiko (because transport/{sftp,ssh}.py
unconditionally required it).

I'm also not sure how to tell the difference for 'make check' between:
  I can't build the pyrex extension because pyrex is not installed.
  I can't build the pyrex extension because it is broken.

I suppose we could have:

  if `python -c 'import Pyrex'`; then
    python setup.py build -i
    echo "Could not build Pyrex extensions, using slower pure-python version"

That isn't quite enough, since we have the ability to use the .c files, too.

It might be easier to do in setup.py, such that we check:

ext_modules = []
    from Pyrex.Distutils import build_ext
except ImportError:
    if not os.path.isfile('bzrlib/_knit_load_data_c.c'):
        print ("Pyrex is not available, and the pre-built .c "
	       "file is not present.")
	print ("bzr will run correctly, but use slower pure-python "
        print ("Pyrex not available, while bzr will build, "
               "you cannot modify the C extensions.")
        from distutils.command.build_ext import build_ext
        from distutils.extension import Extension

That would at least make it so that if Pyrex is available, then 'make check'
fails correctly if the build fails. (Rather than just ignoring the return value
for 'python setup.py build_ext -i'.)

But again, for the time being, I don't want to merge Pyrex code if it isn't
being tested by the PQM.

Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list