-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Fix creation of [source] links in the doc creation #23129
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
Conversation
Hello @vkk800! Thanks for submitting the PR.
|
Codecov Report
@@ Coverage Diff @@
## master #23129 +/- ##
==========================================
+ Coverage 92.13% 92.23% +0.09%
==========================================
Files 170 161 -9
Lines 51073 51197 +124
==========================================
+ Hits 47056 47220 +164
+ Misses 4017 3977 -40
Continue to review full report at Codecov.
|
In the CI we're building the documentation in Python 3.6, and in couple of months we'll only support Python 3.5+, so I think it's acceptable. Could you test the broken links locally? Btw, unrelated to this PR, in |
Yes, I tried locally re-compiling the docs and the links were fixed by this change. However, maybe it's better, just to be sure, if someone else also verifies that this patch doesn't break anything before merging since the doc creation scripts are currently not tested at all by the automated tests. I can also try to take a look at the other file you mentioned. Is there an open issue somewhere describing specifically what the problem is? |
@vkk800 there is no problem with the script, it's just that it's possible that we reimplemented As you already worked with that function, I thought it'd be useful if you can take a look, see if that's the case, and if we can delete that method and simply use |
@jorisvandenbossche I think you mmay want to take a look at this PR |
For now, we can still call the |
We could do something like I took a look at the |
@vkk800 if you can simply add a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @vkk800
@@ -569,7 +569,11 @@ def linkcode_resolve(domain, info): | |||
return None | |||
|
|||
try: | |||
fn = inspect.getsourcefile(obj) | |||
# inspect.unwrap() was added in Python version 3.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't actually support 3.4, make this 3.5
Co-Authored-By: vkk800 <[email protected]>
thanks @vkk800 |
See this issue: #23046
A simple fix is to add
inspect.unwrap(obj)
beforegetsourcefile
. This follows the__wrapped__
attributes of the functions "all the way to the bottom" and then returns the object found.One problem with this is that
unwrap
function was only introduced in Python 3.4. This means that compiling the documentation will now fail on Python versions older than that. I do not know if this is acceptable.