python依赖如何打包_如何打包python模块所依赖的共享对象?

声明依赖项

在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().

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值