Skip to content

v8.2.0

Latest

Choose a tag to compare

@kkozik-amplify kkozik-amplify released this 09 Nov 14:50
· 3 commits to main since this release
bdaf508

What's Changed

Changed

  • Breaking for direct cli.* imports. The CLI modules moved from a top-level cli package
    to hcl2.cli, so installing python-hcl2 no longer claims the generic top-level cli name.
    Since 8.0 the distribution installed cli/ into site-packages, where it collided with
    projects that have a top-level cli package of their own and made their cli.* imports
    resolve to the wrong module. The hcl2tojson, jsontohcl2, and hq commands and
    python -m hcl2 are unaffected; only code importing cli.hcl_to_json, cli.json_to_hcl,
    cli.hq, or cli.helpers needs to add the hcl2. prefix. No compatibility shim ships,
    because a shim would still occupy the colliding name.
    (#359)
  • The redundant cli/py.typed marker is gone; hcl2/py.typed already covers hcl2.cli.
    (#359)
  • Breaking for direct hcl2.utils.SerializationContext users. The context is now a frozen
    dataclass and SerializationContext.modify() is removed. Use context.replace(...) to derive
    a child context; subclasses must also be declared @dataclass(frozen=True).
    (#344)
  • StartRule, BodyRule, BlockRule and AttributeRule now pass a caller-supplied
    SerializationContext down to their children instead of discarding it, so a non-default
    context (e.g. inside_dollar_string=True) passed to StartRule.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/loads calls no longer corrupt each other's results. All rules shared one
    default SerializationContext that 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