如何加快 lxml 的构建/安装速度?
我们使用 Hudson-CI 作为 Python 项目的持续集成服务器,所有这些都使用 Buildout 来管理依赖项。几乎我们所有的项目都使用 lxml
,由于 Buildout,它必须在每次测试运行期间构建/安装,并且由于它需要很长时间,因此减少了我们每天可以运行的构建数量。
使用 Buildout 时有什么方法可以加快 lxml
的构建速度吗?也许可以设置一些环境变量来帮助构建使用服务器上的两个核心?或者可以减少优化量?
We use Hudson-CI for out Continuous Integration server for Python projects, all of which use Buildout to manage dependencies. Almost all our projects use lxml
which, because of Buildout, must be built/installed during each test-run and because it takes so long it reduces the number of builds we can run per day.
Is there any way to speed-up the build of lxml
when using Buildout? Maybe some environment variables can be set to help the build use both cores on the server? Or something to reduce the amount of optimization done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以创建一个构建默认文件并定义一个 Eggs 目录以在多个构建之间共享 Eggs。
这篇文章总结得很好: http://plone.org/documentation/manual/developer-manual/managing-projects-with-buildout/creating-a-buildout-defaults-file
You can create a buildout defaults file and define an eggs-directory to share eggs between multiple builds.
This post sums it up nicely: http://plone.org/documentation/manual/developer-manual/managing-projects-with-buildout/creating-a-buildout-defaults-file
我的解决方案是自己创建一个鸡蛋,并用我的构建来控制该鸡蛋的版本。每次需要升级 lxml 时,我都会重新创建 Egg。您几乎总是可以通过将
import setuptools
放入其setup.py
顶部,然后输入python setup.py bdist_egg 来创建任何 Python 项目的二进制 Egg
。只要您安装 Egg 的机器在二进制方面大致相似(例如都是相同的 Linux 发行版),您就不应该遇到太多麻烦。如果您希望您的 Egg 不依赖于安装在盒子上的 libxml,请阅读使用“静态依赖”构建 lxml 的内容。My solution is to create an egg myself and keep that egg version-controlled with my buildout. I recreate the egg each time I need to upgrade lxml. You can almost always create a binary egg of any Python project by throwing an
import setuptools
into the top of itssetup.py
and then sayingpython setup.py bdist_egg
. And as long as the machines you install the egg on are roughly similar binary-wise (such as all being the same Linux distro), you should not have a terrible lot of trouble. Read up on building lxml with "static deps", as the call them, if you want your egg to not depend on libxml being installed on the box.