如何在python的setup.py
?
这是我为我的开源库指定可选依赖项的尝试,但它似乎没有做太多。
https://github.com/od-eon/django-cherrypy/blob/master/setup.py
此代码段中的extra_requires
具体为:{/ p>
setup(
name='django-cherrypy',
version='0.1',
packages=packages,
license='LICENSE',
description='cherrypy, running under django',
long_description=open('README.md').read(),
author='Calvin Cheng',
author_email='calvin@calvinx.com',
install_requires=['cherrypy-wsgiserver'],
extra_requires=['newrelic'],
url='https://github.com/od-eon/django-cherrypy',
)
建议?
答案 0 :(得分:31)
你的关键字不正确。它是extras_require
和it's supposed to be a dict.
setup(
name="django-cherrypy",
...
extras_require = {
'mysterious_feature_x': ["newrelic"]
}
)