Skip to content

Commit 38fa18f

Browse files
committed
fix: objects in config files
1 parent 5ec68e9 commit 38fa18f

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

docs/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 1.1.1
44
* enh: `list[tuple]` support (along with `list[tuple[int]]` and `list[tuple[int, ...]]`)
5+
* fix: objects in config files
56

67
## 1.1.0 (2025-09-12)
78
* CHANGED – some [`run`][mininterface.run] arguments are no longer positional and can only be passed as keyword arguments

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "mininterface"
7-
version = "1.1.0"
7+
version = "1.1.1"
88
description = "A minimal access to GUI, TUI, CLI and config"
99
authors = ["Edvard Rejthar <edvard.rejthar@nic.cz>"]
1010
license = "LGPL-3.0-or-later"

tests/test_run.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from tempfile import NamedTemporaryFile
12
from unittest import skipUnless
23
from mininterface import Mininterface
34
from mininterface._lib.config_file import _merge_settings
@@ -15,6 +16,7 @@
1516
MissingPositional,
1617
MissingPositionalScalar,
1718
MissingUnderscore,
19+
ParametrizedGeneric,
1820
SimpleEnv,
1921
)
2022
from dumb_settings import (
@@ -220,6 +222,17 @@ def test_complex_config(self):
220222
)
221223
self.assertEqual(pattern, runm(ComplexEnv, config_file="tests/complex.yaml").env)
222224

225+
def test_object_config(self):
226+
with NamedTemporaryFile(delete=False, mode="w", encoding="utf-8") as tmp:
227+
tmp.write("""paths:
228+
- /tmp
229+
- /var/log/syslog
230+
""")
231+
tmp.flush()
232+
env = runm(ParametrizedGeneric, config_file=tmp.name).env
233+
self.assertEqual(ParametrizedGeneric(paths=[Path('/tmp'), Path('/var/log/syslog')]), env)
234+
235+
223236
def test_run_annotated(self):
224237
m = run(FlagConversionOff[OmitArgPrefixes[SimpleEnv]])
225238
self.assertEqual(4, m.env.important_number)

0 commit comments

Comments
 (0)