mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
hanzoai 2.1.2 declares requires-python >= 3.9, yet `import hanzoai` raises TypeError on 3.9. grpo/enhanced_api_model_adapter.py annotates four returns as `str | Tuple[str, Optional[str]]`, which 3.9 evaluates at class-body time, and hanzoai/__init__.py imports grpo eagerly. grpo/enhanced_semantic_extractor.py has the same shape once, behind it. Postpone annotation evaluation in both modules. They are the only two in the package whose PEP 604 unions reach the interpreter. Their dataclasses never resolve annotations, so nothing else changes. tests/test_imports.py imports every module under hanzoai. A new CI job runs it after `pip install .` on 3.9 and 3.13, because the test job only runs .python-version (3.12), where the annotation is valid. Co-authored-by: Claude Opus 5 <[email protected]>