[MERGE] Better warnings when pyrex is not available

John Arbash Meinel john at arbash-meinel.com
Sun Jul 15 15:43:19 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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

Erik de Castro Lopo was having difficulties running 'python setup.py install'
because he didn't have Pyrex installed, and we aren't versioning the .c files.

The attached patch changes the 'make' step in the following ways:

1) Pyrex is available has no changes:
% make
building extension modules.
python setup.py build_ext -i
running build_ext
building 'bzrlib._knit_load_data_c' extension
... (gcc lines)


2) Pyrex not available, but the .c files are present (such as in a release):
building extension modules.
python setup.py build_ext -i

The python package 'Pyrex' is not available. If the .c files are available,
they will be built, but modifying the .pyx files will not rebuild them.

running build_ext
building 'bzrlib._knit_load_data_c' extension
... (gcc lines)

3) Pyrex not available, and .c files not present (bzr.dev):
building extension modules.
python setup.py build_ext -i

The python package 'Pyrex' is not available. If the .c files are available,
they will be built, but modifying the .pyx files will not rebuild them.

C extension(s) not found:
   bzrlib/_knit_load_data_c.c
The python versions will be used instead.

running build_ext


I hope this makes it a little more obvious what people can do to fix the
situation, as well as not interrupting them if they don't want them.

Also, do you think we should be adding a 'trace.mutter()' comment during the
try/import section (when trying to load a compiled extension?). We have them
for other missing dependencies like cElementTree and pycurl. Thoughts?


I don't think this needs to be merged into 0.18, since releases should include
the .c files, and not run into this. But it is useful for people running from
bzr.dev.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGmjKGJdeBCYSNAAMRAgAXAJ0aWWthco3MZ2SchgnipwCFmSmTuwCff+zv
JQoh2izzwhVISwd8BsnFlXE=
=00kJ
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: skip_pyrex.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20070715/1fcf860f/attachment.diff 


More information about the bazaar mailing list