-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Improve includes list #763
Improve includes list #763
Conversation
I have merged the CI update from this PR with a few changes (#765). Please rebase to the newest master. |
I resolved the merge conflicts and added to the changelog this PR's changes. |
I have merged #725 now. Can you rebase this to the newest master? |
breathe/parser/compoundsuper.py
Outdated
@@ -798,6 +798,8 @@ def buildChildren(self, child_, nodeName_): | |||
class incType(GeneratedsSuper): | |||
subclass = None | |||
superclass = None | |||
# This is an empty list used to bypass render_iterable() in visit_docreftext() | |||
para = [] # type: ignore |
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.
I think it is fairly subjective but I would lean towards removing this and adding a check to the visit_docreftext
function to see if there is a para
attribute on the node in question.
I'm generally in favour of this kind of approach where you try to minimise if-statements in the code but I don't think that visit_docreftext
should assume the presence of para
, I suspect it is a historical assumption that is being proven wrong by this change. Unless for some reason it makes sense to think of incTypes as having paragraphs.
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.
Good feedback!
Unless for some reason it makes sense to think of incTypes as having paragraphs.
I did try wrapping the incType's text value as nodes.paragraph
, but this resulted in unnecessary margin/padding from the theme I was using 👎 on every entry in the list of includes.
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.
I don't think that visit_docreftext should assume the presence of para, I suspect it is a historical assumption that is being proven wrong by this change.
I'm not sure when in the past visit_docreftext()
was ever used. I don't see any other direct calls to this function - possibly called via render(method.get(node.type, visit_unknown())
at some point (presently).
I added a if hasattr(node, "para")
condition to visit_docreftext()
and removed my hack from compoundsuper.py. It seems to work just as well.
Thanks for doing this. Generally a great improvement. Kind of you to work it through. |
@2bndy5 - I've just resolved the conflict in the CHANGELOG. Are you happy for me to merge this? |
Absolutely! |
Ace! We're getting there slowly :) |
resolves #762
This PR is in close proximity to #725, so it would be prudent to merge that first (there may be conflict here).
I also added python v3.10 & sphinx v4.2.0 to the unit tests CI. However, I found that some versions of sphinx don't work well with python v3.10, citing:
These regression errors seem related to sphinx-doc/sphinx#9835. It could also be related to the cache used on the GitHub runner (I rarely use that feature myself). Either way, sphinx v3.5.4, v4.0.3, v4.1.2 are ignored from unit tests using python v3.10.
Finally, I added
fail-fast: false
to the unit test CI workflow'sstrategy
because it doesn't make sense to cause all other jobs in the matrix to fail if only 1 fails.