.. image:: https://secure.travis-ci.org/cosent/cosent.buildtools.png
:target: http://travis-ci.org/cosent/cosent.buildtools
Introduction
============
Cosent.buildtools allows you to release a buildout with multiple development eggs in one go.
The intent is, to offer at the buildout/project level, the convenience that `jarn.mkrelease`_ offers at the individual egg level.
Cosent.buildtools will:
* Generate a new version number for any development eggs with unreleased changes; also for any RC released eggs if you're doing a 'final' release.
* Commit, tag and release all changed development eggs.
* Update the buildout version.txt to reflect the newly released eggs.
* Generate and store a new version number for the buildout itself.
* Tag all development eggs with the new buildout number as well.
* Commit, tag and release the buildout itself.
Assumptions/requirements/limitations
------------------------------------
* You have a buildout with multiple development eggs
* You have mr.developer installed, and use it to manage development status of eggs
* You have a [versions] section in the buildout configuration
* The buildout itself is a python egg with a setup.py version number
* The buildout and all development eggs are under git version control
* The versioning algorithm understands only a very simple versioning scheme, like 0.2, 0.2dev and 0.2rc4. See below.
This suites the release patterns used at `Cosent`_. YMMV.
Installation
============
Add the following to your buildout.cfg::
[buildout]
parts += buildtools
[buildtools]
recipe = zc.recipe.egg
eggs = cosent.buildtools
This will install two scripts: buildtool, and bumpversion.
buildtool
=========
*buildtool status* checks your complete working tree for changes::
buildtool status
List uncommitted changes in all working trees.
*buildtool cook* prepares your eggs for release::
buildtool [-n] [-f] [-s] [-c] cook
Bump version, commit and tag all eggs that have unreleased commits.
[-n] dry run, no changes
[-f] force a new release, even if no changes
[-s] skip sanity check, accept uncommitted changes
[-c] create RC (0.1->0.2rc1) instead of final version (0.1->0.2)
*buildtool dist* releases all eggs and the buildout itself in one go::
buildtool [-n] [-f] [-s] [-c] <-v versions> <-d dist> [-b name] dist
Release and upload all changed eggs to distserver (via jarn.mkrelease).
Update and commit buildout versionsfile to reflect the new egg versions.
Tag the buildout and tag all eggs with the buildout version tag.
Push all commits and tags in all eggs and the buildout.
[-n] dry run, no changes
[-f] force a new release, even if no changes
[-s] skip sanity check, accept uncommitted changes
[-c] create RC (0.1->0.2rc1) instead of final version (0.1->0.2)
<-v versions> path to buildout versions.txt file
<-d dist> pypirc dist location to use for uploading eggs
[-b name] name of current buildout, defaults to dirname
*buildtool git* runs a git command on all eggs and on the buildout::
buildtool git <gitargs>
Run 'git gitargs' on all development eggs, and on the buildout itself.
Insert '--' or use extra quoting to escape arguments passed to git.
Examples:
bin/buildtool git -- log --oneline HEAD^^..
bin/buildtool git "commit -a -m 'your commit message'"
Example run::
bin/buildtool git tag # list tags
bin/buildtool git whatchanged sometag # list changes since last release
bin/buildtool status # check that we're clean
bin/buildtool cook # prepare release
# the actual release
bin/buildtool -v versions.txt -d your.server:/var/pypi dist
Contrary to jarn.mkrelease, buildtool expects clean sandboxes. It will abort if it encounters uncommitted work, unless you use the -s (--skip-checks) switch.
Specifying default arguments
----------------------------
You can specify default settings by initializing a 'defaults' dictionary, and then feed the defaults as an argument to the script. Due to some script generation snafu, you'll have to specify a different script name for this to work.
If you modify your buildout like this::
[buildtools]
recipe = zc.recipe.egg
eggs = cosent.buildtools
scripts = buildtool=release
initialization = defaults = {
'versions-file':'versions.txt',
'dist-location':'pypi',
'build-name': 'cosent.buildtools'}
arguments = defaults
Where of course you'll need to supply your own dist-location, for example 'your.server.net:/var/www/packages/local' and set build-name to your own project name. You can use any dist-location jarn.mkrelease accepts, including aliases defined in your .pypirc.
You will now have a separate ``bin/release`` script that is set up with the defaults, which means you can simply run::
bin/release status
bin/release cook
bin/release dist
bumpversion
===========
Enable automated version numbering. Handy for use in conjunction with `jarn.mkrelease`_ which breaks if the number isn't incremented.
This functionality is included in the buildtool wrapper, but also available as standalone utility.
To bump a version to the next release candidate::
$ bin/bumpversion ./src/some.egg/setup.py
To bump a version to the next final release::
$ bin/bumpversion --final ./src/some.egg/setup.py
Version algorithm is as follows:
* rc (release candidate)::
2.7 -> 2.8rc1
2.8dev -> 2.8rc1
2.8rc1 -> 2.8rc2
* final (actual release)::
2.7 -> 2.8
2.8dev -> 2.8
2.8rc2 -> 2.8
The algorithm is dumb and only understands major.minor + "rc|dev" + seq.
Different version numbers like 2.8b3, 2.8-fix2 will cause breakage.
.. _Cosent: http://cosent.nl
.. _jarn.mkrelease: http://pypi.python.org/pypi/jarn.mkrelease
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
资源分类:Python库 所属语言:Python 资源全名:cosent.buildtools-1.0.rc12.zip 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
cosent.buildtools-1.0.rc12.zip (25个子文件)
cosent.buildtools-1.0.rc12
.travis.yml 116B
PKG-INFO 8KB
README.rst 6KB
README.txt 6KB
cosent.buildtools.egg-info
PKG-INFO 8KB
requires.txt 25B
not-zip-safe 1B
SOURCES.txt 699B
entry_points.txt 113B
top_level.txt 7B
namespace_packages.txt 7B
dependency_links.txt 1B
cosent
__init__.py 244B
buildtools
buildtool.py 13KB
bumpversion.py 3KB
tests
test_bumpversion.py 3KB
__init__.py 2B
test_buildtool.py 4KB
_dummysetup.py 1KB
__init__.py 2B
versions.txt 41B
setup.cfg 59B
setup.py 1KB
Makefile 568B
buildout.cfg 846B
共 25 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功