From 66164773e060124fcba619657a4239fb2a524e00 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 18 Aug 2023 00:17:06 +0000 Subject: [PATCH] Handle new upstream manpage building method --- ansible-core.spec | 8 ++------ build_manpages.py | 27 --------------------------- 2 files changed, 2 insertions(+), 33 deletions(-) delete mode 100644 build_manpages.py diff --git a/ansible-core.spec b/ansible-core.spec index ca11d6c..2e4ba39 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -158,13 +158,9 @@ echo 'python%{python3_pkgversion}-argcomplete' %pyproject_wheel # Build manpages +mkdir -p docs/man/man1 +%{python3} packaging/cli-doc/build.py man --output-dir docs/man/man1 -# XXX: This should be removed once upstream provides a proper way to build -# manpages from source. -# See https://github.com/ansible/ansible/issues/80368 -# and the discussion in https://github.com/ansible/ansible/pull/80372 -# for more details. -PYTHONPATH="$(pwd)/packaging" %{python3} %{S:2} %if %{with argcomplete} # Build shell completions diff --git a/build_manpages.py b/build_manpages.py deleted file mode 100644 index e733cd2..0000000 --- a/build_manpages.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) Ansible Project -# -# SPDX-License-Identifier: GPL-3.0-or-later - -from pathlib import Path - -from pep517_backend._backend import ( - _convert_rst_in_template_to_manpage, - _generate_rst_in_templates, - _get_package_distribution_version, -) - - -def main(): - Path('docs/man/man1/').mkdir(exist_ok=True, parents=True) - version_number = _get_package_distribution_version() - for rst_in in _generate_rst_in_templates(): - _convert_rst_in_template_to_manpage( - rst_doc_template=rst_in.read_text(), - destination_path=rst_in.with_suffix('').with_suffix(''), - version_number=version_number, - ) - rst_in.unlink() - - -if __name__ == "__main__": - main()