如何加快 lxml 的构建/安装速度?

发布于 2024-10-05 08:08:05 字数 255 浏览 0 评论 0原文

我们使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妞丶爷亲个 2024-10-12 08:08:09

您可以创建一个构建默认文件并定义一个 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

怪我太投入 2024-10-12 08:08:08

我的解决方案是自己创建一个鸡蛋,并用我的构建来控制该鸡蛋的版本。每次需要升级 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 its setup.py and then saying python 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文