Skip to content
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

exclude needs under only directive if required #1106

Conversation

David-Le-Nir
Copy link
Contributor

fix for #1103

Copy link
Member

@danwos danwos left a comment

Choose a reason for hiding this comment

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

Please see also my comment in the related issue: #1103 (comment)

@@ -356,6 +359,16 @@ def previous_sibling(node: nodes.Node) -> Optional[nodes.Node]:
return node.parent[i - 1] if i > 0 else None # type: ignore


def need_node_excluded_by_only_directive(env: BuildEnvironment, node: nodes.Node) -> bool:
"""Return True if the node is under an "only" directive that shall be excluded given to the current tags"""
if hasattr(node.parent, "tagname") and node.parent.tagname == "only":
Copy link
Member

Choose a reason for hiding this comment

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

I guess this would not support nested needs or needs in other directives like container, list-table and co.

@David-Le-Nir David-Le-Nir force-pushed the fix/issue_1103_only_exclusion branch 2 times, most recently from cf51427 to 7afd6ea Compare February 12, 2024 17:28
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f6b090a) 83.83% compared to head (eda2264) 83.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1106      +/-   ##
==========================================
+ Coverage   83.83%   83.87%   +0.03%     
==========================================
  Files          56       56              
  Lines        6429     6442      +13     
==========================================
+ Hits         5390     5403      +13     
  Misses       1039     1039              
Flag Coverage Δ
pytests 83.87% <100.00%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@David-Le-Nir David-Le-Nir force-pushed the fix/issue_1103_only_exclusion branch 5 times, most recently from fd3343b to 7d783c0 Compare February 12, 2024 18:41
@David-Le-Nir David-Le-Nir force-pushed the fix/issue_1103_only_exclusion branch from 7d783c0 to eda2264 Compare February 13, 2024 16:17
@chrisjsewell chrisjsewell linked an issue Feb 26, 2024 that may be closed by this pull request
@chrisjsewell chrisjsewell changed the title exclude needs under only directive if required (useblocks#1103) exclude needs under only directive if required Feb 26, 2024
@danwos
Copy link
Member

danwos commented May 2, 2024

Covered by #1112

@danwos danwos closed this May 2, 2024
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.

Needs list shall take into account "only" directive
2 participants