Reviewer · CI/CD
Align CI dependency installs
When a CI job (type-checker, linter, static-analysis pass, etc.) scans test code, its environment setup must install the same dependencies that code actually needs, including dev/test-only packages. Do not fix mismatches by moving a dev dependency into the production requirements file — that leaks test-only packages into every runtime install. Instead,...
When a CI job (type-checker, linter, static-analysis pass, etc.) scans test code, its environment setup must install the same dependencies that code actually needs, including dev/test-only packages. Do not fix mismatches by moving a dev dependency into the production requirements file — that leaks test-only packages into every runtime install. Instead, point the job at the correct dependency manifest/group (e.g. install from pyproject.toml’s dev group, or merge requirements.txt with tests/requirements.txt) or add the package to the tool’s ignored-imports configuration.
Example root cause: a Pyre workflow configured with
requirements-path: 'requirements.txt'
while pytest is declared only as a dev dependency in pyproject.toml (pytest = ">=8.1.1,<10.0.0") and in tests/requirements.txt. Because the analysis environment never installs pytest, every test file that imports it (dozens across the repo) raises a false Undefined import finding — not a real code defect, but a workflow configuration gap.
When reviewing a CI failure, first check whether the failure is reproducible against the job’s actual installed environment versus the full dependency set the code requires. If the job’s dependency installation step is incomplete for the code paths it checks, fix the workflow’s install step (or its ignore-list), not the application code or its production requirements.