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

Open Beginner friendly
#10,778 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python

Research direction

Start with src/ai/backend/manager/services/processors.py and inspect its TYPE_CHECKING imports and existing # pants: no-infer-dep comments. Run pants check src/ai/backend/manager/services/processors.py before and after the focused change. Done means pants check completes without the reported import-not-found mypy errors while the imports remain under the TYPE_CHECKING guard.

Written by the indexing model from the issue text.

Description

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

Root Cause

Commit 019e1551f (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 2e9e8d95e (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

Dominant language
Python
Stars
670
Forks
183
Avg merge
20h 35m
Merged PRs (30d)
429

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lablup/backend.ai

All issues in lablup/backend.ai

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.