Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Use
sphinx.ext.linkcode
for more precise source code links #11851Use
sphinx.ext.linkcode
for more precise source code links #11851Changes from 29 commits
099636d
00b05e7
a20ad5c
2f94288
1d5c34d
1849ce1
cca9b04
5bd18cd
b985ba6
914d2cd
1deb939
b84b399
01e4ca6
25ff4df
ace069b
5420982
d60bbf4
17881d4
9330e45
ab8dad0
6ef1f68
b45113b
a3e5297
e3382e7
825e02a
51f4bcb
ab7f411
2a28edb
cde30ef
5545bc8
7c95384
5b74a03
8a805da
abf4871
3386c4c
614e8f8
19d052d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It's quite unlikely to matter, but you might prefer to do this
full_file_name.split
thing using the properos.path
orpathlib
tooling. Something like:The current form would break if we were ever to add a subdirectory of the
qiskit
package that itself was calledqiskit
- unlikely, but not impossible.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.
Oh, actually not even unlikely - I just remembered that I literally proposed doing that in #10737 (though in that case, there wouldn't be any Python-documentable objects in it).
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.
Thanks for the suggestion!
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.
Ah, I now remember why we were using
[-1]
. This current code results in the relative file path.tox/docs/lib/python3.8/site-packages/qiskit/circuit/classicalfunction/exceptions.py
.I'm unclear why that is: I couldn't reproduce in
qiskit_sphinx_theme
with setting intox.ini
isolated_build = true
andusedevelop = false
to mirror Qiskit. (I've been having issues running tox locally in Qiskit due to autodoc). Inqiskit_sphinx_theme
locally and GitHub Actions, the path is the normal file path you'd expect without the.tox
prefix. So I think we want this code to support both styles.We could use a regex replace to remove the
.tox
prefix if it's there.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.
In that case, perhaps you want to use
import qiskit; qiskit.__file__
as the file-path root, so it'll automatically find the base of where the files are installed?I don't mind a huge amount, though.