Skip to content

chore(mypy): Add missing type stubs for yaml, sklearn, tqdm, umap #48

@rogermt

Description

@rogermt

Problem

Mypy type checking fails with 7 pre-existing errors:

  1. yaml - Missing library stubs

    • Solution: pip install types-PyYAML
    • File: src/forgesyte_yolo_tracker/configs/init.py:6
  2. sklearn.cluster - Missing library stubs or py.typed marker

    • File: src/forgesyte_yolo_tracker/utils/team.py:8
  3. tqdm - Missing library stubs

    • Solution: pip install types-tqdm
    • File: src/forgesyte_yolo_tracker/utils/team.py:9
  4. umap - Missing library stubs or py.typed marker

    • File: src/forgesyte_yolo_tracker/utils/team.py:13
  5. app.models - Cannot find implementation (FastAPI context)

    • Files: src/forgesyte_yolo_tracker/plugin.py:18, src/tests/test_plugin_all_detections.py:13
    • Note: This is expected in CPU-only environment

Solution

Install missing type stub packages in dev dependencies:

uv pip install types-PyYAML types-tqdm

For sklearn and umap, consider:

  • Using scikit-learn with py.typed support (already installed)
  • Using umap-learn with py.typed support (already installed)
  • Or suppress these specific errors in mypy.ini

Impact

  • Blocks full mypy type checking in CI/CD pipelines
  • Not critical for runtime functionality
  • Should be resolved before production deployment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions