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).
While type-checking the
utilspackage,inject_hub_metadata(insrc/winml/modelkit/utils/hub_utils.py) appears to be dead code: it is exported inutils/__init__.py(__all__) but never called anywhere insrc/ortests/.It also contained a latent bug —
from ..version import __version__referenced a non-existentwinml.modelkit.versionmodule (guarded by try/except, soexport_versionsilently stayed"unknown"). The type-check PR fixes that import tofrom .. import __version__, but if the function is genuinely unused it should be removed entirely along with its export.Proposed cleanup:
inject_hub_metadatafromhub_utils.pyutils/__init__.pyimport +__all__Found during the incremental mypy cleanup (utils folder).