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: 2 additions & 2 deletions comprehensiveconfig/toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ def dump_section(cls, node) -> list[str]:
def format_value(cls, field, value) -> str:
"""Format individual values into properly represented strings of valid toml values."""
match value:
case int() | float():
return str(value)
case bool():
return "true" if value else "false"
case int() | float():
return str(value)
case str():
return f'"{escape(value)}"'
case list():
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.1.1"
version = "1.1.2"
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
2 changes: 2 additions & 0 deletions testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from comprehensiveconfig import ConfigSpec
from comprehensiveconfig.json import JsonWriter
from comprehensiveconfig.spec import (
Boolean,
Table,
TableSpec,
Section,
Expand Down Expand Up @@ -47,6 +48,7 @@ class Credentials(Section, name="Credentials"):
password = Text("MyPassword")

some_field = Float(6.9)
some_bool = Boolean(True)
example_list_field = List(
["12", "13", "14", 22], inner_type=Text(regex=r"[0-9]*") | Integer()
)
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading