intelmq icon indicating copy to clipboard operation
intelmq copied to clipboard

CI check to validate compatibility of requirements

Open kamil-certat opened this issue 1 year ago • 4 comments

Some bots have incompatible dependency requirements. It should be possible to write a CI check that tries to resolve all required dependency together and fail if it's not possible.

kamil-certat avatar Sep 20 '23 07:09 kamil-certat

I have this in my makefile for this (using pip-compile from pip-tools package):

requirements-all:
	rm intelmq/bots/collectors/blueliv/REQUIREMENTS.txt
	pip-compile --quiet setup.py intelmq/bots/*/*/REQUIREMENTS.txt --output-file requirements-all.txt
	git restore intelmq/bots/collectors/blueliv/REQUIREMENTS.txt

requirements-dev:
	pip-compile --extra=dev setup.py --output-file=requirements-dev.txt

The problem with blueliv collector is that it's requirements of requests package has upper boundry requests>=2.4.0,<= 2.5.1.

gethvi avatar Sep 20 '23 08:09 gethvi

Hah, I thought exactly about using pip-compile ;)

kamil-certat avatar Sep 20 '23 08:09 kamil-certat

It's also useful for building docker image as it is much faster (from my experience) to compile requirements and just run pip install -r requirements.txt only once. :)

gethvi avatar Sep 20 '23 08:09 gethvi

It is, the pip needs to resolve dependencies only once - and with very specific versions. This process take some time.

kamil-certat avatar Sep 20 '23 08:09 kamil-certat