构建鸡蛋会自动添加到路径中吗?

发布于 2024-10-03 19:35:45 字数 77 浏览 3 评论 0原文

有什么方法可以自动将包从 develop-eggs 添加到 extra-paths 吗?

Is there any way to automagically add packages from develop-eggs to extra-paths?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

陌路黄昏 2024-10-10 19:35:45

使用 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.

夜未央樱花落 2024-10-10 19:35:45

我认为您希望自动将开发鸡蛋添加到鸡蛋中,而不是额外的路径。 extra-paths更适合那些不蛋疼的东西。

如果你有一个 Egg 'foo' 和一个 Egg 'bar' 并且你想为 'foo' 创建一个测试运行器,但它在路径上也需要 'bar' 我会做类似的事情:

[buildout]
extensions = isotoma.extensions.autodevelop
parts = test

[test]
recipe = pbp.recipe.noserunner
eggs = foo
defaults = foo

foo 的 setup.py 会有一个 install_requires 行:

setup(
    name='foo',
    packages=['foo'],
    install_requires=['bar']
    )

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:

[buildout]
extensions = isotoma.extensions.autodevelop
parts = test

[test]
recipe = pbp.recipe.noserunner
eggs = foo
defaults = foo

And the setup.py for foo would have an install_requires line:

setup(
    name='foo',
    packages=['foo'],
    install_requires=['bar']
    )

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.

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