From 67c89495278aea3e17826f5cde1be2da61117373 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Fri, 6 Sep 2019 15:02:44 -0400 Subject: [PATCH] update project requirements, test harness and minor improvements --- .travis.yml | 5 ++++- setup.py | 4 ---- stixmarx/__init__.py | 4 +++- stixmarx/utils.py | 8 ++++---- tox.ini | 4 +--- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 098144f..9dcb35a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,14 @@ language: python +cache: pip +dist: xenial python: - - "2.6" - "2.7" - "3.4" - "3.5" - "3.6" + - "3.7" install: + - pip install -U pip setuptools - pip install tox-travis script: - tox diff --git a/setup.py b/setup.py index ad4345b..abab1ba 100644 --- a/setup.py +++ b/setup.py @@ -33,8 +33,6 @@ def get_long_description(): url="https://github.com/mitre/stixmarx", packages=find_packages(), install_requires=[ - "lxml", - "mixbox>=1.0.2", "stix>=1.1.1.8,<1.2.1.0" ], license="BSD", @@ -44,10 +42,8 @@ def get_long_description(): "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", diff --git a/stixmarx/__init__.py b/stixmarx/__init__.py index 09691e1..3c74bef 100644 --- a/stixmarx/__init__.py +++ b/stixmarx/__init__.py @@ -7,9 +7,11 @@ # internal from stixmarx.version import __version__ # noqa +formatter = logging.Formatter("[%(name)s] [%(levelname)-7s] [%(asctime)s] %(message)s") + # Console Handler for stixmarx messages ch = logging.StreamHandler() -ch.setFormatter(logging.Formatter("[%(name)s] [%(levelname)-7s] [%(asctime)s] %(message)s")) +ch.setFormatter(formatter) # Module-level logger log = logging.getLogger(__name__) diff --git a/stixmarx/utils.py b/stixmarx/utils.py index 96a84f6..afbaf94 100644 --- a/stixmarx/utils.py +++ b/stixmarx/utils.py @@ -79,7 +79,7 @@ def _load_stix(): import stix.utils.parser as stix_parser import stix.utils.nsparser as stix_nsparser except (ImportError, ImportWarning) as e: - LOG.warning(str(e)) + LOG.warning(e) return __PYTHON_STIX_LOADED = True @@ -98,7 +98,7 @@ def _load_cybox(): import cybox.common as cybox_common import cybox.utils.nsparser as cybox_nsparser except (ImportError, ImportWarning) as e: - LOG.warning(str(e)) + LOG.warning(e) return __PYTHON_CYBOX_LOADED = True @@ -116,7 +116,7 @@ def _load_mixbox(): import mixbox.entities as mixbox_entities import mixbox.namespaces as mixbox_ns except (ImportError, ImportWarning) as e: - LOG.warning(str(e)) + LOG.warning(e) return __MIXBOX_LOADED = True @@ -133,7 +133,7 @@ def _load_maec(): import maec import maec.utils.nsparser as maec_nsparser except (ImportError, ImportWarning) as e: - LOG.warning(str(e)) + LOG.warning(e) return __PYTHON_MAEC_LOADED = True diff --git a/tox.ini b/tox.ini index 732d504..0b5afc8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,11 @@ [tox] -envlist = py{26,27,34,35,36}-stix{111,120}, py{27,35}-nomaec{111,120} +envlist = py{27,34,35,36,37}-stix{111,120}, py{27,35}-nomaec{111,120} [testenv] commands = pytest deps = -rrequirements.txt - py26: lxml<4.0.0 stix111: stix>=1.1.1.0,<1.1.2.0 stix120: stix>=1.2.0.0,<1.2.1.0 stix{111,120}: maec>=4.1.0.13,<4.1.1.0 @@ -15,7 +14,6 @@ deps = [travis] python = - 2.6: py26 2.7: py27 3.4: py34 3.5: py35