Skip to content

Commit

Permalink
Timeline of SIP versions broken
Browse files Browse the repository at this point in the history
The handling of the SIP versions timeline has been fixed.

Annotations are now only validated if they are known to be needed.

Resolves #47
  • Loading branch information
philthompson10 committed Dec 5, 2024
1 parent 0cd5ff7 commit ede0981
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sipbuild/generator/parser/parser_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ def evaluate_timeline(self, p, symbol_lower, symbol_upper):

return True

# See if there is a selected qualifier withing range.
# See if there is a selected qualifier within range.
for qual in module.qualifiers:
if qual.type is QualifierType.TIME and qual.timeline == timeline and qual.name in self.tags:
if lower_qual is not None and qual.order < lower_qual.order:
Expand Down
7 changes: 6 additions & 1 deletion sipbuild/generator/parser/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -3213,10 +3213,15 @@ def p_annotation(p):
"""annotation : NAME
| NAME '=' annotation_value"""

p[0] = {}

if p.parser.pm.skipping:
return

value = None if len(p) == 2 else p[3]
value = p.parser.pm.validate_annotation(p, 1, value)

p[0] = {p[1]: value}
p[0][1] = value


def p_annotation_value(p):
Expand Down
3 changes: 2 additions & 1 deletion sipbuild/generator/specification.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,8 @@ class Qualifier:
order: int = 0

# The timeline number within the defining module if it is a TIME qualifier.
timeline: int = 0
# A negative value implies the SIP timeline.
timeline: int = -1


@dataclass
Expand Down
4 changes: 3 additions & 1 deletion sipbuild/module/abi_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def resolve_abi_version(abi_version, module=True):
f"'{abi_version}' is not a valid ABI version")
else:
abi_major_version = sorted(os.listdir(_module_source_dir), key=int)[-1]
minimum_minor_version = 0
# v13.0 is deprecated so explicitly exclude it to avoid a later
# deprecation warning.
minimum_minor_version = 1 if abi_major_version == '13' else 0

# Get the minor version of what we actually have.
module_version = get_sip_module_version(abi_major_version)
Expand Down

0 comments on commit ede0981

Please sign in to comment.