Skip to content

Commit

Permalink
[stable 2.18] remove the relaxed reqs (#2361)
Browse files Browse the repository at this point in the history
* rm relaxed reqs and base constraints

* move pins and requirements out of relaxed

* sync requirements lock file

* update noxfile to rm relaxed reqs

* update docs
  • Loading branch information
oraNod authored Jan 17, 2025
1 parent b525954 commit a1e4190
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 250 deletions.
1 change: 0 additions & 1 deletion docs/docsite/rst/community/documentation_contributions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ For more information on minimum Python versions, see the :ref:`support matrix <s
pip install -r tests/requirements.in -c tests/requirements.txt # Installs tested dependency versions.
pip install -r tests/requirements.in # Installs the unpinned dependency versions.
pip install -r tests/requirements-relaxed.in # Installs the unpinned dependency versions including untested antsibull-docs.
.. note::
Expand Down
37 changes: 10 additions & 27 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -253,19 +237,18 @@ 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
Expand Down
4 changes: 0 additions & 4 deletions tests/constraints-base.in

This file was deleted.

7 changes: 7 additions & 0 deletions tests/constraints.in
Original file line number Diff line number Diff line change
@@ -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.18/requirements.txt
pyyaml >= 5.1 # https://github.com/ansible/ansible/blob/stable-2.18/requirements.txt
resolvelib >= 0.5.3, < 1.1.0 # https://github.com/ansible/ansible/blob/stable-2.18/requirements.txt
16 changes: 0 additions & 16 deletions tests/requirements-relaxed.in

This file was deleted.

187 changes: 0 additions & 187 deletions tests/requirements-relaxed.txt

This file was deleted.

17 changes: 14 additions & 3 deletions tests/requirements.in
Original file line number Diff line number Diff line change
@@ -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
28 changes: 16 additions & 12 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -77,7 +77,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
Expand Down Expand Up @@ -113,17 +114,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
Expand All @@ -138,7 +142,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
Expand All @@ -147,16 +151,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
Expand Down

0 comments on commit a1e4190

Please sign in to comment.