From c5185332754b6b6e23c8bc0d28b5a03be7c93a8b Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Mon, 2 Apr 2018 07:51:51 -0400 Subject: [PATCH 1/2] Update stix2 setup configuration # Remove taxii2-client as a requirement to install stix2 # Add taxii2-client to the Tox configuration instead # Re-factor the version and description loading --- setup.py | 8 ++++---- tox.ini | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index fa68616..5edf20f 100644 --- a/setup.py +++ b/setup.py @@ -4,11 +4,12 @@ import os.path from setuptools import find_packages, setup -here = os.path.abspath(os.path.dirname(__file__)) +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) +VERSION_FILE = os.path.join(BASE_DIR, 'stix2', 'version.py') def get_version(): - with open('stix2/version.py', encoding="utf-8") as f: + with open(VERSION_FILE) as f: for line in f.readlines(): if line.startswith("__version__"): version = line.split()[-1].strip('"') @@ -16,7 +17,7 @@ def get_version(): raise AttributeError("Package does not have a __version__") -with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: +with open('README.rst') as f: long_description = f.read() @@ -52,6 +53,5 @@ setup( 'simplejson', 'six', 'stix2-patterns', - 'taxii2-client', ], ) diff --git a/tox.ini b/tox.ini index bfc8c1b..ed26bc0 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,7 @@ deps = pytest pytest-cov coverage + taxii2-client commands = py.test --cov=stix2 stix2/test/ --cov-report term-missing From 470b3ec092039dcd32f5a1e30acb76d1fbcdf75e Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Mon, 2 Apr 2018 09:25:26 -0400 Subject: [PATCH 2/2] Update setup.py to include taxii2-client as an extra dependency --- setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.py b/setup.py index 5edf20f..9700ec8 100644 --- a/setup.py +++ b/setup.py @@ -54,4 +54,7 @@ setup( 'six', 'stix2-patterns', ], + extras_require={ + 'taxii': ['taxii2-client'] + } )