如何将脚本添加到构建项目?
我在构建项目中有 setup.py:
from distutils.core import setup
setup(name='',
version='1.0',
author='Denis Kolodin',
author_email='...',
url='...',
scripts = ['scripts/myscript.py'], # The script I want to add to 'bin/' dir
)
为什么构建不将该脚本添加到“bin/”? 我可以使用构建来开发脚本(不是鸡蛋)吗?
我的buildout.cfg:
[buildout]
develop = .
parts = python scripts
[python]
recipe = zc.recipe.egg
interpreter = python
eggs = marketwizard > 0.2.0
jinja2
[scripts]
recipe = z3c.recipe.scripts
I have setup.py in a buildout project:
from distutils.core import setup
setup(name='',
version='1.0',
author='Denis Kolodin',
author_email='...',
url='...',
scripts = ['scripts/myscript.py'], # The script I want to add to 'bin/' dir
)
Why buildout don't add that script to 'bin/'?
Can I develop scripts (not eggs) with buildout?
My buildout.cfg:
[buildout]
develop = .
parts = python scripts
[python]
recipe = zc.recipe.egg
interpreter = python
eggs = marketwizard > 0.2.0
jinja2
[scripts]
recipe = z3c.recipe.scripts
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前,这是一个构建限制:它无法理解 setup.py 中的“script=”。它确实理解setuptools中的“console_scripts=”所谓的“入口点”。谷歌搜索它或查看具有它的现有项目。
我已经修复了构建,使其支持“scripts=”,但尚未被接受包含。
At the moment, this is a buildout limitation: it does not understand the "script=" from your setup.py. It does understand the "console_scripts=" so-called "entry point" from setuptools. Google for it or look at an existing project that has it.
I've got a fix for buildout to make it support "scripts=", but that hasn't been accepted for inclusion yet.
我只是举一个真实的例子。
示例 setup.py
示例 buildout.cfg
注意:
main_function
这是脚本模块中的函数名称(可以是任何名称)。I just make a real example.
Example setup.py
Example buildout.cfg
Note:
main_function
this is function name (could any name) from your script module.