创建和管理捆绑包包。
bundle的Python项目详细描述
Version: | 1.1.2 |
---|
概要
一个包由几个包组成,可以用作 应用程序和库需求列表。
束用于跟随 公共包组,或具有可选扩展功能的包。
此发行版允许您创建捆绑包,还可以管理 以后安装的捆绑包。
用法
您可以创建一个包并上传到pypi:
>>> b = Bundle("mybundle", description="Cool bundle", version="1.0.0", requires=["pkg1", "pkg2>1.3", "pkg3"], author="George Costanza", author_email="george@vandelay.com", url="http://vandelay.com", license="BSD") >>> b.upload()
注意,这需要包含pypi登录信息的.pypirc。
作为setuptools插件
如果使用bundle作为扩展依赖项,那么可以使用setup.py 管理他们。
如果您有一个名为george的库,并且在^{tt4}中定义了bundle$ 像这样:
from bundle.extensions import Dist # version must be a tuple of at least 2 elements, # e.g. (1, 2), or (1, 2, 6). from george import VERSION defaults = {"author": "George Costanza", "author_email": "art@vandelay.com", "url": "http://vandelay.com", "license": "BSD"} george = Dist("george", VERSION, **defaults) bundles = [ george.Bundle("george-with-django", "Bundle installing george and Django", requires=['django>=1.2']), george.Bundle("george-in-production", "Bundle for george and deps suitable for production", requires=["celery", "psycopg2", "ultrajson"]), ]
有了bundles列表,您现在可以告诉setup.py在哪里找到它, 通过将其添加到bundle.bundlesentrypoints。
在乔治的setup.py中添加:
setup( ... entry_points = { "bundle.bundles": ["george = george.bundles:bundles"] }, )
然后您可以使用register_bundles管理您的包, upload_bundles,和upload_bundles_fix设置命令:
$ python setup.py upload_bundles
注意,您需要运行setup.py develop或setup.py install
首先,使入口点在您之前正确安装
运行bundle命令。你需要有你的pypi证书
在~/.pypirc
文件中正确设置。
命令是:
upload_bundles: | Uploads bundles to PyPI, but only the bundles for which version has not been uploaded before. |
---|---|
register_bundles: | |
Register the bundles at PyPI. ^{tt9}$ will also register, but this is useful if you only need to change metadata without uploading a new version. | |
upload_bundles_fix: | |
Bumps the last version number for all of the bundles and uploads the bundles to PyPI. |
安装
您可以通过python包索引(pypi)安装Bundle
或者来源。
使用pip
安装,:
$ pip install bundle
使用easy_install
,:
$ easy_install bundle
如果你下载了一个源tarball,你可以安装它 执行以下操作:
$ python setup.py build # python setup.py install # as root
获取帮助
错误跟踪程序
如果您有任何建议、错误报告或烦恼,请报告 我们的问题跟踪者在http://github.com/ask/bundle/issues/
许可证
此软件是根据New BSD License
授权的。参见LICENSE
文件位于顶级分发目录中,以获取完整的许可证文本。