diff --git a/CHANGES.txt b/CHANGES.txt index ff7c6bea..b22812d1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +Version 1.2.0.11 +2020-11-16 +- #367 Fix deprecation warning from collections module + Version 1.2.0.10 2020-05-01 - #366 Check add_reference methods to prevent NoneType has no attribute 'append' @@ -56,6 +60,19 @@ Version 1.2.0.2 - #302 Correctly handle CIQ Identity objects. - Add additional fields to CIQ Identity object. +Version 1.1.1.19 +2020-11-16 +- #367 Fix deprecation warning from collections module + +Version 1.1.1.18 +2020-05-01 +- #366 Check add_reference methods to prevent NoneType has no attribute 'append' +- Changes to STIXPackage to prevent the empty tag from appearing in serialization + +Version 1.1.1.17 +2020-04-21 +- #365 AISMarkingStructure not serializing correctly. PY3 compatibility issue + Version 1.1.1.16 2020-04-16 - #364 TTPs would fail to serialize XML Kill_Chains if no TTP was set diff --git a/docs/index.rst b/docs/index.rst index dddca2ef..a650a9fb 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -22,15 +22,15 @@ version of STIX. ============ =================== STIX Version python-stix Version ============ =================== -1.2 1.2.0.10 (`PyPI`__) (`GitHub`__) +1.2 1.2.0.11 (`PyPI`__) (`GitHub`__) 1.1.1 1.1.1.18 (`PyPI`__) (`GitHub`__) 1.1.0 1.1.0.6 (`PyPI`__) (`GitHub`__) 1.0.1 1.0.1.1 (`PyPI`__) (`GitHub`__) 1.0 1.0.0a7 (`PyPI`__) (`GitHub`__) ============ =================== -__ https://pypi.python.org/pypi/stix/1.2.0.10 -__ https://github.com/STIXProject/python-stix/tree/v1.2.0.10 +__ https://pypi.python.org/pypi/stix/1.2.0.11 +__ https://github.com/STIXProject/python-stix/tree/v1.2.0.11 __ https://pypi.python.org/pypi/stix/1.1.1.18 __ https://github.com/STIXProject/python-stix/tree/v1.1.1.18 __ https://pypi.python.org/pypi/stix/1.1.0.6 diff --git a/examples/vuln_affected_software.py b/examples/vuln_affected_software.py index 3f1d5532..620087c0 100644 --- a/examples/vuln_affected_software.py +++ b/examples/vuln_affected_software.py @@ -28,7 +28,7 @@ # Wrap the Product Object in an Observable instance observable = Observable(software) -# Attach the Product observable to the affected_sofware list of +# Attach the Product observable to the affected_software list of # RelatedObservable instances. This wraps our Observable in a # RelatedObservable layer. vuln = Vulnerability() diff --git a/setup.cfg b/setup.cfg index 91a53db1..e383efad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.2.0.10 +current_version = 1.2.0.11 parse = (?P\d+)\.(?P\d+)\.(?P\d+).(?P\d+) serialize = {major}.{minor}.{patch}.{revision} commit = True @@ -9,6 +9,9 @@ tag = True [bumpversion:file:docs/index.rst] +[metadata] +license_file = LICENSE.txt + [bdist_wheel] universal = True diff --git a/setup.py b/setup.py index fea74856..717d437d 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def get_long_description(): install_requires = [ 'lxml>=2.2.3 ; python_version == "2.7" or python_version >= "3.5"', 'lxml>=2.2.3,<4.4.0 ; python_version > "2.7" and python_version < "3.5"', - 'mixbox>=1.0.2', + 'mixbox>=1.0.4', 'cybox>=2.1.0.13,<2.1.1.0', 'python-dateutil', ] diff --git a/stix/base.py b/stix/base.py index 14f50a6d..b5c417ee 100644 --- a/stix/base.py +++ b/stix/base.py @@ -8,6 +8,7 @@ from sys import version_info # mixbox +from mixbox import compat from mixbox import idgen from mixbox import entities from mixbox import fields @@ -311,7 +312,7 @@ def istypeof(cls, obj): return isinstance(obj, cls) -class TypedList(TypedCollection, collections.MutableSequence): +class TypedList(TypedCollection, compat.MutableSequence): def __init__(self, *args): TypedCollection.__init__(self, *args) diff --git a/stix/bindings/stix_common.py b/stix/bindings/stix_common.py index 64cfac7c..8ae31be4 100644 --- a/stix/bindings/stix_common.py +++ b/stix/bindings/stix_common.py @@ -3495,7 +3495,7 @@ class StructuredTextType(GeneratedsSuper): Note that if the markup tags used by this format would be interpreted as XML information (such as the bracket-based tags of HTML) the text area should be enclosed in a CDATA section to prevent the markup from - interferring with XMLvalidation of the CybOX document. If this + interfering with XMLvalidation of the CybOX document. If this attribute is absent, the implication is that no markup is being used.""" subclass = None superclass = None diff --git a/stix/common/profiles.py b/stix/common/profiles.py index a4499d01..1e523b6c 100644 --- a/stix/common/profiles.py +++ b/stix/common/profiles.py @@ -3,13 +3,14 @@ import collections +from mixbox import compat from mixbox import fields import stix from stix.bindings import stix_common as stix_common_binding -class Profiles(collections.MutableSequence, stix.Entity): +class Profiles(compat.MutableSequence, stix.Entity): _binding = stix_common_binding _binding_class = stix_common_binding.ProfilesType _namespace = 'http://stix.mitre.org/common-1' diff --git a/stix/common/references.py b/stix/common/references.py index 45bfbb27..f5c7dc1e 100644 --- a/stix/common/references.py +++ b/stix/common/references.py @@ -2,13 +2,14 @@ # See LICENSE.txt for complete terms. import collections +from mixbox import compat from mixbox import fields import stix from stix.bindings import stix_common as stix_common_binding -class References(collections.MutableSequence, stix.Entity): +class References(compat.MutableSequence, stix.Entity): _binding = stix_common_binding _binding_class = stix_common_binding.ReferencesType _namespace = 'http://stix.mitre.org/common-1' diff --git a/stix/common/structured_text.py b/stix/common/structured_text.py index b90c0396..9dc73b47 100644 --- a/stix/common/structured_text.py +++ b/stix/common/structured_text.py @@ -10,7 +10,13 @@ import stix import stix.utils as utils import stix.bindings.stix_common as stix_common_binding -from mixbox.vendor.six import text_type +from mixbox.vendor.six import PY2, PY3, text_type + + +if PY2: + from collections import Sequence +elif PY3: + from collections.abc import Sequence #: Default ordinality value for StructuredText. @@ -58,7 +64,7 @@ def to_dict(self): """Converts this object into a dictionary representation. Note: - If no properies or attributes are set other than ``value``, + If no properties or attributes are set other than ``value``, this will return a string. """ @@ -89,7 +95,7 @@ def _unset_default(text): """Unsets the ordinality of the StructuredText object `text` if the ordinality is equal to the DEFAULT_ORDINALITY. - The ordinaity will be returned to its original state after exiting the + The ordinality will be returned to its original state after exiting the context manager. """ @@ -105,7 +111,7 @@ def _unset_default(text): text.ordinality = ordinality -class StructuredTextList(stix.TypedCollection, collections.Sequence): +class StructuredTextList(stix.TypedCollection, Sequence): """A sequence type used to store StructureText objects. Args: diff --git a/stix/indicator/indicator.py b/stix/indicator/indicator.py index 5842209f..fc941045 100644 --- a/stix/indicator/indicator.py +++ b/stix/indicator/indicator.py @@ -470,7 +470,7 @@ def add_related_indicator(self, indicator): ``related_indicators`` list property. Calling this method is the same as calling ``append()`` on the - ``related_indicators`` proeprty. + ``related_indicators`` property. See Also: The :class:`RelatedIndicators` documentation. diff --git a/stix/version.py b/stix/version.py index a60a45d3..a2a3a195 100644 --- a/stix/version.py +++ b/stix/version.py @@ -1,4 +1,4 @@ # Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. -__version__ = "1.2.0.10" +__version__ = "1.2.0.11"