Skip to content

Commit e091fcf

Browse files
committed
fix(factory): unwrap config to avoid tomlkit instances
1 parent 743e09c commit e091fcf

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/poetry/core/factory.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def create_poetry(
4343
from poetry.core.pyproject.toml import PyProjectTOML
4444

4545
poetry_file = self.locate(cwd)
46-
local_config = PyProjectTOML(path=poetry_file).poetry_config
46+
local_config = PyProjectTOML(path=poetry_file).poetry_config.unwrap()
4747

4848
# Checking validity
4949
check_result = self.validate(local_config)
@@ -55,11 +55,7 @@ def create_poetry(
5555
raise RuntimeError("The Poetry configuration is invalid:\n" + message)
5656

5757
# Load package
58-
name = local_config["name"]
59-
assert isinstance(name, str)
60-
version = local_config["version"]
61-
assert isinstance(version, str)
62-
package = self.get_package(name, version)
58+
package = self.get_package(local_config["name"], local_config["version"])
6359
package = self.configure_package(
6460
package, local_config, poetry_file.parent, with_groups=with_groups
6561
)

0 commit comments

Comments
 (0)