Skip to content

Commit

Permalink
Merge pull request #2427 from dsecuma/capa-version-check
Browse files Browse the repository at this point in the history
check flare-capa with python version
  • Loading branch information
doomedraven authored Dec 18, 2024
2 parents b28d42c + 35f97a4 commit e4ef4eb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/cuckoo/common/integrations/capa.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@
HAVE_FLARE_CAPA = False
if processing_conf.flare_capa.enabled or reporting_conf.flare_capa_summary.enabled:
try:
from platform import python_version
from packaging import version
from capa.version import __version__ as capa_version

if capa_version[0] != "7":
if version.parse(python_version()) >= version.parse("3.10.0"):
capa_compatible_version = "8"
else:
capa_compatible_version = "7"

if version.parse(capa_version).base_version.split('.')[0] != capa_compatible_version:
print("FLARE-CAPA missed or incompatible version. Run: poetry install")
else:
import capa.capabilities.common
Expand Down

0 comments on commit e4ef4eb

Please sign in to comment.