Compare commits

...

2 commits

8 changed files with 20 additions and 8 deletions

View file

@ -1,3 +1,9 @@
## 1.2.0a29 (2025-06-20)
### Fix
- UserDatas, do now set modified option in second round
## 1.2.0a28 (2025-06-18) ## 1.2.0a28 (2025-06-18)
### Fix ### Fix

View file

@ -1,6 +1,6 @@
[project] [project]
name = "rougail" name = "rougail"
version = "1.2.0a28" version = "1.2.0a29"
[tool.commitizen] [tool.commitizen]
name = "cz_conventional_commits" name = "cz_conventional_commits"

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "rougail-base" name = "rougail-base"
version = "1.2.0a28" version = "1.2.0a29"
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"

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "rougail" name = "rougail"
version = "1.2.0a28" version = "1.2.0a29"
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.0a28", "rougail-base == 1.2.0a29",
] ]
[tool.flit.sdist] [tool.flit.sdist]

View file

@ -1 +1 @@
__version__ = "1.2.0a28" __version__ = "1.2.0a29"

View file

@ -28,13 +28,12 @@ from pydantic import (
) )
import tiramisu import tiramisu
from tiramisu.config import get_common_path from tiramisu.config import get_common_path
from ..utils import get_jinja_variable_to_param, calc_multi_for_type_variable, undefined from ..utils import get_jinja_variable_to_param, calc_multi_for_type_variable, undefined, PROPERTY_ATTRIBUTE
from ..i18n import _ from ..i18n import _
from ..error import DictConsistencyError, VariableCalculationDependencyError from ..error import DictConsistencyError, VariableCalculationDependencyError
from ..tiramisu import CONVERT_OPTION from ..tiramisu import CONVERT_OPTION
BASETYPE = Union[StrictBool, StrictInt, StrictFloat, StrictStr, None] BASETYPE = Union[StrictBool, StrictInt, StrictFloat, StrictStr, None]
PROPERTY_ATTRIBUTE = ["frozen", "hidden", "disabled", "mandatory"]
def get_convert_option_types(): def get_convert_option_types():

View file

@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from typing import List from typing import List
from re import findall from re import findall
from tiramisu import Calculation from tiramisu import Calculation, owners
from tiramisu.error import ( from tiramisu.error import (
PropertiesOptionError, PropertiesOptionError,
AttributeOptionError, AttributeOptionError,
@ -46,11 +46,13 @@ class UserDatas:
*, *,
return_values_not_error=False, return_values_not_error=False,
user_datas_type: str="user_datas", user_datas_type: str="user_datas",
only_default: bool=False,
): ):
self.values = {} self.values = {}
self.errors = [] self.errors = []
self.warnings = [] self.warnings = []
self.show_secrets = False self.show_secrets = False
self.only_default = only_default
if user_datas_type == "user_datas": if user_datas_type == "user_datas":
self._populate_values(user_datas) self._populate_values(user_datas)
else: else:
@ -198,6 +200,9 @@ class UserDatas:
path = option.path() path = option.path()
if path not in self.values: if path not in self.values:
continue continue
if self.only_default and option.owner.get() != owners.default:
self.values.pop(path)
continue
options = self.values[path].get("options", {}) options = self.values[path].get("options", {})
if ( if (
options.get("allow_secrets_variables", True) is False options.get("allow_secrets_variables", True) is False

View file

@ -44,6 +44,8 @@ from .error import DictConsistencyError
NAME_REGEXP = re.compile(r"^[a-z0-9_]*$") NAME_REGEXP = re.compile(r"^[a-z0-9_]*$")
PROPERTY_ATTRIBUTE = ["frozen", "hidden", "disabled", "mandatory"]
def valid_variable_family_name( def valid_variable_family_name(
name: str, name: str,