Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion comprehensiveconfig/toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ def format_value(cls, field, value) -> str:
match value:
case bool():
return "true" if value else "false"
case int() | float() | Path():
case int() | float():
return str(value)
case str():
return f'"{escape(value)}"'
case Path():
return f'"{escape(str(value).replace("\\", "/"))}"'
case list():
return f"[{", ".join([str(cls.format_value(field, inner_val)) for inner_val in value])}]"
case dict():
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "comprehensiveconfig"
version = "1.2.0"
version = "1.2.1"
description = "A library to create ergonomic, auto-validated configuration models with great support for static type annotations."
readme = "readme.md"
requires-python = ">=3.12"
Expand Down
Loading