From cfe00d37955ddb52357795de6df3e29ecc8fa8f8 Mon Sep 17 00:00:00 2001 From: Shahar Epstein <60007259+shahar1@users.noreply.github.com> Date: Sun, 12 Jan 2025 16:49:50 +0200 Subject: [PATCH 1/2] Upgrade sphinx and related dependencies (#45563) * Upgrade sphinx and related dependencies * TEST COMMIT - DO NOT MERGE: modify airflow-site layout.html via Dockerfile.ci * fixup! TEST COMMIT - DO NOT MERGE: modify airflow-site layout.html via Dockerfile.ci * fixup! fixup! TEST COMMIT - DO NOT MERGE: modify airflow-site layout.html via Dockerfile.ci * Apply changes to css * Revert changes to Dockerfile.ci * Pull new Theme * Further CSS Patches to get closer * Remove duplicates --------- Co-authored-by: Jarek Potiuk Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com> Co-authored-by: Epstein, Shahar (cherry picked from commit a51ebe43780afc7ba95453a46fd3b8bfae450540) --- docs/exts/airflow_intersphinx.py | 2 +- docs/sphinx_design/static/custom.css | 35 ++++++++++++++++++++++++++++ hatch_build.py | 23 ++++++------------ 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/docs/exts/airflow_intersphinx.py b/docs/exts/airflow_intersphinx.py index b0fecdec9b7b2..ccfd6662be3b2 100644 --- a/docs/exts/airflow_intersphinx.py +++ b/docs/exts/airflow_intersphinx.py @@ -126,7 +126,7 @@ def fetch_inventories(intersphinx_mapping) -> dict[str, Any]: cache: dict[Any, Any] = {} with concurrent.futures.ThreadPoolExecutor() as pool: for name, (uri, invs) in intersphinx_mapping.values(): - pool.submit(fetch_inventory_group, name, uri, invs, cache, _MockApp(), now) + pool.submit(fetch_inventory_group, name, uri, invs, cache, _MockApp(), now) # type: ignore[arg-type] inv_dict = {} for uri, (name, now, invdata) in cache.items(): diff --git a/docs/sphinx_design/static/custom.css b/docs/sphinx_design/static/custom.css index b1cf49f37d486..70356c06a97ca 100644 --- a/docs/sphinx_design/static/custom.css +++ b/docs/sphinx_design/static/custom.css @@ -31,3 +31,38 @@ --sd-color-tabs-underline-hover: #68d1ff; --sd-color-tabs-underline: transparent; } + +div.admonition.warning { + background: #e8cccc; + font-weight: bolder; +} + +.rst-content .warning .admonition-title { + background: #cc341d; +} + +/* Patches as of moving to Sphinx 7 to get layout to previous state */ +/* Needs to be cleaned in a follow-up to source this from the origin style in */ +/* https://github.com/apache/airflow-site/blob/main/landing-pages/site/assets/scss/_rst-content.scss */ +.base-layout { + padding-top: 123px !important; +} + +section { + padding-top: 0rem !important; + padding-bottom: 0rem !important; +} + +section ol li p:last-child, section ul li p:last-child { + margin-bottom: 0 !important; +} + +a.headerlink { + content: "" !important; + font-size: 75% !important; +} + +a.headerlink::after { + content: " [link]" !important; /* Theme image not existing */ + visibility: visible !important; +} diff --git a/hatch_build.py b/hatch_build.py index 8cb883f002690..965b90b375513 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -156,27 +156,18 @@ DOC_EXTRAS: dict[str, list[str]] = { "doc": [ - "astroid>=2.12.3,<3.0", + "astroid>=3", "checksumdir>=1.2.0", - # click 8.1.4 and 8.1.5 generate mypy errors due to typing issue in the upstream package: - # https://github.com/pallets/click/issues/2558 - "click>=8.0,!=8.1.4,!=8.1.5", - # Docutils 0.17.0 converts generated
into
and breaks our doc formatting - # By adding a lot of whitespace separation. This limit can be lifted when we update our doc to handle - #
tags for sections - "docutils<0.17,>=0.16", - # The new theme 0.1.0 is for Sphinx 7. Airflow 2. still uses old version of Sphinx - "sphinx-airflow-theme>=0.0.12,<0.1.0", + "click>=8.1.8", + "docutils>=0.21", + "sphinx-airflow-theme>=0.1.0", "sphinx-argparse>=0.4.0", - # sphinx-autoapi fails with astroid 3.0, see: https://github.com/readthedocs/sphinx-autoapi/issues/407 - # This was fixed in sphinx-autoapi 3.0, however it has requirement sphinx>=6.1, but we stuck on 5.x - "sphinx-autoapi>=2.1.1", + "sphinx-autoapi>=3", "sphinx-copybutton>=0.5.2", "sphinx-design>=0.5.0", "sphinx-jinja>=2.0.2", "sphinx-rtd-theme>=2.0.0", - # Currently we are using sphinx 5 but we need to migrate to Sphinx 7 - "sphinx>=5.3.0,<6.0.0", + "sphinx>=7", "sphinxcontrib-applehelp>=1.0.4", "sphinxcontrib-devhelp>=1.0.2", "sphinxcontrib-htmlhelp>=2.0.1", @@ -185,7 +176,7 @@ "sphinxcontrib-jsmath>=1.0.1", "sphinxcontrib-qthelp>=1.0.3", "sphinxcontrib-redoc>=1.6.0", - "sphinxcontrib-serializinghtml==1.1.5", + "sphinxcontrib-serializinghtml>=1.1.5", "sphinxcontrib-spelling>=8.0.0", ], "doc-gen": [ From 3cd04aaf3eda72cc1d2f411b95df3b6ddce07b21 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sun, 12 Jan 2025 22:22:22 +0100 Subject: [PATCH 2/2] fixup! Upgrade sphinx and related dependencies (#45563) --- hatch_build.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/hatch_build.py b/hatch_build.py index 965b90b375513..13fa2a44330f3 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -156,28 +156,28 @@ DOC_EXTRAS: dict[str, list[str]] = { "doc": [ - "astroid>=3", - "checksumdir>=1.2.0", - "click>=8.1.8", - "docutils>=0.21", - "sphinx-airflow-theme>=0.1.0", - "sphinx-argparse>=0.4.0", - "sphinx-autoapi>=3", - "sphinx-copybutton>=0.5.2", - "sphinx-design>=0.5.0", - "sphinx-jinja>=2.0.2", - "sphinx-rtd-theme>=2.0.0", - "sphinx>=7", - "sphinxcontrib-applehelp>=1.0.4", - "sphinxcontrib-devhelp>=1.0.2", - "sphinxcontrib-htmlhelp>=2.0.1", - "sphinxcontrib-httpdomain>=1.8.1", - "sphinxcontrib-jquery>=4.1", - "sphinxcontrib-jsmath>=1.0.1", - "sphinxcontrib-qthelp>=1.0.3", - "sphinxcontrib-redoc>=1.6.0", - "sphinxcontrib-serializinghtml>=1.1.5", - "sphinxcontrib-spelling>=8.0.0", + "astroid>=3; python_version >= '3.9'", + "checksumdir>=1.2.0; python_version >= '3.9'", + "click>=8.1.8; python_version >= '3.9'", + "docutils>=0.21; python_version >= '3.9'", + "sphinx-airflow-theme>=0.1.0; python_version >= '3.9'", + "sphinx-argparse>=0.4.0; python_version >= '3.9'", + "sphinx-autoapi>=3; python_version >= '3.9'", + "sphinx-copybutton>=0.5.2; python_version >= '3.9'", + "sphinx-design>=0.5.0; python_version >= '3.9'", + "sphinx-jinja>=2.0.2; python_version >= '3.9'", + "sphinx-rtd-theme>=2.0.0; python_version >= '3.9'", + "sphinx>=7; python_version >= '3.9'", + "sphinxcontrib-applehelp>=1.0.4; python_version >= '3.9'", + "sphinxcontrib-devhelp>=1.0.2; python_version >= '3.9'", + "sphinxcontrib-htmlhelp>=2.0.1; python_version >= '3.9'", + "sphinxcontrib-httpdomain>=1.8.1; python_version >= '3.9'", + "sphinxcontrib-jquery>=4.1; python_version >= '3.9'", + "sphinxcontrib-jsmath>=1.0.1; python_version >= '3.9'", + "sphinxcontrib-qthelp>=1.0.3; python_version >= '3.9'", + "sphinxcontrib-redoc>=1.6.0; python_version >= '3.9'", + "sphinxcontrib-serializinghtml>=1.1.5; python_version >= '3.9'", + "sphinxcontrib-spelling>=8.0.0; python_version >= '3.9'", ], "doc-gen": [ "apache-airflow[doc]",