【问题标题】:Buildout adding eggs to existing recipe将鸡蛋添加到现有配方中
【发布时间】:2015-06-25 13:15:47
【问题描述】:

Edit2:添加了整个stderr

Edit1: 删除了我假设的答案。更新了问题描述并添加了完整的buildout.cfg 文本

Edit0:固定链接

我正在尝试将一个 Pyramid 项目移植到 Google App Engine。我正在尝试利用 Tobias Rodaebel 的(谢谢!)buildout recipe 来帮助实现这一点。我使用了 pyramid_appengine 脚手架,基本上遵循here 描述的过程。

在我尝试在扩展中添加额外的鸡蛋之前,事情进展得相对顺利。我尝试将pymongo 包添加到./buildout.cfg 文件中,

[buildout]
include-site-packages=false
find-links=http://dist.plone.org/thirdparty/
extends = versions.cfg
versions = versions
update-versions-file = versions.cfg
show-picked-versions = true
develop=src/bkk
parts=bkk
    tests
    service-bkk
ae-sdk-version=1.9.18
ae-runtime=2.7
ae-sdk-location = ${buildout:parts-directory}/google_appengine
ae-extra-paths =
            ${buildout:bin-directory}
        ${buildout:directory}/parts/bkk
        ${buildout:directory}/parts/google_appengine
            ${buildout:directory}/parts/google_appengine/lib/antlr3
            ${buildout:directory}/parts/google_appengine/lib/django
            ${buildout:directory}/parts/google_appengine/lib/fancy_urllib
            ${buildout:directory}/parts/google_appengine/lib/yaml/lib
unzip=true
supervisor-port = 9999
supervisor-conf-dir = ${buildout:directory}/conf
supervisor-log-dir = ${buildout:directory}/var/log
service-conf-templates = ${buildout:directory}/conf.tmpl
project-name=bkk

[bkk]
recipe=rod.recipe.appengine
packages=
    pyramid
    pymongo
    pyramid_jinja2
    repoze.lru
    zope.interface
    zope.deprecation
    venusian
    translationstring
    jinja2
    webob
src=src/bkk
server-script=devappserver
zip-packages=false
use_setuptools_pkg_resources=true
url=https://storage.googleapis.com/appengine-sdks/featured/google_appengine_${buildout:ae-sdk-version}.zip

[bootstrap]
recipe=zc.recipe.egg
eggs=pastescript
extra-paths=${buildout:ae-extra-paths}

[tests]
recipe = zc.recipe.egg
eggs =
    WebTest
    WebOb
    pytest
    pytest-cov
interpreter = python
extra-paths=${buildout:ae-extra-paths}


[supervisor]
recipe = zc.recipe.egg

[mk-supervisor-log-dir]
recipe = collective.recipe.cmd:py
on_install = true
cmds =
    >>> if not os.path.isdir('${buildout:supervisor-log-dir}'):os.makedirs('${buildout:supervisor-log-dir}')

[service-supervisor]
recipe = collective.recipe.template
input = ${buildout:service-conf-templates}/supervisord.conf_tmpl
output = ${buildout:directory}/etc/supervisord.conf
depends = ${mk-supervisor-log-dir:recipe} ${supervisor:recipe}

[service-bkk]
recipe = collective.recipe.template
input = ${buildout:service-conf-templates}/service-${buildout:project-name}.conf_tmpl
output = ${buildout:supervisor-conf-dir}/service-${buildout:project-name}.conf
port=8000
admin_port=8010
api_port=8020
depends = ${service-supervisor:recipe}

并将对应的egg解压到./eggs目录下。我最终收到以下错误:

Develop: '/Users/npk1/Dev/bkk/bkk_gae/bkk/src/bkk'
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'paster_plugins'
  warnings.warn(msg)
warning: no files found matching '*.ini'
warning: no files found matching '*.rst'
warning: no files found matching '*.jpg' under directory 'bkk'
warning: no files found matching '*.pt' under directory 'bkk'
warning: no files found matching '*.txt' under directory 'bkk'
warning: no files found matching '*.mak' under directory 'bkk'
warning: no files found matching '*.mako' under directory 'bkk'
warning: no files found matching '*.js' under directory 'bkk'
warning: no files found matching '*.html' under directory 'bkk'
warning: no files found matching '*.xml' under directory 'bkk'
Uninstalling bkk.
Unused options for buildout: 'ae-runtime' 'include-site-packages' 'unzip'.
Installing bkk.
rod.recipe.appengine: Google App Engine distribution already downloaded.
While:
  Installing bkk.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/Users/npk1/Dev/bkk/bkk_gae/bkk/eggs/zc.buildout-2.3.1-py2.7.egg/zc/buildout/buildout.py", line 1946, in main
    getattr(buildout, command)(args)
  File "/Users/npk1/Dev/bkk/bkk_gae/bkk/eggs/zc.buildout-2.3.1-py2.7.egg/zc/buildout/buildout.py", line 626, in install
    installed_files = self[part]._call(recipe.install)
  File "/Users/npk1/Dev/bkk/bkk_gae/bkk/eggs/zc.buildout-2.3.1-py2.7.egg/zc/buildout/buildout.py", line 1370, in _call
    return f()
  File "/Users/npk1/Dev/bkk/bkk_gae/bkk/eggs/rod.recipe.appengine-2.0.6-py2.7.egg/rod/recipe/appengine/__init__.py", line 380, in install
    self.copy_packages(ws, temp_dir)
  File "/Users/npk1/Dev/bkk/bkk_gae/bkk/eggs/rod.recipe.appengine-2.0.6-py2.7.egg/rod/recipe/appengine/__init__.py", line 290, in copy_packages
    raise KeyError, '%s: package not found.' % p
KeyError: 'pyramid_jinja2: package not found.'

浏览代码,zc.recipe 似乎正在组装它自己的依赖项列表并根据我的项目检查它们,pymongo 没有出现,尽管我可能错了。

有人知道在现有配方中添加新包的过程吗?这是错误的思考方式吗?我将继续尝试消化 buildout 的文档,因为我是该实用程序的新手。

谢谢

【问题讨论】:

  • 请注意,您问题中的两个链接都指向某些旧版本的 zc.recipe.egg 的页面,这与问题不太相关。我还怀疑packages=eggs=zc.recipe 实际上是zc.recipe.egg。所有这一切都让我们很难理解发生了什么:) 你能向我们展示你的完整 buildout.cfg 并告诉我们你想要做什么吗?
  • @Sergey 我很抱歉!不知道那是怎么发生的。修复了链接。其实packages确实是标签。

标签: python google-app-engine pyramid buildout


【解决方案1】:

金字塔有一个cookbook of recipes

这两个秘籍描述了如何在 GAE 上部署 Pyramid。两者都使用与您开始的路径不同的方法提供指导。

Pyramid on Google’s App Engine (using buildout)

Pyramid on Google’s App Engine (using appengine-monkey)

【讨论】:

  • 我实际上是想包含构建链接,但不知何故失败了。在编辑中修复了这个问题。
猜你喜欢
  • 1970-01-01
  • 2017-03-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-03-03
  • 1970-01-01
  • 2017-02-28
  • 2010-10-21
相关资源
最近更新 更多