From 5ffc37a866e9692d808c8b56a13cfd0ba2197634 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 2 Nov 2023 14:12:13 +0400 Subject: [PATCH] [7.17] Fix docs build (#2362) --- .github/workflows/ci.yml | 15 --------------- .readthedocs.yml | 15 ++++++++++----- dev-requirements.txt | 1 + docs/sphinx/conf.py | 24 +++++++++--------------- 4 files changed, 20 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2bab0c9eb..e633247a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,21 +19,6 @@ jobs: - name: Lint the code run: nox -s lint - docs: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Install dependencies - run: | - python3.7 -m pip install nox - - name: Build the docs - run: nox -s docs - test-linux: strategy: fail-fast: false diff --git a/.readthedocs.yml b/.readthedocs.yml index e09a45ed3..f98f5b245 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,10 +1,15 @@ version: 2 -sphinx: - configuration: docs/sphinx/conf.py + +build: + os: ubuntu-22.04 + tools: + # To work around https://github.com/aio-libs/aiohttp/issues/7675, we need + # to set AIOHTTP_NO_EXTENSIONS to 1 but it has to be done in + # https://readthedocs.org/dashboard/elasticsearch-py/environmentvariables/ + # because of https://github.com/readthedocs/readthedocs.org/issues/6311 + python: "3" python: - version: 3.7 install: - - method: pip - path: . - requirements: dev-requirements.txt + - path: . diff --git a/dev-requirements.txt b/dev-requirements.txt index 59b226aa0..584023b8c 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,6 +4,7 @@ pytest-cov coverage mock sphinx +sphinx-rtd-theme jinja2 python-dateutil diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index 3fdf21ffb..e80757c2f 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -3,8 +3,8 @@ # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information -import os import datetime + import elasticsearch # If extensions (or modules to document with autodoc) are in another directory, @@ -36,8 +36,8 @@ master_doc = "index" # General information about the project. -project = u"Elasticsearch" -copyright = u"%d, Elasticsearch B.V" % datetime.date.today().year +project = "Elasticsearch" +copyright = "%d, Elasticsearch B.V" % datetime.date.today().year # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -91,13 +91,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -on_rtd = os.environ.get("READTHEDOCS", None) == "True" - -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - - html_theme = "sphinx_rtd_theme" - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -194,8 +188,8 @@ ( "index", "Elasticsearch.tex", - u"Elasticsearch Documentation", - u"Honza Král", + "Elasticsearch Documentation", + "Honza Král", "manual", ) ] @@ -226,7 +220,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ("index", "elasticsearch-py", u"Elasticsearch Documentation", [u"Honza Král"], 1) + ("index", "elasticsearch-py", "Elasticsearch Documentation", ["Honza Král"], 1) ] # If true, show URL addresses after external links. @@ -242,8 +236,8 @@ ( "index", "Elasticsearch", - u"Elasticsearch Documentation", - u"Honza Král", + "Elasticsearch Documentation", + "Honza Král", "Elasticsearch", "One line description of project.", "Miscellaneous",