From 71fe62b4668df85a98b55faf09bd87f30a260188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 24 Nov 2020 12:18:26 +0100 Subject: [PATCH] fix: Make mail-parser really optional --- pymisp/tools/__init__.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pymisp/tools/__init__.py b/pymisp/tools/__init__.py index fea417f..b19a3ba 100644 --- a/pymisp/tools/__init__.py +++ b/pymisp/tools/__init__.py @@ -12,16 +12,22 @@ from .asnobject import ASNObject # noqa from .geolocationobject import GeolocationObject # noqa from .git_vuln_finder_object import GitVulnFinderObject # noqa -from .emailobject import EMailObject # noqa +try: + from .emailobject import EMailObject # noqa +except ImportError: + # Requires mail-parser, which requires perl packages, optional [email] + pass + from .vehicleobject import VehicleObject # noqa from .csvloader import CSVLoader # noqa from .sshauthkeyobject import SSHAuthorizedKeysObject # noqa from .feed import feed_meta_generator # noqa from .update_objects import update_objects # noqa + try: from .urlobject import URLObject # noqa except ImportError: - # Requires faup, which is a bit difficult to install + # Requires pyfaup, optional dependency [url] pass except OSError: # faup required liblua-5.3 @@ -32,5 +38,5 @@ try: from .elfobject import ELFObject, ELFSectionObject # noqa from .machoobject import MachOObject, MachOSectionObject # noqa except ImportError: - # Requires lief, which is a bit difficult to install + # Requires lief, optional [fileobjects] pass