Compare commits
2 commits
7dfdf5376b
...
80ba78a9ef
| Author | SHA1 | Date | |
|---|---|---|---|
| 80ba78a9ef | |||
| 1c5dd865b9 |
15 changed files with 87 additions and 8 deletions
|
|
@ -1,3 +1,9 @@
|
|||
## 1.2.0rc0 (2026-06-16)
|
||||
|
||||
### Fix
|
||||
|
||||
- we can redefine type of a types child
|
||||
|
||||
## 1.2.0a77 (2026-06-15)
|
||||
|
||||
### Fix
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[project]
|
||||
name = "rougail"
|
||||
version = "1.2.0a77"
|
||||
version = "1.2.0rc0"
|
||||
|
||||
[tool.commitizen]
|
||||
name = "cz_conventional_commits"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
|||
|
||||
[project]
|
||||
name = "rougail-base"
|
||||
version = "1.2.0a77"
|
||||
version = "1.2.0rc0"
|
||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||
readme = "README.md"
|
||||
description = "A consistency handling system that was initially designed in the configuration management"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
|||
|
||||
[project]
|
||||
name = "rougail"
|
||||
version = "1.2.0a77"
|
||||
version = "1.2.0rc0"
|
||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||
readme = "README.md"
|
||||
description = "A consistency handling system that was initially designed in the configuration management"
|
||||
|
|
@ -27,7 +27,7 @@ classifiers = [
|
|||
dependencies = [
|
||||
"ruamel.yaml ~= 0.18.6",
|
||||
"pydantic ~= 2.9.2",
|
||||
"rougail-base == 1.2.0a77",
|
||||
"rougail-base == 1.2.0rc0",
|
||||
]
|
||||
|
||||
[tool.flit.sdist]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "1.2.0a77"
|
||||
__version__ = "1.2.0rc0"
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ class CollectType:
|
|||
raise DictConsistencyError(msg, 43, self.sources)
|
||||
break
|
||||
|
||||
def set_custom_type(self, custom: dict) -> None:
|
||||
def set_custom_type(self, custom: dict, from_parent: bool=False) -> None:
|
||||
if self.raises and self.test_exists and self.path in self.objectspace.paths:
|
||||
msg = f'cannot redefine "{self.path}" object to a custom type'
|
||||
raise DictConsistencyError(msg, 64, self.sources)
|
||||
|
|
@ -298,7 +298,7 @@ class CollectType:
|
|||
self.user_type = self.types.user_type
|
||||
self.sources = self.types.sources + self.sources
|
||||
self.object = self.types.object
|
||||
if self.option_type == "variable" and "type" in self.parameters:
|
||||
if not from_parent and self.option_type == "variable" and "type" in self.parameters:
|
||||
self.parameters.pop("type")
|
||||
|
||||
def set_object_user_type_family(self):
|
||||
|
|
@ -461,7 +461,7 @@ class Collect(CollectType, CollectFamily, CollectVariable):
|
|||
self.user_type = None
|
||||
self.option_type = None
|
||||
if parent_option is not None and parent_option.types is not None and self.name in parent_option.types.children:
|
||||
self.set_custom_type(parent_option.types.children[self.name])
|
||||
self.set_custom_type(parent_option.types.children[self.name], from_parent=True)
|
||||
self.check_no_extra_keys = False
|
||||
if self.test_exists and path in objectspace.paths:
|
||||
for source in reversed(self.objectspace.paths[path].xmlfiles):
|
||||
|
|
|
|||
|
|
@ -173,3 +173,11 @@ def test_type_family_secret():
|
|||
|
||||
def test_type_family_secret_namespace():
|
||||
type_variable("family_secret_manager", namespace=True)
|
||||
|
||||
|
||||
def test_type_family_redefine_type():
|
||||
type_variable("family_redefine_type")
|
||||
|
||||
|
||||
def test_type_family_redefine_type_namespace():
|
||||
type_variable("family_redefine_type", namespace=True)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from re import compile as re_compile
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
try:
|
||||
groups.namespace
|
||||
except:
|
||||
groups.addgroup('namespace')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_2 = PasswordOption(name="my_type", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine_type/00_type.yml', 'tests/types/structures/family_redefine_type/00_structure.yml'], 'type': 'secret', 'tags': ('one_tag',)})
|
||||
optiondescription_1 = OptionDescription(name="my_family", doc="My family type", children=[option_2], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine_type/00_type.yml', 'tests/types/structures/family_redefine_type/00_structure.yml']})
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"my_family.my_type": "a value"
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"my_family.my_type": "a value"
|
||||
}
|
||||
15
tests/types/result/family_redefine_type/tiramisu.py
Normal file
15
tests/types/result/family_redefine_type/tiramisu.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from re import compile as re_compile
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
try:
|
||||
groups.namespace
|
||||
except:
|
||||
groups.addgroup('namespace')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_4 = PasswordOption(name="my_type", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine_type/00_type.yml', 'tests/types/structures/family_redefine_type/00_structure.yml'], 'type': 'secret', 'tags': ('one_tag',)})
|
||||
optiondescription_3 = OptionDescription(name="my_family", doc="My family type", children=[option_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine_type/00_type.yml', 'tests/types/structures/family_redefine_type/00_structure.yml']})
|
||||
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||
3
tests/types/result/family_redefine_type/variables.json
Normal file
3
tests/types/result/family_redefine_type/variables.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"ns2.my_family.my_type": "a value"
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"ns2.my_family.my_type": "a value"
|
||||
}
|
||||
11
tests/types/structures/family_redefine_type/00_structure.yml
Normal file
11
tests/types/structures/family_redefine_type/00_structure.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
%YAML 1.2
|
||||
---
|
||||
version: 1.1
|
||||
|
||||
my_family:
|
||||
type: my_family_type
|
||||
|
||||
my_type:
|
||||
redefine: true
|
||||
type: secret
|
||||
...
|
||||
13
tests/types/types/family_redefine_type/00_type.yml
Normal file
13
tests/types/types/family_redefine_type/00_type.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
%YAML 1.2
|
||||
---
|
||||
version: 1.1
|
||||
|
||||
my_family_type:
|
||||
description: My family type
|
||||
|
||||
my_type:
|
||||
description: My type
|
||||
default: a value
|
||||
tags:
|
||||
- one_tag
|
||||
...
|
||||
Loading…
Reference in a new issue