From 4459bda874defb30caa956505c46db3c288b3bf8 Mon Sep 17 00:00:00 2001 From: Abby Austin <38941820+spidertyler2005@users.noreply.github.com> Date: Mon, 18 May 2026 13:17:16 -0400 Subject: [PATCH] fix order of types in TomlWriter.format_value (bugfix) --- comprehensiveconfig/toml.py | 4 ++-- pyproject.toml | 2 +- testing.py | 2 ++ uv.lock | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/comprehensiveconfig/toml.py b/comprehensiveconfig/toml.py index b607b28..3b4001b 100644 --- a/comprehensiveconfig/toml.py +++ b/comprehensiveconfig/toml.py @@ -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(): diff --git a/pyproject.toml b/pyproject.toml index f87a137..df7f775 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/testing.py b/testing.py index a2d3838..305dec9 100644 --- a/testing.py +++ b/testing.py @@ -3,6 +3,7 @@ from comprehensiveconfig import ConfigSpec from comprehensiveconfig.json import JsonWriter from comprehensiveconfig.spec import ( + Boolean, Table, TableSpec, Section, @@ -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() ) diff --git a/uv.lock b/uv.lock index d754b7d..b2bb215 100644 --- a/uv.lock +++ b/uv.lock @@ -138,7 +138,7 @@ wheels = [ [[package]] name = "comprehensiveconfig" -version = "1.0.1" +version = "1.1.2" source = { virtual = "." } [package.dev-dependencies]