From c123635f310606757ccdc96225b03d9f68e651ca Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Fri, 29 Aug 2025 12:00:00 +0200 Subject: [PATCH 1/4] docs/requirements.txt: Add missing six dependency Signed-off-by: Bernhard Kaindl --- docs/requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index e37b355b..6d7e4af0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,5 @@ +six sphinx sphinx-autodoc-typehints furo -myst_parser \ No newline at end of file +myst_parser From 9167c4f6a50ec08d0e37365a3bc536cb9b1f9eb4 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Fri, 29 Aug 2025 12:00:00 +0200 Subject: [PATCH 2/4] docs: Add blueprint for docs view on render Signed-off-by: Bernhard Kaindl --- render.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 render.yaml diff --git a/render.yaml b/render.yaml new file mode 100644 index 00000000..7d1bc4d8 --- /dev/null +++ b/render.yaml @@ -0,0 +1,21 @@ +services: +- type: web + name: python-libs + runtime: static + repo: https://github.com/xenserver/python-libs + branch: master + buildCommand: | + pip install -r docs/requirements.txt + make -C docs html + staticPublishPath: docs/build/html + buildFilter: + paths: + - docs + - xcp + - CONTRIBUTING.md + - DOCUMENTING.md + - README-Unicode.md + - README.md + previews: + generation: automatic +version: "1" From 8e7e5c0ba019e0ac7bf6c22f763cca710e898a2e Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Fri, 29 Aug 2025 12:00:00 +0200 Subject: [PATCH 3/4] docs, README: Update intro, supported Python versions and badges Signed-off-by: Bernhard Kaindl --- README.md | 28 ++++++++++++++++------------ docs/source/conf.py | 1 + docs/source/index.rst | 24 ++++++++++++++++++------ pyproject.toml | 9 +++------ 4 files changed, 38 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index e55276db..2a4bd562 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,21 @@ -# Common XenServer/XCP-ng Python classes +# XenServer Python libs for Dom0 -[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) -[![](https://img.shields.io/badge/python-2.7_%7C_3.6_%7C_3.7_%7C_3.8_%7C_3.9_%7C_3.10_%7C_3.11+-blue.svg)](https://www.python.org/downloads/) +[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://pre-commit.com) +[![](https://img.shields.io/badge/python-3.6_%7C_3.11_%7C_3.12_%7C_3.13-blue.svg)](https://www.python.org/downloads/) +[![](https://coveralls.io/repos/github/xenserver/python-libs/badge.svg?branch=master)](https://coveralls.io/github/xenserver/python-libs?branch=master) [![codecov](https://codecov.io/gh/xenserver/python-libs/branch/master/graph/badge.svg?token=6WKVLDXJFN)](https://codecov.io/gh/xenserver/python-libs) -[![](https://img.shields.io/badge/License-BSD--2--Cause%20%26%20MIT-brightgreen)](https://github.com/xenserver/python-libs/blob/master/LICENSE) - -The `xcp` directory contains the Common XenServer and XCP-ng Python packages. -They are intented for use in XenServer and XCP-ng Dom0 only and deal with logging, -Hardware/PCI, networking, and other Dom0 tasks. - -The package name is `python-libs` which is also the `rpm` package name in XenServer. -XCP-ng packages it as [xcp-python-libs](https://github.com/xcp-ng-rpms/xcp-python-libs) -([koji](https://koji.xcp-ng.org/packageinfo?packageID=400)). +[![](https://img.shields.io/badge/License-BSD--2--Clause%20%26%20MIT-brightgreen)](https://github.com/xenserver/python-libs/blob/master/LICENSE) +[![](https://img.shields.io/badge/Sphinx-docs-blue.svg)](https://python-libs.onrender.com/) + +The `xcp` directory contains the XenServer Python modules used in Dom0 internally. +They are used in XenServer Dom0 and derivatives to provide them with services around +logging, Hardware-related configuration, network interfaces, and other Dom0 tasks. +The callers of these modules are only other XenServer components residing in Dom0. +A detailed list is in the [Users](#users) section. +The rpm package name in XenServer 8.4 is `python3-xcp-libs`. +XCP-ng packages it currently as +[xcp-python-libs](https://github.com/xcp-ng-rpms/xcp-python-libs) +([koji](https://koji.xcp-ng.org/packageinfo?packageID=400)) instead. ## Test-driven Development (TDD) Model diff --git a/docs/source/conf.py b/docs/source/conf.py index cfcdc4e4..97d79512 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -46,6 +46,7 @@ "myst_parser", ] +myst_heading_anchors = 2 templates_path = ["_templates"] exclude_patterns = [] diff --git a/docs/source/index.rst b/docs/source/index.rst index c4c3da95..b8def097 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,10 +1,22 @@ -.. python-libs documentation master file, created by - sphinx-quickstart on Tue Aug 26 19:05:28 2025. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. +.. python-libs documentation master file -python-libs documentation -========================= +XenServer Python libs for Dom0 +============================== + +.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit + :target: https://pre-commit.com/ + +.. image:: https://coveralls.io/repos/github/xenserver/python-libs/badge.svg?branch=master + :target: https://coveralls.io/github/xenserver/python-libs?branch=master + +.. image:: https://codecov.io/gh/xenserver/python-libs/branch/master/graph/badge.svg?token=6WKVLDXJFN + :target: https://codecov.io/gh/xenserver/python-libs/branch/master + +.. image:: https://img.shields.io/badge/License-BSD--2--Clause%20%26%20MIT-brightgreen + :target: https://opensource.org/licenses/BSD-2-Clause + +.. image:: https://img.shields.io/badge/Sphinx-docs-blue.svg + :target: https://python-libs.onrender.com/ .. toctree:: :maxdepth: 2 diff --git a/pyproject.toml b/pyproject.toml index a16babb3..202f9795 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,8 @@ name = "python-libs" dynamic = ["version"] description = "Common Xenserver Python classes" -requires-python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +# 3.6 is used by XS8.4, 3.11 by XS9, versions in-between are not required +requires-python = ">=3.6, !=3.7.*, !=3.8.*, !=3.9.*, !=3.10.*" license = {file = "LICENSE"} keywords = ["xenserver", "xen-project", "libraries"] authors = [ @@ -20,14 +21,10 @@ readme = "README.md" classifiers = [ "Development Status :: 5 - Production/Stable", "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Topic :: System :: Hardware", "Topic :: System :: Installation/Setup", From 9f543a65b52ac64a17d110ce9fb728ee6dae5f96 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Fri, 29 Aug 2025 12:00:00 +0200 Subject: [PATCH 4/4] docs: Add deploy hook call for updating docs on render Signed-off-by: Bernhard Kaindl --- .github/workflows/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5eddd4c3..aa4adb5d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -92,3 +92,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: pip install coveralls && coveralls --service=github continue-on-error: true # Coveralls.io is currently overloaded + + - name: Render docs if master was updated and the deploy_webhook_url is set + # See https://render.com/docs/deploy-hooks on how to deploy using a webhook: + env: + docs_deploy_branch: refs/heads/master + deploy_webhook_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }} + if: | + env.deploy_webhook_url && github.ref == env.docs_deploy_branch && + matrix.python-version == env.PYTHON_VERSION_USED_FOR_COVERAGE + run: | + curl "$deploy_webhook_url"