跳转到主要内容

包含'boo' Ansible模块的示例Ansible集合

项目描述

ansible-collections.python.dist.boo @ PyPI GitHub Actions CI/CD build status — Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

ansible-collections.python.dist.boo:包含boo模块的Ansible集合

这是一个将Ansible集合(Ansible集合 python.dist)打包为Python分发包的演示。它只包含一个名为booAnsible模块。由于这个分发包和Ansible被安装到同一个(虚拟)环境中,所以可以通过FQDN python.dist.boo从Ansible中访问。以下是您如何以ad-hoc风格调用它的方法

$ PYTHONPATH=`pwd` ansible -m python.dist.boo -a name=Bob localhost
[WARNING]: No inventory was parsed, only implicit localhost is available
localhost | SUCCESS => {
    "changed": false,
    "greeting": "Hello, Bob!",
    "msg": "Greeting Bob completed."
}

或者,安装它,而不是与PYTHONPATH作斗争

$ pip install ansible-collections.python.dist.boo
$ ansible -m python.dist.boo -a name=Bob localhost
[WARNING]: No inventory was parsed, only implicit localhost is available
localhost | SUCCESS => {
    "changed": false,
    "greeting": "Hello, Bob!",
    "msg": "Greeting Bob completed."
}

目的

在发布此项目时,此演示仅适用于由Ansible PR #67093提供的代码。可以通过安装从该PR分支的Ansible来测试它

$ pip install git+https://github.com/sivel/ansible@acd-content-dir

发布到PyPI

此项目实现了针对标记提交自动构建和发布Python分发包到PyPI的功能,针对每推送至master的提交,发布到TestPyPI。所有繁重的工作都由GitHub Actions CI/CD工作流程、pep517 CLI工具和setuptools-scm的组合来完成。

然后可以通过以下方式安装发布的分发包:

$ pip install ansible-collections.python.dist.boo  # for PyPI

$ pip install ansible-collections.python.dist.boo \
      -i https://test.pypi.org/simple/ --pre  # for TestPyPI

如果您通过示例学习,请查看以下文件:

  • pyproject.toml

  • setup.cfg

  • .github/workflows/publish-to-test-pypi.yml

此外,您可以遵循PyPA关于通过GitHub Actions发布软件包的指南,该指南将引导您完成整个过程。

先决条件

Python 3.7+

许可证

此项目中的源代码和文档在GPL v3许可下发布。

项目详细信息


下载文件

下载适用于您的平台文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分发包

ansible-collections.python.dist.boo-0.1.2.tar.gz (20.9 kB 查看哈希)

上传时间

构建分发包

ansible_collections.python.dist.boo-0.1.2-py2.py3-none-any.whl (17.2 kB 查看哈希)

上传时间 Python 2 Python 3

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面