Merge pull request #152 from emmanvg/remove-taxii-requirement

Update stix2 setup configuration
stix2.0
Greg Back 2018-04-02 13:42:52 -05:00 committed by GitHub
commit 8fd9fa92bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -4,11 +4,12 @@ import os.path
from setuptools import find_packages, setup 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(): def get_version():
with open('stix2/version.py', encoding="utf-8") as f: with open(VERSION_FILE) as f:
for line in f.readlines(): for line in f.readlines():
if line.startswith("__version__"): if line.startswith("__version__"):
version = line.split()[-1].strip('"') version = line.split()[-1].strip('"')
@ -16,7 +17,7 @@ def get_version():
raise AttributeError("Package does not have a __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() long_description = f.read()
@ -52,6 +53,8 @@ setup(
'simplejson', 'simplejson',
'six', 'six',
'stix2-patterns', 'stix2-patterns',
'taxii2-client',
], ],
extras_require={
'taxii': ['taxii2-client']
}
) )

View File

@ -8,6 +8,7 @@ deps =
pytest pytest
pytest-cov pytest-cov
coverage coverage
taxii2-client
commands = commands =
py.test --cov=stix2 stix2/test/ --cov-report term-missing py.test --cov=stix2 stix2/test/ --cov-report term-missing