Commit a13ccf88 by Arun Babu Neelicattu Committed by Randy Döring

tomlkit: use is_super_table parameter

parent dad4edc4
...@@ -128,9 +128,9 @@ You can specify a package in the following forms: ...@@ -128,9 +128,9 @@ You can specify a package in the following forms:
section = poetry_content["dependencies"] section = poetry_content["dependencies"]
else: else:
if "group" not in poetry_content: if "group" not in poetry_content:
group_table = table() poetry_content.value._insert_after(
group_table._is_super_table = True "dependencies", "group", table(is_super_table=True)
poetry_content.value._insert_after("dependencies", "group", group_table) )
groups = poetry_content["group"] groups = poetry_content["group"]
if group not in groups: if group not in groups:
......
...@@ -208,9 +208,7 @@ class Factory(BaseFactory): ...@@ -208,9 +208,7 @@ class Factory(BaseFactory):
pyproject: dict[str, Any] = tomlkit.document() pyproject: dict[str, Any] = tomlkit.document()
tool_table = tomlkit.table() pyproject["tool"] = tomlkit.table(is_super_table=True)
tool_table._is_super_table = True
pyproject["tool"] = tool_table
content: dict[str, Any] = tomlkit.table() content: dict[str, Any] = tomlkit.table()
pyproject["tool"]["poetry"] = content pyproject["tool"]["poetry"] = content
...@@ -286,14 +284,10 @@ class Factory(BaseFactory): ...@@ -286,14 +284,10 @@ class Factory(BaseFactory):
dependency_section[dep.name] = constraint dependency_section[dep.name] = constraint
else: else:
if "group" not in content: if "group" not in content:
_table = tomlkit.table() content["group"] = tomlkit.table(is_super_table=True)
_table._is_super_table = True
content["group"] = _table
if group not in content["group"]: if group not in content["group"]:
_table = tomlkit.table() content["group"][group] = tomlkit.table(is_super_table=True)
_table._is_super_table = True
content["group"][group] = _table
if "dependencies" not in content["group"][group]: if "dependencies" not in content["group"][group]:
content["group"][group]["dependencies"] = tomlkit.table() content["group"][group]["dependencies"] = tomlkit.table()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment