fix: Update requirements.txt to match app/Controller/AppController.php, add test.

pull/9370/head
Raphaël Vinot 2023-10-25 10:39:13 +02:00
parent 369f7cdede
commit e54b75cebd
3 changed files with 19 additions and 1 deletions

View File

@ -274,6 +274,9 @@ jobs:
python tools/misp-feed/validate.py
deactivate
- name: Check requirements.txt
run: python tests/check_requirements.py
- name: Logs
if: ${{ always() }}
run: |

View File

@ -6,7 +6,7 @@ misp-lib-stix2>=3.0.1.1
mixbox>=1.0.5
plyara>=2.1.1
pydeep2>=0.5.1
pymisp==2.4.176
pymisp==2.4.178
python-magic>=0.4.27
pyzmq>=25.1.1
redis>=5.0.1

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python3
import re
requirements_file = 'requirements.txt'
app_controller = 'app/Controller/AppController.php'
with open(requirements_file) as f:
req_version = re.findall('pymisp==(.*)', f.read())[0]
with open(app_controller) as f:
controler_version = re.findall('pyMispVersion = \'(.*)\'', f.read())[0]
if not req_version == controler_version:
raise Exception(f'PyMISP in {requirements_file} ({req_version}) differs from the one in {app_controller} ({controler_version})')