声明依赖项
在setup.py中有一个名为install_requires = [""]的选项:
例如: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',
)
此设置要求cherrypy WSGI服务器库。在
捆绑所有东西Depedencies in PiPy :When your project is installed, either by using EasyInstall,
setup.py install, or setup.py develop, all of the dependencies not
already installed will be located (via PyPI), downloaded, built (if
necessary), and installed.
Any scripts in your project will be
installed with wrappers that verify the availability of the
specified dependencies at runtime, and ensure that the correct
versions are added to sys.path (e.g. if multiple versions have been
installed).
Python Egg distributions will include a metadata file
listing the dependencies
Dependencies that aren’t in PyPI
If your project depends on packages that aren’t registered in PyPI,
you may still be able to depend on them, as long as they are available
for download as:an egg, in the standard distutils sdist format,
a single .py file,
or a VCS repository (Subversion, Mercurial, or Git). You just need to add some URLs to the dependency_links argument to setup().