File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 14
14
from packaging .version import Version
15
15
16
16
CI_TARGETS_YAML = "ci-targets.yaml"
17
+ CI_SKIP_LABELS = ["ci:skip" , "documentation" ]
17
18
18
19
19
20
def meets_conditional_version (version : str , min_version : str ) -> bool :
@@ -31,12 +32,20 @@ def parse_labels(labels: Optional[str]) -> dict[str, set[str]]:
31
32
"build" : set (),
32
33
"arch" : set (),
33
34
"libc" : set (),
35
+ "directives" : set (),
34
36
}
35
37
36
38
for label in labels .split ("," ):
37
39
label = label .strip ()
40
+
41
+ # Handle special directive labels
42
+ if label in CI_SKIP_LABELS :
43
+ result ["directives" ].add ("skip" )
44
+ continue
45
+
38
46
if not label or ":" not in label :
39
47
continue
48
+
40
49
category , value = label .split (":" , 1 )
41
50
if category in result :
42
51
result [category ].add (value )
@@ -46,6 +55,9 @@ def parse_labels(labels: Optional[str]) -> dict[str, set[str]]:
46
55
47
56
def should_include_entry (entry : dict [str , str ], filters : dict [str , set [str ]]) -> bool :
48
57
"""Check if an entry satisfies the label filters."""
58
+ if filters .get ("directives" ) and "skip" in filters ["directives" ]:
59
+ return False
60
+
49
61
if filters .get ("platform" ) and entry ["platform" ] not in filters ["platform" ]:
50
62
return False
51
63
You can’t perform that action at this time.
0 commit comments