Skip to content

Commit

Permalink
fix(setup): tomlkit uses custom types which broke setup
Browse files Browse the repository at this point in the history
  • Loading branch information
robinvandernoord committed Dec 5, 2023
1 parent 7f3dbb3 commit 7a6eca1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/typedal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from pathlib import Path
from typing import Optional

import tomli
from configuraptor import asdict
from configuraptor.alias import is_alias
from configuraptor.helpers import is_optional
Expand Down Expand Up @@ -122,7 +123,6 @@ def get_question(prop: str, annotation: typing.Type[T], default: T | None) -> Op
default = typing.cast(T, str(default))

response = questionary.unsafe_prompt([question], default=default)[prop]

return typing.cast(T, response)


Expand Down Expand Up @@ -150,7 +150,8 @@ def setup(
toml_path.touch()

toml_contents = toml_path.read_text()
toml_obj: dict[str, typing.Any] = tomlkit.loads(toml_contents)
# tomli has native Python types, tomlkit doesn't but preserves comments
toml_obj: dict[str, typing.Any] = tomli.loads(toml_contents)

if "[tool.typedal]" in toml_contents:
section = toml_obj["tool"]["typedal"]
Expand Down

0 comments on commit 7a6eca1

Please sign in to comment.