Skip to content

Conversation

@alexrockhill
Copy link

@welcome
Copy link

welcome bot commented Jun 24, 2022

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.

Welcome to the EBP community! 🎉

@codecov-commenter
Copy link

Codecov Report

Merging #76 (fbf7916) into main (602160b) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
+ Coverage   88.98%   89.00%   +0.02%     
==========================================
  Files          11       11              
  Lines         917      919       +2     
==========================================
+ Hits          816      818       +2     
  Misses        101      101              
Flag Coverage Δ
pytests 89.00% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sphinx_design/dropdown.py 95.83% <100.00%> (+0.05%) ⬆️
sphinx_design/tabs.py 90.32% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 602160b...fbf7916. Read the comment docs.

@alexrockhill
Copy link
Author

Okay to merge? Thanks for a great extension 😄

alexrockhill and others added 2 commits June 28, 2022 10:50
Co-authored-by: Daniel McCloy <dan@mccloy.info>
Co-authored-by: Daniel McCloy <dan@mccloy.info>
Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
@chrisjsewell
Copy link
Member

Thanks, the only reason I didn't #74 though, was that I had a slight worry that, since findall is a generator, rather than a pre-created list, there might be an issue with node.replace_self, since it is altering the thing you are generating from.
I wanted to double-check that this would not end up with any unexpected behaviour

@alexrockhill
Copy link
Author

Are we still worried about unexpected behavior or is this okay to merge?

Copy link

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump. Our CIs are still failing because of this. Any time to review @chrisjsewell? I've made suggestions below that cast the generators to lists before the for-loop, so it should deal with your worry about node.replace_self (I'm not sure whether or not it's actually a problem, but this way it doesn't matter).

Comment on lines +145 to +148
# Can just use "findall" once docutils 0.18.1+ is required
for node in getattr(self.document, "findall", self.document.traverse)(
lambda node: is_component(node, "dropdown")
):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Can just use "findall" once docutils 0.18.1+ is required
for node in getattr(self.document, "findall", self.document.traverse)(
lambda node: is_component(node, "dropdown")
):
# use this instead once docutils>=0.18.1 is min supported version:
# _dropdowns = list(self.document.findall(lambda node: is_component(node, "dropdown")))
_meth = getattr(self.document, "findall", self.document.traverse)
_dropdowns = list(_meth(lambda node: is_component(node, "dropdown")))
for node in _dropdowns:

Comment on lines +216 to 220
# Can just use "findall" once docutils 0.18.1+ is required
meth = "findall" if hasattr(self.document, "findall") else "traverse"
for tab_set in getattr(self.document, meth)(
lambda node: is_component(node, "tab-set")
):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Can just use "findall" once docutils 0.18.1+ is required
meth = "findall" if hasattr(self.document, "findall") else "traverse"
for tab_set in getattr(self.document, meth)(
lambda node: is_component(node, "tab-set")
):
# use this instead once docutils>=0.18.1 is min supported version:
# _tab_sets = list(self.document.findall(lambda node: is_component(node, "tab-set")))
_meth = getattr(self.document, "findall", self.document.traverse)
_tab_sets = list(_meth(lambda node: is_component(node, "tab-set")))
for tab_set in _tab_sets:

@drammock
Copy link

Bump again. I think my suggested change addresses the only worry you've so far expressed @chrisjsewell. Can you find time to review?

@chrisjsewell
Copy link
Member

Heya, thanks for the PR, but I've superseded it with #94, to use the already available "compat" function 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants