8000 [pre-commit.ci] pre-commit autoupdate by pre-commit-ci[bot] · Pull Request #666 · nipype/pydra · GitHub
[go: up one dir, main page]

Skip to content

[pre-commit.ci] pre-commit autoupdate #666

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

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
DOC: Sync sphinxext with upstream
  • Loading branch information
ghisvail committed Aug 10, 2023
commit cdb239ada382738eb99206825a635b09bdb981da
16 changes: 7 additions & 9 deletions docs/sphinxext/github_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
This script comes from scikit-learn:
https://github.com/scikit-learn/scikit-learn/blob/master/doc/sphinxext/github_link.py
"""
from operator import attrgetter
import inspect
import subprocess
import os
import subprocess
import sys
from functools import partial
from operator import attrgetter

REVISION_CMD = "git rev-parse --short HEAD"

Expand Down Expand Up @@ -44,14 +44,12 @@ def _linkcode_resolve(domain, info, package, url_fmt, revision):
return

class_name = info["fullname"].split(".")[0]
if type(class_name) != str:
# Python 2 only
class_name = class_name.encode("utf-8")
module = __import__(info["module"], fromlist=[class_name])
try:
obj = attrgetter(info["fullname"])(module)
except AttributeError:
return
obj = attrgetter(info["fullname"])(module)

# Unwrap the object to get the correct source
# file in case that is wrapped by a decorator
obj = inspect.unwrap(obj)

try:
fn = inspect.getsourcefile(obj)
Expand Down
3058
0