From 81e3d704b535a348cb3dd9a4c2c61561ccfd65ba Mon Sep 17 00:00:00 2001 From: Don Naro Date: Fri, 17 Jan 2025 10:30:32 +0000 Subject: [PATCH 1/6] rm relaxed reqs and base constraints --- tests/constraints-base.in | 4 - tests/requirements-relaxed.in | 16 --- tests/requirements-relaxed.txt | 194 --------------------------------- 3 files changed, 214 deletions(-) delete mode 100644 tests/constraints-base.in delete mode 100644 tests/requirements-relaxed.in delete mode 100644 tests/requirements-relaxed.txt diff --git a/tests/constraints-base.in b/tests/constraints-base.in deleted file mode 100644 index 1928c3a06d1..00000000000 --- a/tests/constraints-base.in +++ /dev/null @@ -1,4 +0,0 @@ -# Known limitations for indirect/transitive dependencies. - -rstcheck < 6 # rstcheck 6.x has problem with rstcheck.core triggered by include files w/ sphinx directives https://github.com/rstcheck/rstcheck-core/issues/3 -sphinx-rtd-theme>=2.0.0 # Fix 404 pages with new sphinx -- https://github.com/ansible/ansible-documentation/issues/678 diff --git a/tests/requirements-relaxed.in b/tests/requirements-relaxed.in deleted file mode 100644 index dd452b3ae7b..00000000000 --- a/tests/requirements-relaxed.in +++ /dev/null @@ -1,16 +0,0 @@ -# This requirements file contains no pins on antsibull-docs and other -# essential tools -# It's used for testing purposes and devel branch builds on docs.ansible.com. - --c constraints-base.in - -jinja2 >= 3.0.0 # used by hacking/build_library/build_ansible/command_plugins/generate_man.py and dump_keywords.py -pyyaml >= 5.1 # used by ansible-core -resolvelib >= 0.5.3, < 1.1.0 # used by ansible-core -sphinx -sphinx-intl # translation utility used by docs/docsite/Makefile -sphinx-notfound-page -sphinx-ansible-theme -rstcheck -antsibull-docs ~= 2.7 # 2.7.0 has a fix for new plugin_name field in ansible-doc output -sphinx-copybutton diff --git a/tests/requirements-relaxed.txt b/tests/requirements-relaxed.txt deleted file mode 100644 index a95d5955827..00000000000 --- a/tests/requirements-relaxed.txt +++ /dev/null @@ -1,194 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --allow-unsafe --output-file=tests/requirements-relaxed.txt --strip-extras tests/requirements-relaxed.in -# -aiofiles==24.1.0 - # via - # antsibull-core - # antsibull-fileutils -aiohappyeyeballs==2.4.3 - # via aiohttp -aiohttp==3.11.7 - # via - # antsibull-core - # antsibull-docs -aiosignal==1.3.1 - # via aiohttp -alabaster==1.0.0 - # via sphinx -annotated-types==0.7.0 - # via pydantic -ansible-pygments==0.1.1 - # via - # antsibull-docs - # sphinx-ansible-theme -antsibull-changelog==0.31.1 - # via antsibull-docs -antsibull-core==3.4.0 - # via antsibull-docs -antsibull-docs==2.16.2 - # via -r tests/requirements-relaxed.in -antsibull-docs-parser==1.1.0 - # via antsibull-docs -antsibull-docutils==1.0.0 - # via antsibull-changelog -antsibull-fileutils==1.1.0 - # via - # antsibull-changelog - # antsibull-core - # antsibull-docs -async-timeout==5.0.1 - # via aiohttp -asyncio-pool==0.6.0 - # via antsibull-docs -attrs==24.2.0 - # via aiohttp -babel==2.16.0 - # via - # sphinx - # sphinx-intl -build==1.2.2.post1 - # via antsibull-core -certifi==2024.8.30 - # via requests -charset-normalizer==3.4.0 - # via requests -click==8.1.7 - # via sphinx-intl -docutils==0.21.2 - # via - # antsibull-changelog - # antsibull-docs - # antsibull-docutils - # rstcheck - # sphinx - # sphinx-rtd-theme -frozenlist==1.5.0 - # via - # aiohttp - # aiosignal -idna==3.10 - # via - # requests - # yarl -imagesize==1.4.1 - # via sphinx -jinja2==3.1.4 - # via - # -r tests/requirements-relaxed.in - # antsibull-docs - # sphinx -markupsafe==3.0.2 - # via jinja2 -multidict==6.1.0 - # via - # aiohttp - # yarl -packaging==24.2 - # via - # antsibull-changelog - # antsibull-core - # antsibull-docs - # build - # sphinx -perky==0.9.3 - # via antsibull-core -propcache==0.2.0 - # via - # aiohttp - # yarl -pydantic==2.10.0 - # via - # antsibull-core - # antsibull-docs -pydantic-core==2.27.0 - # via pydantic -pygments==2.18.0 - # via - # ansible-pygments - # sphinx -pyproject-hooks==1.2.0 - # via build -pyyaml==6.0.2 - # via - # -r tests/requirements-relaxed.in - # antsibull-docs - # antsibull-fileutils -requests==2.32.3 - # via sphinx -resolvelib==1.0.1 - # via -r tests/requirements-relaxed.in -rstcheck==3.5.0 - # via - # -c tests/constraints-base.in - # -r tests/requirements-relaxed.in - # antsibull-changelog - # antsibull-docs -semantic-version==2.10.0 - # via - # antsibull-changelog - # antsibull-core - # antsibull-docs -six==1.16.0 - # via twiggy -snowballstemmer==2.2.0 - # via sphinx -sphinx==8.1.3 - # via - # -r tests/requirements-relaxed.in - # antsibull-docs - # sphinx-ansible-theme - # sphinx-copybutton - # sphinx-intl - # sphinx-notfound-page - # sphinx-rtd-theme - # sphinxcontrib-jquery -sphinx-ansible-theme==0.10.3 - # via -r tests/requirements-relaxed.in -sphinx-copybutton==0.5.2 - # via -r tests/requirements-relaxed.in -sphinx-intl==2.3.0 - # via -r tests/requirements-relaxed.in -sphinx-notfound-page==1.0.4 - # via -r tests/requirements-relaxed.in -sphinx-rtd-theme==3.0.2 - # via - # -c tests/constraints-base.in - # sphinx-ansible-theme -sphinxcontrib-applehelp==2.0.0 - # via sphinx -sphinxcontrib-devhelp==2.0.0 - # via sphinx -sphinxcontrib-htmlhelp==2.1.0 - # via sphinx -sphinxcontrib-jquery==4.1 - # via sphinx-rtd-theme -sphinxcontrib-jsmath==1.0.1 - # via sphinx -sphinxcontrib-qthelp==2.0.0 - # via sphinx -sphinxcontrib-serializinghtml==2.0.0 - # via sphinx -tomli==2.1.0 - # via - # build - # sphinx -twiggy==0.5.1 - # via - # antsibull-core - # antsibull-docs -typing-extensions==4.12.2 - # via - # multidict - # pydantic - # pydantic-core -urllib3==2.2.3 - # via requests -yarl==1.18.0 - # via aiohttp - -# The following packages are considered to be unsafe in a requirements file: -setuptools==75.6.0 - # via sphinx-intl From cec998e4b42b60835ee4a7f460a0f6936283e423 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Fri, 17 Jan 2025 10:30:55 +0000 Subject: [PATCH 2/6] move pins and requirements out of relaxed --- tests/constraints.in | 7 +++++++ tests/requirements.in | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/constraints.in b/tests/constraints.in index bf2979578ac..f65604eec26 100644 --- a/tests/constraints.in +++ b/tests/constraints.in @@ -1,5 +1,12 @@ # This constraints file contains pins for the stable, tested versions of sphinx # and antsibull-docs that production builds rely upon. +# This constraint file also pins other versions for which there are known limitations. sphinx == 7.2.5 antsibull-docs == 2.16.2 # currently approved version + +rstcheck < 6 # rstcheck 6.x has problem with rstcheck.core triggered by include files w/ sphinx directives https://github.com/rstcheck/rstcheck-core/issues/3 +sphinx-rtd-theme>=2.0.0 # Fix 404 pages with new sphinx -- https://github.com/ansible/ansible-documentation/issues/678 +jinja2 >= 3.0.0 # https://github.com/ansible/ansible/blob/stable-2.17/requirements.txt +pyyaml >= 5.1 # https://github.com/ansible/ansible/blob/stable-2.17/requirements.txt +resolvelib >= 0.5.3, < 1.1.0 # https://github.com/ansible/ansible/blob/stable-2.17/requirements.txt diff --git a/tests/requirements.in b/tests/requirements.in index 6ff0f42f867..e7afaa4f6ef 100644 --- a/tests/requirements.in +++ b/tests/requirements.in @@ -1,5 +1,16 @@ -# This requirements file is used for stable ansible docs builds -# It depends on specific, tested antsibull-docs and sphinx versions +# This requirements file is used for doc builds -c constraints.in # <-- contains known limitations --r requirements-relaxed.in # <-- contains base set of dependencies + +# Base set of dependencies. + +antsibull-docs +sphinx +sphinx-intl # translation utility used by docs/docsite/Makefile +sphinx-notfound-page # extension used for the custom 404 page (cowsay) +sphinx-ansible-theme # extension used for the custom docs theme +sphinx-copybutton +rstcheck +jinja2 # used by hacking/build_library/build_ansible/command_plugins/generate_man.py and dump_keywords.py +pyyaml # used by ansible-core +resolvelib # used by ansible-core From 75b3a012c3555dfc41ee89a8e6e32090d5362d42 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Fri, 17 Jan 2025 10:31:53 +0000 Subject: [PATCH 3/6] sync requirements lock file --- tests/requirements.txt | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index c77d148e7ef..f704b86ee93 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -31,7 +31,7 @@ antsibull-core==3.4.0 antsibull-docs==2.16.2 # via # -c tests/constraints.in - # -r tests/requirements-relaxed.in + # -r tests/requirements.in antsibull-docs-parser==1.1.0 # via antsibull-docs antsibull-docutils==1.0.0 @@ -79,7 +79,8 @@ imagesize==1.4.1 # via sphinx jinja2==3.1.4 # via - # -r tests/requirements-relaxed.in + # -c tests/constraints.in + # -r tests/requirements.in # antsibull-docs # sphinx markupsafe==3.0.2 @@ -115,17 +116,20 @@ pyproject-hooks==1.2.0 # via build pyyaml==6.0.2 # via - # -r tests/requirements-relaxed.in + # -c tests/constraints.in + # -r tests/requirements.in # antsibull-docs # antsibull-fileutils requests==2.32.3 # via sphinx resolvelib==1.0.1 - # via -r tests/requirements-relaxed.in + # via + # -c tests/constraints.in + # -r tests/requirements.in rstcheck==5.0.0 # via - # -c tests/constraints-base.in - # -r tests/requirements-relaxed.in + # -c tests/constraints.in + # -r tests/requirements.in # antsibull-changelog # antsibull-docs semantic-version==2.10.0 @@ -140,7 +144,7 @@ snowballstemmer==2.2.0 sphinx==7.2.5 # via # -c tests/constraints.in - # -r tests/requirements-relaxed.in + # -r tests/requirements.in # antsibull-docs # sphinx-ansible-theme # sphinx-copybutton @@ -149,16 +153,16 @@ sphinx==7.2.5 # sphinx-rtd-theme # sphinxcontrib-jquery sphinx-ansible-theme==0.10.3 - # via -r tests/requirements-relaxed.in + # via -r tests/requirements.in sphinx-copybutton==0.5.2 - # via -r tests/requirements-relaxed.in + # via -r tests/requirements.in sphinx-intl==2.3.0 - # via -r tests/requirements-relaxed.in + # via -r tests/requirements.in sphinx-notfound-page==1.0.4 - # via -r tests/requirements-relaxed.in + # via -r tests/requirements.in sphinx-rtd-theme==3.0.2 # via - # -c tests/constraints-base.in + # -c tests/constraints.in # sphinx-ansible-theme sphinxcontrib-applehelp==2.0.0 # via sphinx From 00230b73a1a6976cbc64265ea315536acde2cb32 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Tue, 14 Jan 2025 19:24:51 +0000 Subject: [PATCH 4/6] update noxfile to rm relaxed reqs --- noxfile.py | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/noxfile.py b/noxfile.py index c48eaef728f..11226a0c6fc 100644 --- a/noxfile.py +++ b/noxfile.py @@ -3,7 +3,6 @@ import os import shlex import shutil -from argparse import ArgumentParser, BooleanOptionalAction from glob import iglob from pathlib import Path from typing import cast @@ -209,20 +208,6 @@ def _clone_core_check(session: nox.Session) -> None: session.run("python", "docs/bin/clone-core.py", "--check") -def _relaxed_parser(session: nox.Session) -> ArgumentParser: - """ - Generate an argument parser with a --relaxed option. - """ - parser = ArgumentParser(prog=f"nox -e {session.name} --") - parser.add_argument( - "--relaxed", - default=False, - action=BooleanOptionalAction, - help="Whether to use requirements-relaxed file. (Default: %(default)s)", - ) - return parser - - def _env_python(session: nox.Session) -> str: """ Get the full path to an environment's python executable @@ -240,9 +225,8 @@ def checkers(session: nox.Session, test: str): """ Run docs build checkers """ - args = _relaxed_parser(session).parse_args(session.posargs) - install(session, req="requirements-relaxed" if args.relaxed else "requirements") + install(session, req="requirements") _clone_core_check(session) session.run("make", "-C", "docs/docsite", "clean", external=True) session.run("python", "tests/checkers.py", test) @@ -253,16 +237,30 @@ def make(session: nox.Session): """ Generate HTML from documentation source using the Makefile """ - parser = _relaxed_parser(session) - parser.add_argument( - "make_args", nargs="*", help="Specify make targets as arguments" - ) - args = parser.parse_args(session.posargs) + make_args = session.posargs or ["clean", "coredocs"] - install(session, req="requirements-relaxed" if args.relaxed else "requirements") + install(session, req="requirements") _clone_core_check(session) - make_args: list[str] = [ + session.run( + "make", + "-C", + "docs/docsite", f"PYTHON={_env_python(session)}", - *(args.make_args or ("clean", "coredocs")), - ] - session.run("make", "-C", "docs/docsite", *make_args, external=True) + *make_args, + external=True, + ) + + +@nox.session +def tag(session: nox.Session): + """ + Check the core repo for new releases and create tags in ansible-documentation + """ + install(session, req="tag") + args = list(session.posargs) + + # If run without any arguments, default to "tag" + if not any(arg.startswith(("hash", "mantag", "new-tags", "tag")) for arg in args): + args.append("tag") + + session.run("python", "hacking/tagger/tag.py", *args) From e968be8b8b742d386c8804890712e312774f761c Mon Sep 17 00:00:00 2001 From: Don Naro Date: Tue, 14 Jan 2025 19:25:38 +0000 Subject: [PATCH 5/6] update docs --- docs/docsite/rst/community/documentation_contributions.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/docsite/rst/community/documentation_contributions.rst b/docs/docsite/rst/community/documentation_contributions.rst index c830a0914ea..4f80df51132 100644 --- a/docs/docsite/rst/community/documentation_contributions.rst +++ b/docs/docsite/rst/community/documentation_contributions.rst @@ -113,7 +113,6 @@ For more information on minimum Python versions, see the :ref:`support matrix Date: Mon, 20 Jan 2025 13:43:19 +0000 Subject: [PATCH 6/6] remove tagger session --- noxfile.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/noxfile.py b/noxfile.py index 11226a0c6fc..cc004279b82 100644 --- a/noxfile.py +++ b/noxfile.py @@ -249,18 +249,3 @@ def make(session: nox.Session): *make_args, external=True, ) - - -@nox.session -def tag(session: nox.Session): - """ - Check the core repo for new releases and create tags in ansible-documentation - """ - install(session, req="tag") - args = list(session.posargs) - - # If run without any arguments, default to "tag" - if not any(arg.startswith(("hash", "mantag", "new-tags", "tag")) for arg in args): - args.append("tag") - - session.run("python", "hacking/tagger/tag.py", *args)