没有办法做到这一步,但作为一个两步过程很容易。
用途:
python bootstrap.py
./bin/buildout install cython
./bin/cpy bootstrap.py
./bin/cpy ./bin/buildout
的原因,这可能是因为扩建支持一个不起眼的选项“安装”,这没有人挂在嘴边,但你可以使用它,像这样:
[buildout]
parts = deps py # <---- Notice we don't depend on cython here
eggs =
whatever
kdist
nark
kivy # <--- But we do have a module that requires cython to build
develop =
.
lib/nark
lib/kivy-dist
[cython] # <---- By calling ./bin/buildout install cython we trigger this
recipe = zc.recipe.egg:script
parts = cython-py
interpreter = cpy # <--- Which makes our dummy ./bin/cpy
eggs =
cython
pyinstaller
[deps]
recipe = zc.recipe.egg:eggs
eggs = ${buildout:eggs}
[py]
recipe = zc.recipe.egg:script
interpreter = py
eggs = ${buildout:eggs}
关于这种方法的可爱的事情是,第二次运行构建清除bin目录所以在一天结束时,你留下一个bin目录,该目录是l ooks这样的:
$ ls bin/
buildout garden py
没有剩余的包,可能会或可能不会流连在你的virtualenv,后来搞砸。那为什么我们在第一个地方使用buildout?
......当然,如果你想让cython四处游走,juts会将它粘贴到顶层的依赖项中。
你确定Cython安装正确吗?你已经设置了'PYTHONPATH'环境变量来包含Cython模块所在的目录? –
您的意思是在系统级别?这将使这个构建不可能被部署在没有cython的系统上......? –
“系统级”是什么意思? –