[lxml-dev] lxml now ships with Pyrex included
Hi, as lxml will most likely continue to depend on a non-release version of pyrex for quite a while, I decided to add the patched Pyrex version to the source distribution. It is part of lxml's SVN checkout, I only add the Pyrex directory to the project root in my release script. The setup.py script simply prepends that directory to the Python path so that the modified Pyrex is used automatically. This has a couple of consequences for users: * Distributors that want to apply patches to the lxml sources no longer have to check out Pyrex themselves and can shrink their build scripts to a simple run of setup.py. * Users can now modify and build lxml distributions without globally installing a patched Pyrex. They can also run "make clean" if something went wrong, without breaking the build afterwards, even if they have an unpatched Pyrex installed in their site-packages. I hope this helps in making lxml easier to build. Note that SVN users still have to install our Pyrex version, but I think that's acceptable. Now that this works, we could also remove the .c files to shrink the source distribution. Any objections? Stefan
Stefan Behnel wrote:
Now that this works, we could also remove the .c files to shrink the source distribution. Any objections?
Yes, I object to removing the .c files. the .c files allow a guaranteed sure build of lxml. There is absolutely no doubt which version of Pyrex is used here, as that's under our own control (otherwise there might be interesting import issues in play). Also important, it allows tools like easy_install to download and compile lxml fully automatically (such as in a buildout). I use this feature all the time. I don't know whether that can work if a Pyrex is bundled - the setup.py would likely become more complicated to account for PYTHONPATH manipulation, and that might possibly break easy_install. Regards, Martijn
Hi, Martijn Faassen wrote:
Stefan Behnel wrote:
Now that this works, we could also remove the .c files to shrink the source distribution. Any objections?
Yes, I object to removing the .c files. the .c files allow a guaranteed sure build of lxml. There is absolutely no doubt which version of Pyrex is used here, as that's under our own control (otherwise there might be interesting import issues in play).
I won't argue for it and it's fine to leave them in. It's only some 230K difference in the tgz (50% more), so if that prevents us from running into install problems ...
Also important, it allows tools like easy_install to download and compile lxml fully automatically (such as in a buildout). I use this feature all the time. I don't know whether that can work if a Pyrex is bundled - the setup.py would likely become more complicated to account for PYTHONPATH manipulation, and that might possibly break easy_install.
No changes in setup.py are required. I only added Pyrex' package directory to the lxml root directory and setup.py imports it nicely from there. I tested that it builds with setuptools, so I don't quite see where this could interfere with buildout or easy_install. Stefan
participants (2)
-
Martijn Faassen
-
Stefan Behnel