Compare commits
No commits in common. "899226f7d24ff6b51a8af5bf2c98119ec6de57e1" and "dcb18003468978d1fe2208be96da35a209dd3177" have entirely different histories.
899226f7d2
...
dcb1800346
8 changed files with 15 additions and 33 deletions
|
|
@ -1,9 +1,3 @@
|
||||||
## 1.2.0a33 (2025-09-29)
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
|
|
||||||
- better doc for calculation with unknown variable
|
|
||||||
|
|
||||||
## 1.2.0a32 (2025-09-29)
|
## 1.2.0a32 (2025-09-29)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "rougail"
|
name = "rougail"
|
||||||
version = "1.2.0a33"
|
version = "1.2.0a32"
|
||||||
|
|
||||||
[tool.commitizen]
|
[tool.commitizen]
|
||||||
name = "cz_conventional_commits"
|
name = "cz_conventional_commits"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail-base"
|
name = "rougail-base"
|
||||||
version = "1.2.0a33"
|
version = "1.2.0a32"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
description = "A consistency handling system that was initially designed in the configuration management"
|
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]
|
[project]
|
||||||
name = "rougail"
|
name = "rougail"
|
||||||
version = "1.2.0a33"
|
version = "1.2.0a32"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
description = "A consistency handling system that was initially designed in the configuration management"
|
description = "A consistency handling system that was initially designed in the configuration management"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
|
|
@ -18,7 +18,7 @@ classifiers = [
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ruamel.yaml ~= 0.18.6",
|
"ruamel.yaml ~= 0.18.6",
|
||||||
"pydantic ~= 2.9.2",
|
"pydantic ~= 2.9.2",
|
||||||
"rougail-base == 1.2.0a33",
|
"rougail-base == 1.2.0a32",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.flit.sdist]
|
[tool.flit.sdist]
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
__version__ = "1.2.0a33"
|
__version__ = "1.2.0a32"
|
||||||
|
|
|
||||||
|
|
@ -674,13 +674,11 @@ class VariableCalculation(_VariableCalculation):
|
||||||
) = self.get_variable(objectspace)
|
) = self.get_variable(objectspace)
|
||||||
if (
|
if (
|
||||||
not variable_in_calculation
|
not variable_in_calculation
|
||||||
and (self.optional
|
and self.optional
|
||||||
or objectspace.force_optional)
|
or (objectspace.force_optional and self.attribute_name == "default")
|
||||||
):
|
):
|
||||||
if self.default is not undefined:
|
if self.default is not undefined:
|
||||||
return self.get_default_value_optional(objectspace, self.default)
|
return self.get_default_value_optional(objectspace, self.default)
|
||||||
if self.default_values is not None:
|
|
||||||
return self.default_values
|
|
||||||
raise VariableCalculationDependencyError()
|
raise VariableCalculationDependencyError()
|
||||||
if variable_in_calculation and self.attribute_name == "default":
|
if variable_in_calculation and self.attribute_name == "default":
|
||||||
local_variable = objectspace.paths[self.path]
|
local_variable = objectspace.paths[self.path]
|
||||||
|
|
@ -722,8 +720,8 @@ class VariablePropertyCalculation(_VariableCalculation):
|
||||||
if (
|
if (
|
||||||
# self.default is not undefined and
|
# self.default is not undefined and
|
||||||
not variable_in_calculation
|
not variable_in_calculation
|
||||||
and (self.optional
|
and self.optional
|
||||||
or objectspace.force_optional)
|
or (objectspace.force_optional)
|
||||||
):
|
):
|
||||||
if self.default is undefined:
|
if self.default is undefined:
|
||||||
default = False
|
default = False
|
||||||
|
|
|
||||||
|
|
@ -226,8 +226,7 @@ class Common:
|
||||||
for val in value:
|
for val in value:
|
||||||
ret = self.calculation_property(val)
|
ret = self.calculation_property(val)
|
||||||
if isinstance(ret, bool):
|
if isinstance(ret, bool):
|
||||||
if ret:
|
properties.append(self.convert_str(property_))
|
||||||
properties.append(self.convert_str(property_))
|
|
||||||
elif ret is not None:
|
elif ret is not None:
|
||||||
calc_properties.append(ret)
|
calc_properties.append(ret)
|
||||||
if properties or calc_properties:
|
if properties or calc_properties:
|
||||||
|
|
@ -245,7 +244,6 @@ class Common:
|
||||||
return None
|
return None
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
def calc_properties(
|
def calc_properties(
|
||||||
self,
|
self,
|
||||||
prop,
|
prop,
|
||||||
|
|
@ -464,14 +462,9 @@ class Variable(Common):
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
if self.elt.type == "choice":
|
if self.elt.type == "choice":
|
||||||
try:
|
keys["values"] = self.populate_calculation(
|
||||||
keys["values"] = self.populate_calculation(
|
self.elt.choices, return_a_tuple=True
|
||||||
self.elt.choices, return_a_tuple=True
|
)
|
||||||
)
|
|
||||||
if keys["values"] == '(,)':
|
|
||||||
keys["values"] = tuple()
|
|
||||||
except VariableCalculationDependencyError:
|
|
||||||
keys["values"] = tuple()
|
|
||||||
if self.elt.type == "regexp":
|
if self.elt.type == "regexp":
|
||||||
self.object_type = "Regexp_" + self.option_name
|
self.object_type = "Regexp_" + self.option_name
|
||||||
self.tiramisu.text["header"].append(
|
self.tiramisu.text["header"].append(
|
||||||
|
|
@ -544,10 +537,7 @@ class Family(Common):
|
||||||
if self.group_type:
|
if self.group_type:
|
||||||
keys["group_type"] = self.group_type
|
keys["group_type"] = self.group_type
|
||||||
if self.elt.type == "dynamic":
|
if self.elt.type == "dynamic":
|
||||||
try:
|
keys["identifiers"] = self.populate_calculation(self.elt.dynamic)
|
||||||
keys["identifiers"] = self.populate_calculation(self.elt.dynamic)
|
|
||||||
except VariableCalculationDependencyError:
|
|
||||||
keys["identifiers"] = []
|
|
||||||
children = []
|
children = []
|
||||||
for path in self.objectspace.parents[self.elt.path]:
|
for path in self.objectspace.parents[self.elt.path]:
|
||||||
children.append(self.objectspace.paths[path])
|
children.append(self.objectspace.paths[path])
|
||||||
|
|
|
||||||
|
|
@ -433,7 +433,7 @@ class ConvertDynOptionDescription(DynOptionDescription):
|
||||||
if "{{ identifier }}" in display:
|
if "{{ identifier }}" in display:
|
||||||
return display.replace(
|
return display.replace(
|
||||||
"{{ identifier }}",
|
"{{ identifier }}",
|
||||||
self.convert_identifier_to_path(self.get_identifiers(subconfig, from_display_name=True)[-1]),
|
self.convert_identifier_to_path(self.get_identifiers(subconfig)[-1]),
|
||||||
)
|
)
|
||||||
return display
|
return display
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue