Skip to content

Commit

Permalink
use os
Browse files Browse the repository at this point in the history
Signed-off-by: Ankita Katiyar <[email protected]>
  • Loading branch information
ankatiyar committed Jan 13, 2025
1 parent 401c70b commit 394b780
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import importlib
import inspect
import os
import re
import sys
from inspect import getmembers, isclass, isfunction
Expand Down Expand Up @@ -551,7 +552,8 @@ def linkcode_resolve(domain, info):

filename = inspect.getsourcefile(obj)
source, lineno = inspect.getsourcelines(obj)
relpath = str(Path(filename).relative_to(Path(kedro.__file__)))
relpath = os.path.relpath(filename, start=os.path.dirname(
kedro.__file__))

return 'https://github.com/kedro-org/kedro/blob/main/kedro/%s#L%d#L%d' % (
relpath, lineno, lineno + len(source) - 1
Expand Down

0 comments on commit 394b780

Please sign in to comment.