Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
254 views
in Technique[技术] by (71.8m points)

Specifying optional dependencies in pypi python setup.py

How do I specify optional dependencies in python's setup.py ?

Here's my stab at specifying an optional dependency for an open source library of mine but it doesn't seem to do much.

https://github.com/od-eon/django-cherrypy/blob/master/setup.py

Specifically extra_requires in this snippet:

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='[email protected]',
    install_requires=['cherrypy-wsgiserver'],
    extra_requires=['newrelic'],
    url='https://github.com/od-eon/django-cherrypy',
)

Suggestions?

question from:https://stackoverflow.com/questions/10572603/specifying-optional-dependencies-in-pypi-python-setup-py

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You've got an incorrect keyword. It's extras_require, and it's supposed to be a dict.

setup(
    name="django-cherrypy",
    ...
    extras_require = {
        'mysterious_feature_x':  ["newrelic"]
    }
)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...