Add stix2.__version__

stix2.1
clenk 2017-07-06 09:39:33 -04:00
parent 9bfc240008
commit 6f680be8a6
3 changed files with 13 additions and 1 deletions

View File

@ -1,6 +1,16 @@
#!/usr/bin/env python
from setuptools import find_packages, setup
def get_version():
with open('stix2/version.py') as f:
for line in f.readlines():
if line.startswith("__version__"):
version = line.split()[-1].strip('"')
return version
raise AttributeError("Package does not have a __version__")
install_requires = [
'pytz',
'six',
@ -11,7 +21,7 @@ install_requires = [
setup(
name='stix2',
description="Produce and consume STIX 2 JSON content",
version='0.2.0',
version=get_version(),
packages=find_packages(),
install_requires=install_requires,
keywords="stix stix2 json cti cyber threat intelligence",

View File

@ -23,6 +23,7 @@ from .sdo import (AttackPattern, Campaign, CourseOfAction, Identity, Indicator,
Tool, Vulnerability)
from .sro import Relationship, Sighting
from .utils import get_dict
from .version import __version__
OBJ_MAP = {
'attack-pattern': AttackPattern,

1
stix2/version.py Normal file
View File

@ -0,0 +1 @@
__version__ = "0.2.0"