diff --git a/rougail-pyproject.toml b/rougail-pyproject.toml index deba1ad26..4df8c879e 100644 --- a/rougail-pyproject.toml +++ b/rougail-pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ - "ruamel.yaml ~= 0.19.1", + "ruamel.yaml ~= 0.19.1", # same version as rougail-user-data-yaml "pydantic ~= 2.13.4", "rougail-base == 1.2.0rc3", ] diff --git a/src/rougail/annotator/property.py b/src/rougail/annotator/property.py index 9bd449791..c72d1c19c 100644 --- a/src/rougail/annotator/property.py +++ b/src/rougail/annotator/property.py @@ -77,6 +77,7 @@ class Annotator(Walk): """convert families""" for family in self.get_families(): self.family_variable_property(family) + self.convert_tag(family) # collect for force_default_on_freeze if family.hidden: if family.hidden is True: @@ -164,13 +165,17 @@ class Annotator(Walk): self.objectspace.properties.add(path, "notunique", True) if variable.auto_save: self.objectspace.properties.add(path, "force_store_value", True) - if variable.tags: - for tag in variable.tags: - self.check_tag(tag, variable.xmlfiles) - self.objectspace.properties.add(variable.path, tag, True) - self.objectspace.informations.add( - variable.path, "tags", tuple(variable.tags) - ) + self.convert_tag(variable) + + def convert_tag(self, variable): + if not variable.tags: + return + for tag in variable.tags: + self.check_tag(tag, variable.xmlfiles) + self.objectspace.properties.add(variable.path, tag, True) + self.objectspace.informations.add( + variable.path, "tags", tuple(variable.tags) + ) def check_tag( self, diff --git a/src/rougail/convert/object_model.py b/src/rougail/convert/object_model.py index 129d9618e..49261fc9e 100644 --- a/src/rougail/convert/object_model.py +++ b/src/rougail/convert/object_model.py @@ -1063,6 +1063,7 @@ class Family(BaseModel): # properties hidden: Union[bool, Calculation] = False disabled: Union[bool, Calculation] = False + tags: Optional[List[StrictStr]] = None # others namespace: Optional[StrictStr] path: StrictStr