From 0ba63e1e128fb1fd4ad66d26a06eea4e2d6d104b Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 13 Mar 2026 08:28:02 +0100 Subject: [PATCH] =?UTF-8?q?bump:=20version=201.2.0a68=20=E2=86=92=201.2.0a?= =?UTF-8?q?69?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- rougail-base-pyproject.toml | 2 +- rougail-pyproject.toml | 4 ++-- src/rougail/__version__.py | 2 +- src/rougail/config/__init__.py | 10 ++++++++++ src/rougail/user_data.py | 23 +++++++++++++++++++++-- tests/test_types.py | 4 ++++ 8 files changed, 46 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7f6a18fc..e5813dd49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.2.0a69 (2026-03-13) + +### Fix + +- do not update name + ## 1.2.0a68 (2026-03-09) ### Fix diff --git a/pyproject.toml b/pyproject.toml index 8a5369fd9..9748bfba4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "rougail" -version = "1.2.0a68" +version = "1.2.0a69" [tool.commitizen] name = "cz_conventional_commits" diff --git a/rougail-base-pyproject.toml b/rougail-base-pyproject.toml index d635575e8..0b896cce4 100644 --- a/rougail-base-pyproject.toml +++ b/rougail-base-pyproject.toml @@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"] [project] name = "rougail-base" -version = "1.2.0a68" +version = "1.2.0a69" authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}] readme = "README.md" description = "A consistency handling system that was initially designed in the configuration management" diff --git a/rougail-pyproject.toml b/rougail-pyproject.toml index 04d924976..bdc998258 100644 --- a/rougail-pyproject.toml +++ b/rougail-pyproject.toml @@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"] [project] name = "rougail" -version = "1.2.0a68" +version = "1.2.0a69" 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.0a68", + "rougail-base == 1.2.0a69", ] [tool.flit.sdist] diff --git a/src/rougail/__version__.py b/src/rougail/__version__.py index 9fa5db4de..9d159ccc4 100644 --- a/src/rougail/__version__.py +++ b/src/rougail/__version__.py @@ -1 +1 @@ -__version__ = "1.2.0a68" +__version__ = "1.2.0a69" diff --git a/src/rougail/config/__init__.py b/src/rougail/config/__init__.py index 880727138..aa076ab0f 100644 --- a/src/rougail/config/__init__.py +++ b/src/rougail/config/__init__.py @@ -234,6 +234,16 @@ class RConfigLeadership: def __repr__(self): return dict(zip(self.leader, self.followers)) + def set_follower(self, key, idx, value): + self.config.property.read_write() + self.option.option(key, idx).value.set(value) + self.config.property.read_only() + + def reset(self): + self.config.property.read_write() + names = self.option.option("names").value.reset() + self.config.property.read_only() + class StaticRougailConvert(RougailConvert): def __init__( diff --git a/src/rougail/user_data.py b/src/rougail/user_data.py index 920af06b5..b4f03a55e 100644 --- a/src/rougail/user_data.py +++ b/src/rougail/user_data.py @@ -269,6 +269,8 @@ class UserData: if len_leader: for idx in range(len_leader - 1, -1, -1): option.value.pop(idx) + if value is undefined: + continue try: self.set_value(option, value, options, index) value_is_set = True @@ -417,6 +419,8 @@ class UserData: index_ = index else: index_ = None + if value is undefined: + continue self.set_value(option, value, options.get("options", {}), index_) except PropertiesOptionError as err: if err.code == "property-error": @@ -561,6 +565,14 @@ class UserData: if index is not None: option = option.index(index) add_validation = False + if isinstance(value, list) and undefined in value: + val = [] + for v in value: + if v is undefined: + val.append(None) + else: + val.append(v) + value = val option.value.set(value) if add_validation: option.property.add("validator") @@ -635,12 +647,19 @@ def _populate_mandatory(option, errors: list) -> None: try: option.value.get() except PropertiesOptionError as err: + index = err.subconfig.index if "empty" in err.proptype: msg = _("null is not a valid value for a multi") elif "mandatory" in err.proptype: - msg = _("mandatory variable but has no value") + if index is None: + msg = _("mandatory variable but has no value") + else: + msg = _('mandatory variable at index "{0}" but has no value').format(index) else: - msg = _("mandatory variable but is inaccessible and has no value or has null in value") + if index is None: + msg = _("mandatory variable but is inaccessible and has no value or has null in value") + else: + msg = _('mandatory variable at index "{0}" but is inaccessible and has no value or has null in value').format(index) else: proptype = option.value.mandatory(return_type=True) if proptype == "empty": diff --git a/tests/test_types.py b/tests/test_types.py index a77da6a1b..0c7199168 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -135,3 +135,7 @@ def test_type_error_version(): with raises(DictConsistencyError) as err: type_variable("error_version") assert err.errno == 27 + + +def test_type_family_name_description(): + type_variable("family_name_description")