Skip to content

Clean up unused inject_hub_metadata in utils/hub_utils.py #913

@xieofxie

Description

@xieofxie

While type-checking the utils package, inject_hub_metadata (in src/winml/modelkit/utils/hub_utils.py) appears to be dead code: it is exported in utils/__init__.py (__all__) but never called anywhere in src/ or tests/.

It also contained a latent bug — from ..version import __version__ referenced a non-existent winml.modelkit.version module (guarded by try/except, so export_version silently stayed "unknown"). The type-check PR fixes that import to from .. import __version__, but if the function is genuinely unused it should be removed entirely along with its export.

Proposed cleanup:

  • Remove inject_hub_metadata from hub_utils.py
  • Remove it from utils/__init__.py import + __all__
  • Check for any other now-unused helpers it was the sole caller of

Found during the incremental mypy cleanup (utils folder).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions