From a12bfdf659026ac08668d941381c3f41e1e093f9 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 2 Sep 2026 09:41:11 -0500 Subject: [PATCH] Make RAPIDS intersphinx references release-aware --- docs/ucxx/source/conf.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/ucxx/source/conf.py b/docs/ucxx/source/conf.py index fb925c4af..bee136954 100644 --- a/docs/ucxx/source/conf.py +++ b/docs/ucxx/source/conf.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2018-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # # Configuration file for the Sphinx documentation builder. @@ -30,6 +30,20 @@ # The full version. release = f"{UCXX_VERSION.major:02}.{UCXX_VERSION.minor:02}.{UCXX_VERSION.micro:02}" +rapids_branch_file = os.path.join( + os.path.dirname(__file__), "..", "..", "..", "RAPIDS_BRANCH" +) +try: + with open(rapids_branch_file) as f: + RAPIDS_BRANCH = f.read().strip() +except FileNotFoundError: + RAPIDS_BRANCH = "main" +nvidia_docs_intersphinx_version = ( + RAPIDS_BRANCH.removeprefix("release/") + if RAPIDS_BRANCH.startswith("release/") + else "latest" +) + # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -169,7 +183,10 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { - "cudf": ("https://docs.rapids.ai/api/cudf/nightly/", None), + "cudf": ( + f"https://docs.nvidia.com/cudf/{nvidia_docs_intersphinx_version}/", + None, + ), "cupy": ("https://docs.cupy.dev/en/stable/", None), "numpy": ("https://numpy.org/doc/stable", None), "pandas": ( @@ -177,7 +194,10 @@ None, ), "python": ("https://docs.python.org/3", None), - "rmm": ("https://docs.rapids.ai/api/rmm/nightly/", None), + "rmm": ( + f"https://docs.nvidia.com/rmm/{nvidia_docs_intersphinx_version}/", + None, + ), "typing_extensions": ( "https://typing-extensions.readthedocs.io/en/stable/", None,