构建鸡蛋会自动添加到路径中吗?
有什么方法可以自动将包从 develop-eggs
添加到 extra-paths
吗?
Is there any way to automagically add packages from develop-eggs
to extra-paths
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 mr.developer: http://pypi.python.org/pypi/mr.developer
它可以完美地管理发育卵,包括首先将它们添加到发育卵中。
Use mr.developer: http://pypi.python.org/pypi/mr.developer
It manages develop eggs beautifully, including adding them to develop-eggs in the first place.
我认为您希望自动将开发鸡蛋添加到鸡蛋中,而不是额外的路径。 extra-paths更适合那些不蛋疼的东西。
如果你有一个 Egg 'foo' 和一个 Egg 'bar' 并且你想为 'foo' 创建一个测试运行器,但它在路径上也需要 'bar' 我会做类似的事情:
foo 的 setup.py 会有一个 install_requires 行:
autodevelop 扩展将通过查找 setup.py 并将其添加到开发 Egg 列表中,自动在与 buildout.cfg 相同的文件夹中查找源 Egg。 buildout 将使测试器的路径正确,因为它会查看“foo”的依赖关系,并发现“bar”也需要位于路径上。对于任何需要一系列鸡蛋的食谱来说都是如此。
如果您想自动更新鸡蛋列表,请查看 buildout.eggtractor。不过我不推荐这样做。您的构建应该明确说明它正在使用什么鸡蛋(我的意思是直接使用,您只需在我的示例中列出 foo 因为它依赖于 bar),并且您的鸡蛋应该明确说明它们所具有的依赖关系。这样,如果您想从鸡蛋进行部署,则无需做额外的工作。
I think you want to automatically add develop-eggs to eggs, rather than extra-paths. extra-paths is more for things that aren't eggy.
If you have an egg 'foo' and an egg 'bar' and you want to create a testrunner for 'foo' but it needs 'bar' on the path as well i would do something like:
And the setup.py for foo would have an install_requires line:
The autodevelop extension will automatically find source eggs in the same folder as the buildout.cfg by looking for setup.py and adding them to the list of develop eggs. And buildout will get the paths of the tester right because it looks at the dependencies of 'foo' and sees 'bar' needs to be on the path as well. This will be true of any recipe that takes a list of eggs.
If you want to automatically update the list of eggs, look at buildout.eggtractor. I do not recommend this however. Your buildout should be explicit about what eggs it is using (i mean uses directly, you only have to list foo in my example because it depends on bar) and your eggs should be explicit about the dependencies they have. That way if you ever want to deploy from eggs you have no extra work to do.