Skip to content

Commit c7ff9b5

Browse files
committed
Fix CI
1 parent c6c3e00 commit c7ff9b5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/source/sphinxext/github_link.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,14 @@ def _linkcode_resolve(domain, info, package, url_fmt, revision):
116116
else:
117117
return
118118
else:
119-
# Test if we are absolute or not (pyx are relative)
120-
if (not os.path.isabs(fn)):
121-
# Should be relative to docs right now
122-
fn = os.path.abspath(os.path.join("..", "python", fn))
119+
if fn.endswith(".pyx"):
120+
sp_path = next(x for x in sys.path if re.match(".*site-packages$", x))
121+
fn = fn.replace("/opt/conda/conda-bld/work/python/cuvs", sp_path)
123122

124123
# Convert to relative from module root
125-
fn = os.path.relpath(fn, start=package)
124+
fn = os.path.relpath(fn,
125+
start=os.path.dirname(
126+
__import__(package).__file__))
126127

127128
# Get the line number if we need it. (Can work without it)
128129
if (lineno is None):

0 commit comments

Comments
 (0)