Awesome Reviewers

Reviewer · CI/CD

Align CI dependency installs

When a CI job (type-checker, linter, static analyzer, etc.) runs against test code, make sure its environment actually installs the dependencies that code needs. A mismatch here produces false positives on every file that uses the missing import, not just the one touched by a given PR, and reviewers end up re-litigating the same "false positive" in every...

Instruction

When a CI job (type-checker, linter, static analyzer, etc.) runs against test code, make sure its environment actually installs the dependencies that code needs. A mismatch here produces false positives on every file that uses the missing import, not just the one touched by a given PR, and reviewers end up re-litigating the same “false positive” in every subsequent PR.

Concretely: if a tool like Pyre is configured with requirements-path: 'requirements.txt' but the test suite relies on dev-only packages (e.g. pytest, declared only under [tool.poetry.dev-dependencies] or similar in pyproject.toml), the job will report spurious Undefined import errors on every test file. Do not “fix” this by editing the affected test file or by promoting a dev-only dependency into the runtime requirements.txt (that ships test tooling into production installs). Instead, fix the workflow itself:

  • Install the dev/test dependency group before running the analysis step (e.g. pip install -r tests/requirements.txt or poetry install --with dev), or
  • Point the tool at a requirements file that includes dev dependencies when analyzing test directories, or
  • Explicitly add known dev-only imports (e.g. pytest) to the analyzer’s ignored/known-missing-imports configuration.

Treat any CI finding that stems from a missing dev dependency as a pipeline configuration bug to be fixed centrally, not as a per-PR code issue — and verify the fix by confirming the same class of warning disappears repo-wide, not just on the files in your diff.