structuredAttrs is enabled Sourcing python-remove-tests-dir-hook Sourcing python-catch-conflicts-hook.sh Sourcing python-remove-bin-bytecode-hook.sh Sourcing pypa-build-hook Using pypaBuildPhase Sourcing python-runtime-deps-check-hook Using pythonRuntimeDepsCheckHook Sourcing pypa-install-hook Using pypaInstallPhase Sourcing python-imports-check-hook.sh Using pythonImportsCheckPhase Sourcing python-namespaces-hook Sourcing python-catch-conflicts-hook.sh Sourcing pytest-check-hook Using pytestCheckPhase Running phase: unpackPhase unpacking source archive /nix/store/q0195y40sagkhxs4bfsalinkx3wv3yk7-source source root is source setting SOURCE_DATE_EPOCH to timestamp 315619200 of file "source/toml_sort/tomlsort.py" Running phase: patchPhase Running phase: updateAutotoolsGnuConfigScriptsPhase Running phase: configurePhase no configure script, doing nothing Running phase: buildPhase Executing pypaBuildPhase Creating a wheel... pypa build flags: --no-isolation --outdir dist/ --wheel * Getting build dependencies for wheel... * Building wheel... Successfully built toml_sort-0.24.4-py3-none-any.whl Finished creating a wheel... Finished executing pypaBuildPhase Running phase: pythonRuntimeDepsCheckHook Executing pythonRuntimeDepsCheck Checking runtime dependencies for toml_sort-0.24.4-py3-none-any.whl Finished executing pythonRuntimeDepsCheck Running phase: installPhase Executing pypaInstallPhase Successfully installed toml_sort-0.24.4-py3-none-any.whl Finished executing pypaInstallPhase Running phase: pythonOutputDistPhase Executing pythonOutputDistPhase Finished executing pythonOutputDistPhase Running phase: fixupPhase shrinking RPATHs of ELF executables and libraries in /nix/store/w44wik9bcx09rymks25miqgni37pymrw-toml-sort-0.24.4-dist checking for references to /build/ in /nix/store/w44wik9bcx09rymks25miqgni37pymrw-toml-sort-0.24.4-dist... patching script interpreter paths in /nix/store/w44wik9bcx09rymks25miqgni37pymrw-toml-sort-0.24.4-dist shrinking RPATHs of ELF executables and libraries in /nix/store/j2zjfaa5q7gydcp1b3llp44acnw4w1fy-toml-sort-0.24.4 checking for references to /build/ in /nix/store/j2zjfaa5q7gydcp1b3llp44acnw4w1fy-toml-sort-0.24.4... patching script interpreter paths in /nix/store/j2zjfaa5q7gydcp1b3llp44acnw4w1fy-toml-sort-0.24.4 stripping (with command strip and flags -S -p) in /nix/store/j2zjfaa5q7gydcp1b3llp44acnw4w1fy-toml-sort-0.24.4/lib /nix/store/j2zjfaa5q7gydcp1b3llp44acnw4w1fy-toml-sort-0.24.4/bin Rewriting #!/nix/store/lq2fsnmg0q3y0vlxn91w8s8wvj1m6fld-python3-3.14.8/bin/python3.14 to #!/nix/store/lq2fsnmg0q3y0vlxn91w8s8wvj1m6fld-python3-3.14.8 wrapping `/nix/store/j2zjfaa5q7gydcp1b3llp44acnw4w1fy-toml-sort-0.24.4/bin/toml-sort'... Executing pythonRemoveTestsDir Finished executing pythonRemoveTestsDir Running phase: installCheckPhase no Makefile or custom installCheckPhase, doing nothing Running phase: pythonCatchConflictsPhase Running phase: pythonRemoveBinBytecodePhase Running phase: pythonImportsCheckPhase Executing pythonImportsCheckPhase Running phase: pytestCheckPhase Executing pytestCheckPhase pytest flags: -m pytest ============================= test session starts ============================== platform linux -- Python 3.14.8, pytest-9.1.1, pluggy-1.6.0 rootdir: /build/source configfile: pyproject.toml collected 50 items tests/test_cli.py .x.................................. [ 72%] tests/test_toml_sort.py .F.........x.. [100%] =================================== FAILURES =================================== ______ test_tomlsort[gradle-version-catalog-gradle-version-catalog-args0] ______ get_fixture = .getter at 0x7ffff4f20f60> unsorted_fixture = 'gradle-version-catalog' sorted_fixture = 'gradle-version-catalog' args = {'sort_config': SortConfiguration(tables=False, table_keys=True, inline_tables=False, inline_arrays=False, ignore_case=False, first=[])} @pytest.mark.parametrize( "unsorted_fixture,sorted_fixture,args", [ ( "gradle-version-catalog", "gradle-version-catalog", { "sort_config": SortConfiguration( tables=False, ), }, ), ( "dotted-key", "dotted-key", { "sort_config": SortConfiguration( inline_arrays=True, inline_tables=True ), }, ), ( "inline", "inline", { "sort_config": SortConfiguration( inline_arrays=True, inline_tables=True ), }, ), ( "comment", "comment-comments-preserved", {"comment_config": CommentConfiguration(header=False, footer=False)}, ), ( "comment", "comment-no-comments", { "comment_config": CommentConfiguration( header=False, footer=False, block=False, inline=False, ) }, ), ( "comment", "comment-header-footer", { "sort_config": SortConfiguration(table_keys=False), "format_config": FormattingConfiguration( spaces_before_inline_comment=1 ), }, ), ( "from-toml-lang", "from-toml-lang", { "sort_config": SortConfiguration(table_keys=False), "format_config": FormattingConfiguration( spaces_before_inline_comment=1 ), }, ), ( "from-toml-lang", "from-toml-lang-overrides", { "sort_config": SortConfiguration( inline_arrays=True, inline_tables=True ), "format_config": FormattingConfiguration( spaces_before_inline_comment=1 ), "sort_config_overrides": { "servers.beta": SortOverrideConfiguration(table_keys=False), "clients.data": SortOverrideConfiguration(inline_arrays=False), }, }, ), ( "from-toml-lang", "from-toml-lang-first", { "sort_config": SortConfiguration( inline_arrays=True, inline_tables=True, first=["servers", "products"], ), "format_config": FormattingConfiguration( spaces_before_inline_comment=1 ), "sort_config_overrides": { "database": SortOverrideConfiguration(first=["ports"]), "owner": SortOverrideConfiguration(first=["name", "dob"]), "inline.c": SortOverrideConfiguration(first=["version"]), }, }, ), ( "pyproject-weird-order", "pyproject-weird-order", { "sort_config": SortConfiguration(table_keys=False), "comment_config": CommentConfiguration(block=False), "format_config": FormattingConfiguration( spaces_before_inline_comment=1 ), }, ), pytest.param( "weird", "weird", { "sort_config": SortConfiguration(table_keys=False), "comment_config": CommentConfiguration( block=False, ), "format_config": FormattingConfiguration( spaces_before_inline_comment=1 ), }, marks=[pytest.mark.xfail], ), pytest.param( "single-comment", "../single-comment", # Input is the same as the output {}, ), pytest.param( "empty", "empty", {}, ), ], ) def test_tomlsort( get_fixture: Callable[[str | List[str]], Path], unsorted_fixture: str, sorted_fixture: str, args: Dict[str, Any], ) -> None: """Output of TomlSort.sorted() function matches expected.""" path_unsorted = get_fixture(unsorted_fixture) path_sorted = get_fixture(["sorted", sorted_fixture]) toml_unsorted_fixture = path_unsorted.read_text() toml_sorted_fixture = path_sorted.read_text() > sort_output = TomlSort(toml_unsorted_fixture, **args).sorted() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_toml_sort.py:177: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ toml_sort/tomlsort.py:782: in sorted sorted_toml = self.toml_doc_sorted(toml_doc) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ toml_sort/tomlsort.py:768: in toml_doc_sorted self.toml_elements_sorted(item, sorted_document), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ toml_sort/tomlsort.py:576: in toml_elements_sorted for item in self.sorted_children_table(original.keys, original.children): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ toml_sort/tomlsort.py:526: in sorted_children_table non_tables = self.sort_items( toml_sort/tomlsort.py:493: in sort_items item.value = self.sort_item(item.keys, item.value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ toml_sort/tomlsort.py:419: in sort_item return self.sort_inline_table(keys, item, indent_depth=indent_depth) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ toml_sort/tomlsort.py:460: in sort_inline_table new_table.append( /nix/store/bl76sy7jca4a9w8652qkgjlj51m15gm0-python3.14-tomlkit-0.15.1/lib/python3.14/site-packages/tomlkit/items.py:2033: in append self._validate_child(_item) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = {'module': 'com.example:foo'}, _item = {'ref': 'fooVersion'} def _validate_child(self, _item: Item) -> None: if isinstance(_item, Table): > raise ValueError("Inline tables cannot contain a table") E ValueError: Inline tables cannot contain a table /nix/store/bl76sy7jca4a9w8652qkgjlj51m15gm0-python3.14-tomlkit-0.15.1/lib/python3.14/site-packages/tomlkit/items.py:2053: ValueError =========================== short test summary info ============================ FAILED tests/test_toml_sort.py::test_tomlsort[gradle-version-catalog-gradle-version-catalog-args0] - ValueError: Inline tables cannot contain a table =================== 1 failed, 47 passed, 2 xfailed in 1.69s ====================