Skip to content

v0.5.4: Type annotations + mypy CI

Choose a tag to compare

@maruyamakoju maruyamakoju released this 19 Feb 16:26
· 38 commits to main since this release

What's new in v0.5.4

PEP 561 compliance + mypy CI

py.typed marker: The package now ships `deltatau_audit/py.typed`, signaling to mypy, pyright, and pylance that type information is available. Downstream users get IDE completion and type checking out of the box.

mypy CI step: Every push to main now runs mypy on the core public API:
```yaml

  • name: Type check (mypy)
    run: python -m mypy deltatau_audit/auditor.py deltatau_audit/diagnose.py
    deltatau_audit/adapters/base.py --ignore-missing-imports
    --no-namespace-packages --follow-imports=skip
    ```

mypy now in dev deps: `pip install ".[dev]"` includes `mypy>=1.0`.

`[tool.mypy]` config in pyproject.toml centralises settings and silences third-party stub errors.

Type annotation fixes in auditor.py

  • `env_factory: callable` → `env_factory: Callable[[], Any]` (5 occurrences)
  • `List[int] = None` → `Optional[List[int]] = None` on `speeds`, `interventions`, `scenarios`, `robustness_scenarios`
  • `_print_summary(summary, diagnosis: Dict = None)` → `Optional[Dict] = None`

Deterministic threshold test

`test_run_full_audit_strict_threshold_changes_quadrant` changed from `deploy_threshold=0.99` to `1.01` (above the maximum possible return ratio), making it deterministically pass regardless of agent behavior.

11 new tests (274 total)

```
pip install -U deltatau-audit
```

Full Changelog: v0.5.3...v0.5.4