如何开始使用 zc.buildout 和 Distribute?
我想使用构建进行依赖管理,而且我听说分发是管理项目安装的新好方法。
然而,简单的入门教程似乎很少。我见过的最直接的是 Jacob Kaplan-Moss 的 使用 zc 开发 Django 应用程序。 buildout(我的用例是一个 Web 应用程序),但对于链的每个部分的作用以及最佳实践是什么,仍然不是很清楚。
我该如何着手处理这些事情?我想把事情做好。
I want to use buildout for dependency management, and I hear distribute is the new good way to manage installation of your project.
However, easy tutorials to get started seem to be thin on the ground. The most straight forward I've seen is Jacob Kaplan-Moss's Developing Django apps with zc.buildout (my use case is a web application), but that still isn't very clear as to what each piece of the chain does, and what best practices are.
How do I get going on this stuff? I want to do things right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚开始在 http://reinout.vanrees.org/ 记录整个工具链weblog/tags/softwarereleasesseries.html(2010-02-25:仍然需要编写构建和粘贴脚本文章)。
基本的工具链思想:使用 setuptools 来打包你的 python 代码。就像您提到的“开发 django 应用程序”文章一样:每个应用程序都是它自己的包。将代码放在目录中并添加 setup.py。 setup.py 包含版本号、名称、依赖项等,您可以运行它来创建一个 yourproject-0.1.tar.gz 等。
下载所有内容(“easy_install xyz”)很快就会使系统 python 的 site_packages 变得一团糟。可能版本不兼容。 Buildout(例如 virtualenv)为您提供了一个隔离的环境:安装的软件包仅安装在该 virtualenv/buildout 的本地。
混乱第 2 部分:您想要哪个版本?为了获得可重复性和可靠性的任何衡量标准,您必须能够控制您使用的版本(“Django 1.0 还是 1.1?”)。扩建允许这样做。
I've just started documenting the whole toolchain at http://reinout.vanrees.org/weblog/tags/softwarereleasesseries.html (2010-02-25: still got to write the buildout and the pastescript article).
Basic toolchain idea: use setuptools to package your python code. Like the "developing django apps" article you mention: every application is its own package. Put your code in a directory and add a setup.py. The setup.py contains the version number, name, dependencies and so and you can run it to create a yourproject-0.1.tar.gz, for instance.
Downloading everything ("easy_install xyz") quickly makes a total and utter mess of your system python's site_packages. Probably with incompatible versions. Buildout (and for instance virtualenv) give you an isolated environment: installed packages are only installed local to that virtualenv/buildout.
Mess part 2: which versions do you want? To get any measure of repeatability and reliability, you've got to be able to control the versions you use ("Django 1.0 or 1.1?"). Buildout allows that.
您可能已经找到了它,但是您已经查看过构建网站了吗?
You've probably already found it, but have you checked out the buildout website already?