Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken link to python doc #2537

Open
wants to merge 1 commit into
base: branch-25.02
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions docs/source/sphinxext/github_link.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -96,15 +111,14 @@ def _linkcode_resolve(domain, info, package, url_fmt, revision):
# fn is expected to be the absolute path.
fn = os.path.relpath(source_file, start=package)
print("{}:{}".format(
os.path.abspath(os.path.join("..", "python", "cuml", fn)),
os.path.abspath(os.path.join("..", "python", "raft", fn)),
lineno))
else:
return
else:
# Test if we are absolute or not (pyx are relative)
if (not os.path.isabs(fn)):
# Should be relative to docs right now
fn = os.path.abspath(os.path.join("..", "python", fn))
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/cuvs", sp_path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to make sure this builds for developers and not just by CI, right? Won't this break developers trying to build the docs locally?


# Convert to relative from module root
fn = os.path.relpath(fn,
Expand Down
Loading