Commit 20352b61 by Frost Ming Committed by GitHub

fix: wrong nested table level when overwriting pyproject (#6512)

Previously, we rely on the `display_name` stored with `tomlkit.Table`,
which is an internal implementation detail, and it breaks
https://github.com/sdispater/tomlkit/pull/234. This PR corrects the
nested table level, because `preserved` map comes from the poetry config
table.
parent 1242fac5
...@@ -75,7 +75,7 @@ class SelfCommand(InstallerCommand): ...@@ -75,7 +75,7 @@ class SelfCommand(InstallerCommand):
content = Factory.create_pyproject_from_package(package=package) content = Factory.create_pyproject_from_package(package=package)
for key in preserved: for key in preserved:
content[key] = preserved[key] content["tool"]["poetry"][key] = preserved[key] # type: ignore[index]
self.system_pyproject.write_text(content.as_string(), encoding="utf-8") self.system_pyproject.write_text(content.as_string(), encoding="utf-8")
......
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