Source: python-omegaconf
Version: 2.3.0-2
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: [email protected]
Usertags: ftbfs-20250107 ftbfs-trixie
Hi,
During a rebuild of all packages in sid, your package failed to build
on amd64.
Relevant part (hopefully):
> =================================== FAILURES
> ===================================
> ____ test_errors[typed_DictConfig:assign_with_invalid_value,path_to_float]
> _____
>
> expected = Expected(exception_type=<class
> 'omegaconf.errors.ValidationError'>, msg="Value 'hello.txt' of type
> 'pathlib.(Posix|Win..., parent_node=<function Expected.<lambda> at
> 0x7f8ce9054d60>, object_type_str='dict', ref_type_str='AUTO', num_lines=2)
> monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f8ce9073ee0>
>
> @mark.parametrize("expected", params)
> def test_errors(expected: Expected, monkeypatch: Any) -> None:
> monkeypatch.setenv("OC_CAUSE", "0")
> cfg = expected.create()
> expected.finalize(cfg)
> if expected.msg_is_regex:
> match = expected.msg
> else:
> match = re.escape(expected.msg)
>
> with raises(expected.exception_type, match=match) as einfo:
> try:
> expected.op(cfg)
> except Exception as e:
> # helps in debugging
> > raise e
>
> tests/test_errors.py:1602:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _
> tests/test_errors.py:1599: in test_errors
> expected.op(cfg)
> tests/test_errors.py:719: in <lambda>
> op=lambda cfg: cfg.__setattr__("bar", Path("hello.txt")),
> omegaconf/dictconfig.py:338: in __setattr__
> self._format_and_raise(key=key, value=value, cause=e)
> omegaconf/base.py:231: in _format_and_raise
> format_and_raise(
> omegaconf/_utils.py:899: in format_and_raise
> _raise(ex, cause)
> omegaconf/_utils.py:797: in _raise
> raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for
> full trace
> omegaconf/dictconfig.py:334: in __setattr__
> self.__set_impl(key, value)
> omegaconf/dictconfig.py:318: in __set_impl
> self._set_item_impl(key, value)
> omegaconf/basecontainer.py:604: in _set_item_impl
> self.__dict__["_content"][key]._set_value(value)
> omegaconf/nodes.py:46: in _set_value
> self._val = self.validate_and_convert(value)
> omegaconf/nodes.py:76: in validate_and_convert
> return self._validate_and_convert_impl(value)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _
>
> self = 123.456, value = PosixPath('hello.txt')
>
> def _validate_and_convert_impl(self, value: Any) -> float:
> try:
> if type(value) in (float, str, int):
> return float(value)
> else:
> raise ValueError()
> except ValueError:
> > raise ValidationError(
> "Value '$VALUE' of type '$VALUE_TYPE' could not be converted
> to Float"
> )
> E omegaconf.errors.ValidationError: Value 'hello.txt' of type
> 'pathlib._local.PosixPath' could not be converted to Float
> E full_key: bar
> E object_type=dict
>
> omegaconf/nodes.py:345: ValidationError
>
> During handling of the above exception, another exception occurred:
>
> expected = Expected(exception_type=<class
> 'omegaconf.errors.ValidationError'>, msg="Value 'hello.txt' of type
> 'pathlib.(Posix|Win..., parent_node=<function Expected.<lambda> at
> 0x7f8ce9054d60>, object_type_str='dict', ref_type_str='AUTO', num_lines=2)
> monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f8ce9073ee0>
>
> @mark.parametrize("expected", params)
> def test_errors(expected: Expected, monkeypatch: Any) -> None:
> monkeypatch.setenv("OC_CAUSE", "0")
> cfg = expected.create()
> expected.finalize(cfg)
> if expected.msg_is_regex:
> match = expected.msg
> else:
> match = re.escape(expected.msg)
>
> > with raises(expected.exception_type, match=match) as einfo:
> E AssertionError: Regex pattern did not match.
> E Regex: "Value 'hello.txt' of type 'pathlib.(Posix|Windows)Path'
> could not be converted to Float"
> E Input: "Value 'hello.txt' of type 'pathlib._local.PosixPath' could
> not be converted to Float\n full_key: bar\n object_type=dict"
>
> tests/test_errors.py:1597: AssertionError
> _ test_to_yaml[input_4-path_value: !!python/object/apply:pathlib.PosixPath\n-
> hello.txt\n] _
>
> input_ = {'path_value': PosixPath('hello.txt')}
> expected = 'path_value: !!python/object/apply:pathlib.PosixPath\n-
> hello.txt\n'
>
> @mark.parametrize(
> "input_, expected",
> [
> (["item1", "item2", {"key3": "value3"}], "- item1\n- item2\n-
> key3: value3\n"),
> ({"hello": "world", "list": [1, 2]}, "hello: world\nlist:\n- 1\n-
> 2\n"),
> ({"abc": "str key"}, "abc: str key\n"),
> ({b"abc": "bytes key"}, "? !!binary |\n YWJj\n: bytes key\n"),
> (
> {"path_value": Path("hello.txt")},
> "path_value: !!python/object/apply:pathlib.WindowsPath\n-
> hello.txt\n"
> if platform.system() == "Windows"
> else "path_value: !!python/object/apply:pathlib.PosixPath\n-
> hello.txt\n",
> ),
> ({123: "int key"}, "123: int key\n"),
> ({123.45: "float key"}, "123.45: float key\n"),
> ({True: "bool key", False: "another"}, "true: bool key\nfalse:
> another\n"),
> ],
> )
> def test_to_yaml(input_: Any, expected: str) -> None:
> c = OmegaConf.create(input_)
> as_yaml = OmegaConf.to_yaml(c)
> > assert as_yaml == expected
> E AssertionError: assert 'path_value: ...- hello.txt\n' == 'path_value:
> ...- hello.txt\n'
> E
> E - path_value: !!python/object/apply:pathlib.PosixPath
> E + path_value: !!python/object/apply:pathlib._local.PosixPath
> E ? +++++++
> E - hello.txt
>
> tests/test_to_yaml.py:34: AssertionError
> _________________ test_type_str[Path-True-pathlib.Path-False]
> __________________
>
> type_ = <class 'pathlib._local.Path'>, include_module_name = True
> expected = 'pathlib.Path', optional = False
>
> @mark.parametrize("optional", [False, True])
> @mark.parametrize(
> "type_, include_module_name, expected",
> [
> (int, False, "int"),
> (int, True, "int"),
> (bool, False, "bool"),
> (bool, True, "bool"),
> (bytes, False, "bytes"),
> (bytes, True, "bytes"),
> (float, False, "float"),
> (float, True, "float"),
> (str, False, "str"),
> (str, True, "str"),
> (Path, False, "Path"),
> (Path, True, "pathlib.Path"),
> (Color, False, "Color"),
> (Color, True, "tests.Color"),
> (DictConfig, False, "DictConfig"),
> (DictConfig, True, "DictConfig"),
> (ListConfig, False, "ListConfig"),
> (ListConfig, True, "ListConfig"),
> (Dict[str, str], False, "Dict[str, str]"),
> (Dict[str, str], True, "Dict[str, str]"),
> (Dict[Color, int], False, "Dict[Color, int]"),
> (Dict[Color, int], True, "Dict[tests.Color, int]"),
> (Dict[str, Plugin], False, "Dict[str, Plugin]"),
> (Dict[str, Plugin], True, "Dict[str, tests.Plugin]"),
> (Dict[str, List[Plugin]], False, "Dict[str, List[Plugin]]"),
> (Dict[str, List[Plugin]], True, "Dict[str, List[tests.Plugin]]"),
> (dict, False, "dict"),
> (dict, True, "dict"),
> (List[str], False, "List[str]"),
> (List[str], True, "List[str]"),
> (List[Color], False, "List[Color]"),
> (List[Color], True, "List[tests.Color]"),
> (List[Dict[str, Color]], False, "List[Dict[str, Color]]"),
> (List[Dict[str, Color]], True, "List[Dict[str, tests.Color]]"),
> (list, False, "list"),
> (list, True, "list"),
> (Tuple[str], False, "Tuple[str]"),
> (Tuple[str], True, "Tuple[str]"),
> (Tuple[str, int], False, "Tuple[str, int]"),
> (Tuple[str, int], True, "Tuple[str, int]"),
> (Tuple[float, ...], False, "Tuple[float, ...]"),
> (Tuple[float, ...], True, "Tuple[float, ...]"),
> (tuple, False, "tuple"),
> (tuple, True, "tuple"),
> (Union[str, int, Color], False, "Union[str, int, Color]"),
> (Union[str, int, Color], True, "Union[str, int, tests.Color]"),
> (Union[int], False, "int"),
> (Union[int], True, "int"),
> (IllegalType, False, "IllegalType"),
> (IllegalType, True, "tests.IllegalType"),
> (IllegalTypeGeneric, False, "IllegalTypeGeneric"),
> (IllegalTypeGeneric, True, "tests.IllegalTypeGeneric"),
> (IllegalTypeGeneric[int], False, "IllegalTypeGeneric[int]"),
> (IllegalTypeGeneric[int], True, "tests.IllegalTypeGeneric[int]"),
> ],
> )
> def test_type_str(
> type_: Any, include_module_name: bool, expected: str, optional: bool
> ) -> None:
> if optional:
> assert (
> _utils.type_str(Optional[type_],
> include_module_name=include_module_name)
> == f"Optional[{expected}]"
> )
> else:
> > assert (
> _utils.type_str(type_,
> include_module_name=include_module_name) == expected
> )
> E AssertionError: assert 'pathlib._local.Path' == 'pathlib.Path'
> E
> E - pathlib.Path
> E + pathlib._local.Path
> E ? +++++++
>
> tests/test_utils.py:657: AssertionError
> __________________ test_type_str[Path-True-pathlib.Path-True]
> __________________
>
> type_ = <class 'pathlib._local.Path'>, include_module_name = True
> expected = 'pathlib.Path', optional = True
>
> @mark.parametrize("optional", [False, True])
> @mark.parametrize(
> "type_, include_module_name, expected",
> [
> (int, False, "int"),
> (int, True, "int"),
> (bool, False, "bool"),
> (bool, True, "bool"),
> (bytes, False, "bytes"),
> (bytes, True, "bytes"),
> (float, False, "float"),
> (float, True, "float"),
> (str, False, "str"),
> (str, True, "str"),
> (Path, False, "Path"),
> (Path, True, "pathlib.Path"),
> (Color, False, "Color"),
> (Color, True, "tests.Color"),
> (DictConfig, False, "DictConfig"),
> (DictConfig, True, "DictConfig"),
> (ListConfig, False, "ListConfig"),
> (ListConfig, True, "ListConfig"),
> (Dict[str, str], False, "Dict[str, str]"),
> (Dict[str, str], True, "Dict[str, str]"),
> (Dict[Color, int], False, "Dict[Color, int]"),
> (Dict[Color, int], True, "Dict[tests.Color, int]"),
> (Dict[str, Plugin], False, "Dict[str, Plugin]"),
> (Dict[str, Plugin], True, "Dict[str, tests.Plugin]"),
> (Dict[str, List[Plugin]], False, "Dict[str, List[Plugin]]"),
> (Dict[str, List[Plugin]], True, "Dict[str, List[tests.Plugin]]"),
> (dict, False, "dict"),
> (dict, True, "dict"),
> (List[str], False, "List[str]"),
> (List[str], True, "List[str]"),
> (List[Color], False, "List[Color]"),
> (List[Color], True, "List[tests.Color]"),
> (List[Dict[str, Color]], False, "List[Dict[str, Color]]"),
> (List[Dict[str, Color]], True, "List[Dict[str, tests.Color]]"),
> (list, False, "list"),
> (list, True, "list"),
> (Tuple[str], False, "Tuple[str]"),
> (Tuple[str], True, "Tuple[str]"),
> (Tuple[str, int], False, "Tuple[str, int]"),
> (Tuple[str, int], True, "Tuple[str, int]"),
> (Tuple[float, ...], False, "Tuple[float, ...]"),
> (Tuple[float, ...], True, "Tuple[float, ...]"),
> (tuple, False, "tuple"),
> (tuple, True, "tuple"),
> (Union[str, int, Color], False, "Union[str, int, Color]"),
> (Union[str, int, Color], True, "Union[str, int, tests.Color]"),
> (Union[int], False, "int"),
> (Union[int], True, "int"),
> (IllegalType, False, "IllegalType"),
> (IllegalType, True, "tests.IllegalType"),
> (IllegalTypeGeneric, False, "IllegalTypeGeneric"),
> (IllegalTypeGeneric, True, "tests.IllegalTypeGeneric"),
> (IllegalTypeGeneric[int], False, "IllegalTypeGeneric[int]"),
> (IllegalTypeGeneric[int], True, "tests.IllegalTypeGeneric[int]"),
> ],
> )
> def test_type_str(
> type_: Any, include_module_name: bool, expected: str, optional: bool
> ) -> None:
> if optional:
> > assert (
> _utils.type_str(Optional[type_],
> include_module_name=include_module_name)
> == f"Optional[{expected}]"
> )
> E AssertionError: assert 'Optional[pat...._local.Path]' ==
> 'Optional[pathlib.Path]'
> E
> E - Optional[pathlib.Path]
> E + Optional[pathlib._local.Path]
> E ? +++++++
>
> tests/test_utils.py:652: AssertionError
> =========================== short test summary info
> ============================
> FAILED
> tests/test_errors.py::test_errors[typed_DictConfig:assign_with_invalid_value,path_to_float]
> FAILED tests/test_to_yaml.py::test_to_yaml[input_4-path_value:
> !!python/object/apply:pathlib.PosixPath\n- hello.txt\n]
> FAILED tests/test_utils.py::test_type_str[Path-True-pathlib.Path-False] -
> Ass...
> FAILED tests/test_utils.py::test_type_str[Path-True-pathlib.Path-True] -
> Asse...
> =========== 4 failed, 7753 passed, 354 skipped, 8 xfailed in 13.67s
> ============
> make[1]: *** [debian/rules:26: override_dh_auto_install] Error 1
The full build log is available from:
http://qa-logs.debian.net/2025/01/07/python-omegaconf_2.3.0-2_unstable.log
All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20250107;[email protected]
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20250107&[email protected]&allbugs=1&cseverity=1&ctags=1&caffected=1#results
A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!
If you reassign this bug to another package, please mark it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects
If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.