何时使用 buildout:eggs 以及何时通过 zc.recipe.egg 安装?
将鸡蛋安装到建筑中的方法似乎不止一种。
方法一:
[buildout]
...
eggs =
eggname
othereggname
...
方法二:
[buildout]
...
parts = eggs
[eggs]
recipe = zc.recipe.egg
eggs = eggname
= othereggname
两种方法都有效。 (方法 2 的变体是将每个需求作为单独的部分安装。)
这 2 种方法有什么区别?
对于我的项目,我使用 djangorecipe 和 mr.developer 进行构建。
There seem to be more than one way to install eggs into a buildout.
Way 1:
[buildout]
...
eggs =
eggname
othereggname
...
Way 2:
[buildout]
...
parts = eggs
[eggs]
recipe = zc.recipe.egg
eggs = eggname
= othereggname
Both ways work. ( variation on way 2 would be to install each requirement as a separate part. )
What is the difference between these 2 methods?
For my projects, I'm using buildout with djangorecipe and mr.developer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这两种情况下,“eggs=”使这些鸡蛋可供该部分使用,这意味着它们正在被安装。
构建蛋不会得到任何额外的处理。
最大的区别是“recipe = zc.recipe.egg”还尝试为那里定义的所有鸡蛋创建脚本。 (脚本意味着“console_scripts”入口点,而不是旧的 distutils“scripts=”,顺便说一句)
我通常的工作方式:我使用 [buildout] 中的 Egg 来列出我最重要的 Egg(“myproject”)。在 djangorecipe 部分,我基本上有一个“eggs = ${buildout:eggs}”。
还有一个 [console_scripts] 部分与 zc.recipe.egg 配方一起,以明确我想要控制台脚本从那里的鸡蛋中出来。我在里面放了额外的工具,比如 pep8。
In both cases, the "eggs=" makes those eggs available to that part, which means they're getting installed.
The buildout eggs don't get any additional treatment.
The big difference is that "recipe = zc.recipe.egg" ALSO tries to create scripts for all the eggs defined there. (Scripts meaning the "console_scripts" entry points, not the old distutils "scripts=", btw)
The way I normally work: I use the eggs in [buildout] to list my most important eggs ("myproject"). In the djangorecipe part, I have basically an "eggs = ${buildout:eggs}".
And a [console_scripts] part with the zc.recipe.egg recipe to make clear that I want console scripts out of the eggs there. I put extra tools like pep8 in there.