python项目的自动语义版本控制
python-semantic-release-pypi的Python项目详细描述
python项目的自动语义版本控制。这是一条Python 执行 semantic-release 斯蒂芬·伯恩曼的JS。如果你觉得这个话题有趣 应该看看他的talk from JSConf Budapest。
安装
pip install python-semantic-release
用法
一般的想法是在提交消息中使用某种标记 指示某些类型的更改。如果提交消息缺少标记,则 忽略。运行版本可以在本地运行,也可以从CI服务运行。
Usage: semantic-release [OPTIONS] COMMAND Options: --major Force major version. --minor Force minor version. --patch Force patch version. --noop No-operations mode, finds the new version number without changing it. --post If used with the changelog command, the changelog will be posted to the release api. --retry Retry the same release, do not bump. --help Show this message and exit.
命令
- version-创建新版本。将更改版本,提交 它和标签。
- publish-在推送到git并上载到之前运行版本 皮皮。
- changelog-生成下一版本的更改日志。
从setup.py
运行命令将以下内容添加到setup.py中,您将能够运行 python setup.py <command>如你所愿 semantic-release <command>。
try:fromsemantic_releaseimportsetup_hooksetup_hook(sys.argv)exceptImportError:pass
配置
配置属于setup.cfg的semantic_release部分 在项目中归档。可以找到有关配置选项的详细信息 在the configuration documentation中。