Skip to content

Commit 20414ba

Browse files
committed
fix(factory): unwrap config to not end up with tomlkit instances
1 parent a43b3b5 commit 20414ba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/poetry/core/factory.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,18 @@ def create_poetry(
5656
raise RuntimeError("The Poetry configuration is invalid:\n" + message)
5757

5858
# Load package
59+
# Convert `tomlkit` attributes to bare Python object representations.
60+
# Cast can be removed once tomlkit is bumped to > 0.11.4 (PR: https://github.com/sdispater/tomlkit/pull/229).
61+
unwrapped_local_config = cast("dict[str, Any]", local_config.unwrap())
62+
5963
name = cast(str, local_config["name"])
6064
version = cast(str, local_config["version"])
6165
package = self.get_package(name, version)
6266
package = self.configure_package(
63-
package, local_config, poetry_file.parent, with_groups=with_groups
67+
package, unwrapped_local_config, poetry_file.parent, with_groups=with_groups
6468
)
6569

66-
return Poetry(poetry_file, local_config, package)
70+
return Poetry(poetry_file, unwrapped_local_config, package)
6771

6872
@classmethod
6973
def get_package(cls, name: str, version: str) -> ProjectPackage:

0 commit comments

Comments
 (0)