SCP21: No root requirements

What it does

Finds out if the requirements key is missing from the root of the scrapinghub.yml shub configuration file.

Why is this bad?

The requirements key in the scrapinghub.yml file is used to indicate Python packages to install. It can be used to install Python packages not included in the stack or to change the version of those.

It is important to set this requirements configuration at the root of the scrapinghub.yml file, instead of under specific projects, to ensure consistent dependency management across all deployments of the same code base.

Example

stack: scrapy:2.12-20241202

Instead use:

stack: scrapy:2.12-20241202
requirements:
  file: requirements.txt