From 5d016142cfc086d61d266302495b9d35f355bd13 Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Wed, 13 Jan 2021 11:22:34 -0500 Subject: [PATCH] Small tweaks: move the definition of DEFAULT_VERSION from the top-level stix2 package to stix2.version but import it into stix2. This makes it possible for someone to get the symbol without needing to import all of stix2. Change an "import X" style import to "from X import Y" in stix2/__init__.py to be consistent with the other imports in that file. --- stix2/__init__.py | 6 +++--- stix2/version.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/stix2/__init__.py b/stix2/__init__.py index 3cd992c..1747c9b 100644 --- a/stix2/__init__.py +++ b/stix2/__init__.py @@ -24,7 +24,7 @@ # flake8: noqa -DEFAULT_VERSION = '2.1' # Default version will always be the latest STIX 2.X version +from .version import DEFAULT_VERSION from .confidence import scales from .datastore import CompositeDataSource @@ -61,5 +61,5 @@ from .v21 import * # This import will always be the latest STIX 2.X version from .version import __version__ from .versioning import new_version, revoke -import stix2.registry -stix2.registry._collect_stix2_mappings() +from .registry import _collect_stix2_mappings +_collect_stix2_mappings() diff --git a/stix2/version.py b/stix2/version.py index 9aa3f90..9ddc874 100644 --- a/stix2/version.py +++ b/stix2/version.py @@ -1 +1,3 @@ __version__ = "2.1.0" + +DEFAULT_VERSION = '2.1' # Default version will always be the latest STIX 2.X version