我正在尝试将项目从 virtualenv
移动到 buildout
,但我认为我没有掌握 buildout的整个概念
。我找到的所有教程都在将 buildout
与 Zope
一起使用的情况下讨论了它,我没有使用它,因此看不到如何继续。
我的virtualenv
文件结构如下:
myapp/
app.py
使用 /path/to/venvs/myapp/bin/python/path/to/myapp/script.py
运行。
使用buildout
,我的文件结构是:
myapp/
app.py
bootstrap.py
buildout.cfg
运行 python bootstrap.py
和 bin/buildout
给我这些额外的文件:
myapp/
bin/
buildout
eggs/
setuptools-0.6c12dev_r80622-py2.6.egg
tornado-1.0.1-py2.6.egg
parts/
此时我不确定如何“运行”我的应用。
建议?
最佳答案
以下食谱将把 tornado 安装为一个 egg,并在 bin 目录中创建一个 python 和 myapp 脚本,并使用正确的搜索路径来查找 tornado egg。
[buildout]
parts = python
eggs = tornado
extra-paths = ${buildout:directory}
[python]
recipe = zc.recipe.egg
interpreter = python
eggs = ${buildout:eggs}
entry-points = myapp=app:main
extra-paths = ${buildout:extra-paths}
关于python - 如何从 virtualenv 迁移到 buildout?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3531980/