Skip to content

Commit

Permalink
wip: attempt to handle github PR builds
Browse files Browse the repository at this point in the history
  • Loading branch information
russellb committed Nov 26, 2024
1 parent 30d33fa commit 9ff46d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def linkcode_resolve(domain, info):
lineno = inspect.getsourcelines(obj)[1]
filename = (inspect.getsourcefile(obj)
or f"{filename}.py").split("vllm/", 1)[1]
pr_number = os.environ.get('GITHUB_REF')
if pr_number and pr_number.startswith('refs/pull/'):
pr_number = pr_number.split('/')[2]
return f"https://github.com/vllm-project/vllm/pull/{pr_number}/files#diff-{filename}#L{lineno}"
return f"https://github.com/vllm-project/vllm/blob/main/{filename}#L{lineno}"
except Exception:
return f"https://github.com/vllm-project/vllm/blob/main/{filename}.py"
Expand Down

0 comments on commit 9ff46d4

Please sign in to comment.