Skip to content

pants check fails on services/processors.py due to re-introduced no-infer-dep comments #10778

@fregataa

Description

@fregataa

pants check src/ai/backend/manager/services/processors.py fails with 124 [import-not-found] mypy errors on the main branch.

Root Cause

Commit 019e155 (fix(BA-4935)) removed all # pants: no-infer-dep comments from TYPE_CHECKING imports in processors.py to fix this exact issue. However, the immediately following commit 2e9e8d9 (feat(BA-4829)) re-introduced # pants: no-infer-dep on all 128 TYPE_CHECKING imports. Subsequent commits (RuntimeVariant, ModelCard, DeploymentRevisionPreset, etc.) continued the same pattern.

Impact

  • pants check on processors.py (and any file that transitively includes it) is broken
  • mypy cannot resolve any TYPE_CHECKING imports because pants excludes them from the sandbox

Fix

Remove all # pants: no-infer-dep comments from TYPE_CHECKING imports in processors.py.

Side Effects

  • No circular dependency risk — dependents are API-layer files; dependencies are service-layer files (no upward imports)
  • No runtime impact — imports remain under TYPE_CHECKING guard
  • Build performance — processors.py dependency count increases from ~19 to ~100+, widening incremental invalidation scope for its 17 direct dependents. This is the same trade-off accepted in the original BA-4935 fix.

JIRA Issue: BA-5586

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions