Skip to content

chore(perf): enforce F401 and remove unused imports - #1805

Open
loyce-cheng wants to merge 1 commit into
modelscope:mainfrom
loyce-cheng:chore/f401-perf
Open

loyce-cheng wants to merge 1 commit into
modelscope:mainfrom
loyce-cheng:chore/f401-perf

Conversation

@loyce-cheng

Copy link
Copy Markdown

Continue the directory-by-directory F401 rollout from #1689 and #1691 by enabling unused-import checks in evalscope/perf. Remove the 27 newly reported unused imports in 20 files; keep the existing __init__.py exemption and plugin registration imports intact.

The three removed internal names come from modules that are still imported by the same statements, so their module initialization is preserved. No benchmark logic or evaluation semantics change. Other F401 scopes and UP/SIM remain outside this focused follow-up.

Refs #1631

Validation:

  • ruff check . and ruff format --check . pass with the pinned Ruff 0.16.4.
  • All eight pre-commit hooks pass with a local Windows-only exclusion for the tracked symlink placeholder (.github/copilot-instructions.md); the repository hook configuration is unchanged.
  • tests/cli/test_all.py::TestRun::test_ci_lite passes with the mock model.
  • 135 tests pass across 14 targeted perf test modules. Two Windows-specific failures in test_async_lifecycle.py reproduce identically on the unchanged base: a Windows path used as a regex and the SIGINT subprocess exit code. The remote test_multi_parallel_sweep skips without an API key.
  • Before/after runtime comparison preserves all 12 API registrations, 29 dataset registrations, and 67 plugin exports. All 20 changed Python modules import successfully; their non-import ASTs are unchanged and parse for Python 3.10.
  • Ruff stdin probes confirm that perf now reports F401 while existing covered directories and exemptions retain their behavior; git diff --check passes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant