From 486c588306721713eb1a5f1e0b30f5163295c0f4 Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Thu, 14 Jun 2018 14:09:17 -0400 Subject: [PATCH] Fix silly isort check errors.. --- stix2/__init__.py | 6 ++++++ stix2/datastore/filesystem.py | 2 +- stix2/datastore/memory.py | 2 +- stix2/datastore/taxii.py | 2 +- stix2/test/test_workbench.py | 2 +- stix2/v20/bundle.py | 6 +++--- stix2/v21/bundle.py | 4 ++-- 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/stix2/__init__.py b/stix2/__init__.py index 725f257..23f6e8b 100644 --- a/stix2/__init__.py +++ b/stix2/__init__.py @@ -24,6 +24,12 @@ v21.observables v21.sdo v21.sro + + The .v21 import can't be relocated, or we get circular import problems. + The 'isort:skip' line comment didn't work to skip only that one problematic + import. The only thing that did was telling it to skip the whole file. + + isort:skip_file """ # flake8: noqa diff --git a/stix2/datastore/filesystem.py b/stix2/datastore/filesystem.py index 1bf2a12..d508dd8 100644 --- a/stix2/datastore/filesystem.py +++ b/stix2/datastore/filesystem.py @@ -6,8 +6,8 @@ Python STIX 2.0 FileSystem Source/Sink import json import os -from stix2.core import parse from stix2 import Bundle +from stix2.core import parse from stix2.datastore import DataSink, DataSource, DataStoreMixin from stix2.datastore.filters import Filter, FilterSet, apply_common_filters from stix2.utils import deduplicate, get_class_hierarchy_names diff --git a/stix2/datastore/memory.py b/stix2/datastore/memory.py index 490ac03..adb0875 100644 --- a/stix2/datastore/memory.py +++ b/stix2/datastore/memory.py @@ -15,9 +15,9 @@ Note: import json import os +from stix2 import Bundle from stix2.base import _STIXBase from stix2.core import parse -from stix2 import Bundle from stix2.datastore import DataSink, DataSource, DataStoreMixin from stix2.datastore.filters import Filter, FilterSet, apply_common_filters diff --git a/stix2/datastore/taxii.py b/stix2/datastore/taxii.py index f5a432f..1a6bacc 100644 --- a/stix2/datastore/taxii.py +++ b/stix2/datastore/taxii.py @@ -3,9 +3,9 @@ Python STIX 2.x TAXIICollectionStore """ from requests.exceptions import HTTPError +from stix2 import Bundle from stix2.base import _STIXBase from stix2.core import parse -from stix2 import Bundle from stix2.datastore import (DataSink, DataSource, DataSourceError, DataStoreMixin) from stix2.datastore.filters import Filter, FilterSet, apply_common_filters diff --git a/stix2/test/test_workbench.py b/stix2/test/test_workbench.py index 5fdc2e9..b8e511e 100644 --- a/stix2/test/test_workbench.py +++ b/stix2/test/test_workbench.py @@ -1,6 +1,7 @@ import os import stix2 +from stix2 import Bundle from stix2.workbench import (AttackPattern, Campaign, CourseOfAction, ExternalReference, FileSystemSource, Filter, Identity, Indicator, IntrusionSet, Malware, @@ -14,7 +15,6 @@ from stix2.workbench import (AttackPattern, Campaign, CourseOfAction, set_default_creator, set_default_external_refs, set_default_object_marking_refs, threat_actors, tools, vulnerabilities) -from stix2 import Bundle from .constants import (ATTACK_PATTERN_ID, ATTACK_PATTERN_KWARGS, CAMPAIGN_ID, CAMPAIGN_KWARGS, COURSE_OF_ACTION_ID, diff --git a/stix2/v20/bundle.py b/stix2/v20/bundle.py index 420b305..81df0f6 100644 --- a/stix2/v20/bundle.py +++ b/stix2/v20/bundle.py @@ -2,9 +2,9 @@ from collections import OrderedDict from stix2 import parse from stix2.base import _STIXBase -from stix2.properties import TypeProperty, IDProperty, StringProperty, \ - ListProperty, Property -from stix2.utils import get_class_hierarchy_names, _get_dict +from stix2.properties import (IDProperty, ListProperty, Property, + StringProperty, TypeProperty) +from stix2.utils import _get_dict, get_class_hierarchy_names class STIXObjectProperty(Property): diff --git a/stix2/v21/bundle.py b/stix2/v21/bundle.py index b86c1ac..6c20923 100644 --- a/stix2/v21/bundle.py +++ b/stix2/v21/bundle.py @@ -2,8 +2,8 @@ from collections import OrderedDict from stix2 import parse from stix2.base import _STIXBase -from stix2.properties import TypeProperty, IDProperty, ListProperty, Property -from stix2.utils import get_class_hierarchy_names, _get_dict +from stix2.properties import IDProperty, ListProperty, Property, TypeProperty +from stix2.utils import _get_dict, get_class_hierarchy_names class STIXObjectProperty(Property):