用于构建Ansible分发的工具
项目描述
antsibull -- Ansible Build Scripts
与Ansible相关的各种构建工具
此处脚本
- antsibull-build - 从组件集合构建Ansible 6+ (文档: https://github.com/ansible-community/antsibull/blob/main/docs/build-ansible.rst)
相关项目包括 antsibull-changelog 和 antsibull-docs,它们各自有自己的仓库(antsibull-changelog 仓库,antsibull-docs 仓库)。目前 antsibull-changelog 是 antsibull 的依赖项。因此,安装 antsibull 时,它所包含的脚本也将可用。
您可以在 Antsibull 更新日志 中找到变更列表。
antsibull 遵循 Ansible 行为准则。
许可协议
此仓库遵循 REUSE 规范。有关具体的许可协议和版权信息,请参阅每个文件中的版权声明。简要来说
- 默认许可协议是 GNU 公共许可证 v3+(《
GPL-3.0-or-later
》)。 src/antsibull/_vendor/shutil.py
包含从 CPython 衍生的代码,许可协议为 Python 2.0 许可协议(《Python-2.0.1
》)。
版本和兼容性
从 0.1.0 版本开始,antsibull 遵循语义版本规范,并在主要版本周期内旨在不破坏 antsibull 命令行 API 的向后兼容性更改。在严重漏洞的安全修复中,我们可能会对此做出例外。
我们明确排除代码兼容性。 antsibull 不应作为库使用。 唯一的例外是与其他 antsibull 项目(目前没有)的潜在依赖关系。如果您想将 antsibull 的某个部分作为库使用,请创建一个 issue,以便我们讨论是否为 Python 代码的 部分 添加稳定的接口。但我们不保证这一定会发生。
开发
安装并运行 nox
来运行所有测试。这就是简单的贡献!nox
将在项目签出的 .nox
目录中创建虚拟环境,并安装运行测试所需的依赖项。
antsibull 依赖于姐妹项目 antsibull-core、antsibull-changelog、antsibull-docutils 和 antsibull-fileutils。默认情况下,nox
将从 Github 安装这些项目的开发版本。如果您与 antsibull 一起修改 antsibull-core、antsibull-changelog、antsibull-docutils 和/或 antsibull-fileutils,则 nox
将在运行测试时自动从 ../antsibull-core
、../antsibull-changelog
、../antsibull-docutils
和 ../antsibull-fileutils
安装项目,如果这些路径存在。您可以通过 OTHER_ANTSIBULL_MODE
环境变量更改此行为
OTHER_ANTSIBULL_MODE=auto
—— 如上所述的默认行为OTHER_ANTSIBULL_MODE=local
—— 从../antsibull-core
、../antsibull-changelog
、../antsibull-docutils
和../antsibull-fileutils
安装项目。如果这些路径不存在,则失败。OTHER_ANTSIBULL_MODE=git
—— 从 Github 主分支安装项目OTHER_ANTSIBULL_MODE=pypi
—— 从 PyPI 安装最新版本
运行特定测试
nox -e test
仅运行单元测试;nox -e lint
运行所有 linter;nox -e formatters
运行isort
和black
;nox -e codeqa
运行flake8
、pylint
、reuse lint
和antsibull-changelog lint
;nox -e typing
运行mypy
。nox -e coverage_release
构建 test ansible 发行版。这很昂贵,因此默认不运行。nox -e check_package_files
运行生成包文件的集成测试。这相当昂贵,因此默认不运行。nox -e coverage
在运行nox -e test coverage_release check_package_files
后显示合并的覆盖率结果;
运行 nox -l
列出所有测试会话。
创建一个更完整的本地开发环境
git clone https://github.com/ansible-community/antsibull-changelog.git
git clone https://github.com/ansible-community/antsibull-core.git
git clone https://github.com/ansible-community/antsibull-docutils.git
git clone https://github.com/ansible-community/antsibull.git
cd antsibull
python3 -m venv venv
. ./venv/bin/activate
pip install -e '.[dev]' -e ../antsibull-changelog -e ../antsibull-core
[...]
nox
创建新版本
- 运行
nox -e bump -- <版本> <发布概要信息>
。这- 在
src/antsibull/__init__.py
中增加软件包版本。 - 创建
changelogs/fragments/<版本>.yml
并添加一个发布概要
部分。 - 运行
antsibull-changelog release
并将更改的文件添加到 Git。 - 提交信息为
发布 <版本>
并运行git tag -a -m 'antsibull <版本>' <版本>
。 - 运行
hatch build --clean
在dist/
中构建 sdist 和 wheel,并清理该目录中的任何旧文件。
- 在
- 运行
git push
到相应的远程仓库。 - 一旦 GitHub 上的 CI 通过,运行
nox -e publish
。这- 运行
hatch publish
将在步骤 1 中生成的 sdist 和 wheel 发布到 PyPI; - 将版本增加到
<版本>.post0
; - 将更改的文件添加到 Git 并运行
git commit -m '发布后版本增加.'
;
- 运行
- 运行
git push --follow-tags
到相应的远程仓库并创建 GitHub 发布。
项目详情
下载文件
下载您平台上的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。