Repository navigation
What's Changed
Changed
- Breaking for direct
cli.*imports. The CLI modules moved from a top-levelclipackage
tohcl2.cli, so installing python-hcl2 no longer claims the generic top-levelcliname.
Since 8.0 the distribution installedcli/intosite-packages, where it collided with
projects that have a top-levelclipackage of their own and made theircli.*imports
resolve to the wrong module. Thehcl2tojson,jsontohcl2, andhqcommands and
python -m hcl2are unaffected; only code importingcli.hcl_to_json,cli.json_to_hcl,
cli.hq, orcli.helpersneeds to add thehcl2.prefix. No compatibility shim ships,
because a shim would still occupy the colliding name.
(#359) - The redundant
cli/py.typedmarker is gone;hcl2/py.typedalready covershcl2.cli.
(#359) - Breaking for direct
hcl2.utils.SerializationContextusers. The context is now a frozen
dataclass andSerializationContext.modify()is removed. Usecontext.replace(...)to derive
a child context; subclasses must also be declared@dataclass(frozen=True).
(#344) StartRule,BodyRule,BlockRuleandAttributeRulenow pass a caller-supplied
SerializationContextdown to their children instead of discarding it, so a non-default
context (e.g.inside_dollar_string=True) passed toStartRule.serialize()now changes the
output.
Added
- Python 3.14 is now tested and declared as supported. No source changes were needed; the full
suite passes on 3.14 as-is.
(#360)
Fixed
- Concurrent
load/loadscalls no longer corrupt each other's results. All rules shared one
defaultSerializationContextthat was mutated in place during serialization, so a tuple or
object parsed in one thread could come back as its inline HCL source ('[1, 2, 3]') instead
of a list or dict, with no error raised. The context is now immutable, which also makes a
caller-supplied context safe to share across threads.
(#327,
#344)
Full Changelog: v8.1.4...v8.2.0