Skip to content

v1.3.0

Choose a tag to compare

@hf-kklein hf-kklein released this 12 Apr 13:57
· 43 commits to main since this release
15574c7

Highlights

This release introduces AhbContext — a new way to use ahbicht without the global python-inject dependency injection container. All public entry points now accept an optional ahb_context parameter. The existing inject-based API is fully preserved and unchanged.

Migration Guide

Before (inject-based, still works)

import inject
from ahbicht.content_evaluation.token_logic_provider import SingletonTokenLogicProvider, TokenLogicProvider
from ahbicht.content_evaluation.evaluationdatatypes import EvaluatableDataProvider

inject.clear_and_configure(
    lambda binder: binder
        .bind(TokenLogicProvider, SingletonTokenLogicProvider([...]))
        .bind_to_provider(EvaluatableDataProvider, my_provider_func)
)
tree = await parse_expression_including_unresolved_subexpressions(expr, resolve_packages=True)
result = await evaluate_ahb_expression_tree(tree)

After (AhbContext, recommended)

from ahbicht.content_evaluation.ahb_context import AhbContext

ctx = AhbContext.from_content_evaluation_result(
    cer, EdifactFormat.UTILMD, EdifactFormatVersion.FV2210
)
tree = await parse_expression_including_unresolved_subexpressions(
    expr, resolve_packages=True, ahb_context=ctx
)
result = await evaluate_ahb_expression_tree(tree, ahb_context=ctx)

No inject, no TokenLogicProvider, no EvaluatableDataProvider, no ContextVars.

For custom evaluators (e.g. message validators)

ctx = AhbContext(
    rc_evaluator=MyRcEvaluator(),
    fc_evaluator=MyFcEvaluator(),
    hints_provider=MyHintsProvider(),
    package_resolver=MyPackageResolver(),
    evaluatable_data=my_data,
)

Functions that accept ahb_context

Function Module
parse_expression_including_unresolved_subexpressions expressions.expression_resolver
evaluate_ahb_expression_tree expressions.ahb_expression_evaluation
extract_categorized_keys expressions.condition_expression_parser
is_valid_expression content_evaluation.expression_check

What's NOT changing (yet)

  • The python-inject dependency is still included
  • The old inject-based API still works exactly as before
  • Existing consumers do not need to change anything

The inject-based API will be deprecated in a future minor release and removed in v2.0.0.


What's Changed

  • chore(deps-dev): bump coverage from 7.13.0 to 7.13.1 by @dependabot[bot] in #717
  • chore(deps-dev): bump pytest-datafiles from 3.0.0 to 3.0.1 by @dependabot[bot] in #719
  • chore(deps-dev): bump certifi from 2025.11.12 to 2026.1.4 by @dependabot[bot] in #718
  • chore(deps): bump urllib3 from 2.6.2 to 2.6.3 in /dev_requirements by @dependabot[bot] in #721
  • chore(deps-dev): bump sphinx-rtd-theme from 3.0.2 to 3.1.0 by @dependabot[bot] in #722
  • chore(deps-dev): bump build from 1.3.0 to 1.4.0 by @dependabot[bot] in #723
  • chore(deps-dev): bump packaging from 25.0 to 26.0 by @dependabot[bot] in #725
  • chore(deps-dev): bump setuptools from 80.9.0 to 80.10.2 by @dependabot[bot] in #726
  • chore(deps-dev): bump coverage from 7.13.1 to 7.13.2 by @dependabot[bot] in #727
  • chore(deps-dev): bump babel from 2.17.0 to 2.18.0 by @dependabot[bot] in #728
  • chore(deps-dev): bump setuptools from 80.10.2 to 82.0.0 by @dependabot[bot] in #729
  • chore(deps-dev): bump coverage from 7.13.2 to 7.13.4 by @dependabot[bot] in #730
  • Bump isort 7.0.0→8.0.0 and pylint 4.0.4→4.0.5 to fix dependency conflict by @Copilot in #735
  • chore(deps-dev): bump black[jupyter] from 25.12.0 to 26.1.0 by @dependabot[bot] in #724
  • chore(deps-dev): bump certifi from 2026.1.4 to 2026.2.25 by @dependabot[bot] in #738
  • chore(deps): bump requests from 2.32.5 to 2.33.0 in /dev_requirements by @dependabot[bot] in #741
  • chore(deps): bump pygments from 2.19.2 to 2.20.0 in /dev_requirements by @dependabot[bot] in #742
  • feat: add AhbContext dataclass for explicit dependency passing (w/o using it anywhere yet) by @hf-kklein in #743
  • chore(deps-dev): bump isort from 8.0.0 to 8.0.1 by @dependabot[bot] in #740
  • feat: thread AhbContext through ConditionNodeBuilder (dual-path) by @hf-kklein in #744
  • chore(deps-dev): bump charset-normalizer from 3.4.4 to 3.4.5 by @dependabot[bot] in #739
  • feat: thread AhbContext through requirement_constraint_evaluation by @hf-kklein in #745
  • feat: thread AhbContext through format_constraint_evaluation by @hf-kklein in #746
  • feat: thread AhbContext through PackageExpansionTransformer by @hf-kklein in #747
  • feat: thread AhbContext through evaluate_ahb_expression_tree (milestone) by @hf-kklein in #748
  • feat: thread AhbContext through supporting functions + update notebook by @hf-kklein in #749

Full Changelog: v1.2.0...v1.3.0