From 225d0aaa0caffdb0534c7c0c4fbbdb229e0d71ba Mon Sep 17 00:00:00 2001 From: "Thomas J. Fan" Date: Wed, 8 Jan 2025 17:25:39 -0500 Subject: [PATCH] Fixes github link from pyx files (#6202) Fixes https://github.com/rapidsai/cuml/issues/5261 Authors: - Thomas J. Fan (https://github.com/thomasjpfan) - Tim Head (https://github.com/betatim) - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Tim Head (https://github.com/betatim) URL: https://github.com/rapidsai/cuml/pull/6202 --- docs/source/sphinxext/github_link.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/source/sphinxext/github_link.py b/docs/source/sphinxext/github_link.py index b5d6d379f8..6421354437 100644 --- a/docs/source/sphinxext/github_link.py +++ b/docs/source/sphinxext/github_link.py @@ -1,5 +1,20 @@ # This contains code with copyright by the scikit-learn project, subject to the # license in /thirdparty/LICENSES/LICENSE.scikit_learn +# +# Copyright (c) 2024-2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# import inspect import os @@ -103,7 +118,7 @@ def _linkcode_resolve(domain, info, package, url_fmt, revision): else: if fn.endswith(".pyx"): sp_path = next(x for x in sys.path if re.match(".*site-packages$", x)) - fn = fn.replace("/opt/conda/conda-bld/work/python", sp_path) + fn = fn.replace("/opt/conda/conda-bld/work/python/cuml", sp_path) # Convert to relative from module root fn = os.path.relpath(fn,