Skip to content

feat!: remove python-inject dependency#752

Merged
hf-kklein merged 4 commits into
mainfrom
feat/remove-python-inject-v2
Apr 12, 2026
Merged

feat!: remove python-inject dependency#752
hf-kklein merged 4 commits into
mainfrom
feat/remove-python-inject-v2

Conversation

@hf-kklein
Copy link
Copy Markdown
Contributor

Summary

  • Remove inject from pyproject.toml dependencies and all source/test code
  • Make ahb_context: AhbContext a required parameter on all evaluation entry points (evaluate_ahb_expression_tree, requirement_constraint_evaluation, format_constraint_evaluation, ConditionNodeBuilder, etc.)
  • Remove EvaluatableDataProvider class, create_and_inject_hardcoded_evaluators function, all @inject.params decorators, and the inject.InjectorException catch in Evaluator.__init__
  • Update all 12 test files to use AhbContext directly instead of inject.configure / inject.clear
  • Delete test_warning_when_using_inject_attr.py (no longer relevant)
  • Update minimal_working_example.ipynb to use only AhbContext-based API
  • Net reduction: 393 insertions, 1025 deletions (-632 lines)

This is PR 12 in the AhbContext migration series. All previous PRs added dual-path support (inject fallback + AhbContext). This PR removes the fallback entirely.

BREAKING CHANGE

python-inject is no longer a dependency. All functions that previously used inject now require an explicit AhbContext parameter. See the v1.3.0 release notes for migration instructions.

Functions where ahb_context remains Optional[AhbContext] = None:

  • parse_expression_including_unresolved_subexpressions (only needed when resolve_packages=True)
  • extract_categorized_keys (only needed when resolve_packages=True)
  • expand_packages

Test plan

  • All 536 tests pass (pytest unittests/ -q)
  • pylint 10/10 (pylint src/ahbicht)
  • isort and black pass (--check)
  • inject is not importable in the clean venv (removed from deps)
  • CI passes on GitHub

🤖 Generated with Claude Code

hf-kklein and others added 4 commits April 12, 2026 16:59
This is a breaking change. ahb_context is now required on all
evaluation entry points. The inject-based API has been removed.

See the v1.3.0 release notes for migration instructions.

BREAKING CHANGE: python-inject is no longer a dependency.
All functions that previously used inject now require an explicit
AhbContext parameter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Execute all notebook cells with outputs captured (inject-free)
- Format notebook with black
- Add Quick Start code example to README showing AhbContext usage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ADME Quick Start

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hf-kklein hf-kklein merged commit 5856fc1 into main Apr 12, 2026
14 of 17 checks passed
@hf-kklein hf-kklein deleted the feat/remove-python-inject-v2 branch April 12, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant