From 34ecc99467f2544bc8242d606758c84f4a05c59b Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Fri, 6 Sep 2019 16:37:09 -0400 Subject: [PATCH 01/11] update project test harness and requirements --- .travis.yml | 11 ++++++----- setup.cfg | 2 ++ setup.py | 31 ++++++++++++++++++------------- tox.ini | 9 ++++++--- 4 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 setup.cfg diff --git a/.travis.yml b/.travis.yml index cef4100..1f090c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,18 @@ language: python - +sudo: false # Since this is an older project, this is not the default. +cache: pip +dist: xenial python: - "2.7" - "3.4" - "3.5" - "3.6" - + - "3.7" install: - - pip install -U tox-travis - + - pip install -U pip setuptools + - pip install tox-travis script: - tox - notifications: email: - stix-commits-list@groups.mitre.org diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..2be6836 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = True diff --git a/setup.py b/setup.py index a7b2a60..66f55ca 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ # Copyright (c) 2018 - The MITRE Corporation # For license information, see the LICENSE.txt file -from io import open # Allow `encoding` kwarg on Python 2.7 + from os.path import abspath, dirname, join @@ -12,6 +12,7 @@ BASE_DIR = dirname(abspath(__file__)) VERSION_FILE = join(BASE_DIR, 'maec', 'version.py') + def get_version(): with open(VERSION_FILE) as f: for line in f.readlines(): @@ -21,14 +22,16 @@ def get_version(): raise AttributeError("Package does not have a __version__") -with open('README.rst', encoding='utf-8') as f: - readme = f.read() +def get_long_description(): + with open('README.rst') as f: + return f.read() install_requires = [ - 'lxml>=2.2.3', - 'mixbox>=0.0.13', - 'cybox>=2.1.0.13.dev1,<2.1.1.0', + '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', + 'cybox>=2.1.0.13,<2.1.1.0', ] extras_require = { @@ -48,18 +51,20 @@ def get_version(): author="MAEC Project", author_email="maec@mitre.org", description="An API for parsing and creating MAEC content.", - long_description=readme, + long_description=get_long_description(), url="http://maec.mitre.org", packages=find_packages(), install_requires=install_requires, extras_require=extras_require, + license="BSD", classifiers=[ - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", diff --git a/tox.ini b/tox.ini index bf42ae9..0b520ed 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,16 @@ [tox] -envlist = py27,py34,py35,py36 +envlist = py27,py34,py35,py36,py37 [testenv] commands = nosetests maec - sphinx-build -b doctest docs docs/_build/doctest - sphinx-build -b html docs docs/_build/html deps = -rrequirements.txt +[testenv:docs] +commands = + sphinx-build -W -b doctest -d {envtmpdir}/doctrees docs {envtmpdir}/doctest + sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html [travis] python = @@ -16,3 +18,4 @@ python = 3.4: py34 3.5: py35 3.6: py36 + 3.7: py37 From 5a79efda05f3834057a6201daad90ef545504d18 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Fri, 6 Sep 2019 16:54:45 -0400 Subject: [PATCH 02/11] =?UTF-8?q?Bump=20version:=204.1.0.14=20=E2=86=92=20?= =?UTF-8?q?4.1.0.15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.txt | 4 ++++ maec/version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 587bbc0..01c9e7c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +Version 4.1.0.15 +2019-09-06 +- Update project requirements + Version 4.1.0.14 2018-08-03 - Drop support for Python 2.6, 3.3 diff --git a/maec/version.py b/maec/version.py index 57eb63f..9f86a64 100644 --- a/maec/version.py +++ b/maec/version.py @@ -1,4 +1,4 @@ # Copyright (c) 2018, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. -__version__ = "4.1.0.14" +__version__ = "4.1.0.15" From 755f7d6b159d89472dbf2f36bdd0f382197028fe Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Tue, 17 Sep 2019 12:37:01 -0400 Subject: [PATCH 03/11] revert changes to read long_description --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 66f55ca..c8a445c 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ # Copyright (c) 2018 - The MITRE Corporation # For license information, see the LICENSE.txt file - +from io import open # Allow `encoding` kwarg on Python 2.7 from os.path import abspath, dirname, join @@ -23,7 +23,7 @@ def get_version(): def get_long_description(): - with open('README.rst') as f: + with open('README.rst', encoding='utf-8') as f: return f.read() From f7fb3b8b07b73c34ccd603a2fb419df4e3409574 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Tue, 17 Sep 2019 12:52:58 -0400 Subject: [PATCH 04/11] update README and project configuration --- CHANGES.txt | 4 ++++ setup.cfg | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 01c9e7c..55721f9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +Version 4.1.0.16 +2019-09-17 +- [#96] Fix problem when installing from Python 2.7 + Version 4.1.0.15 2019-09-06 - Update project requirements diff --git a/setup.cfg b/setup.cfg index 2be6836..30041d8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,11 @@ +[bumpversion] +current_version = 4.1.0.15 +parse = (?P\d+)\.(?P\d+)\.(?P\d+).(?P\d+) +serialize = {major}.{minor}.{patch}.{release} +commit = True +tag = True + +[bumpversion:file:maec/version.py] + [bdist_wheel] universal = True From 0990cc448f106193e82085a752219e6fd2cffad5 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Tue, 17 Sep 2019 12:57:32 -0400 Subject: [PATCH 05/11] =?UTF-8?q?Bump=20version:=204.1.0.15=20=E2=86=92=20?= =?UTF-8?q?4.1.0.16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maec/version.py | 2 +- setup.cfg | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/maec/version.py b/maec/version.py index 9f86a64..26571b3 100644 --- a/maec/version.py +++ b/maec/version.py @@ -1,4 +1,4 @@ # Copyright (c) 2018, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. -__version__ = "4.1.0.15" +__version__ = "4.1.0.16" diff --git a/setup.cfg b/setup.cfg index 30041d8..4b24ed4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 4.1.0.15 +current_version = 4.1.0.16 parse = (?P\d+)\.(?P\d+)\.(?P\d+).(?P\d+) serialize = {major}.{minor}.{patch}.{release} commit = True @@ -9,3 +9,4 @@ tag = True [bdist_wheel] universal = True + From be639280ab479a99bd000594efeccca37ba4d10e Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Wed, 18 Sep 2019 09:55:55 -0400 Subject: [PATCH 06/11] Update setup.cfg --- setup.cfg | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 4b24ed4..d481174 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [bumpversion] current_version = 4.1.0.16 -parse = (?P\d+)\.(?P\d+)\.(?P\d+).(?P\d+) -serialize = {major}.{minor}.{patch}.{release} +parse = (?P\d+)\.(?P\d+)\.(?P\d+).(?P\d+) +serialize = {major}.{minor}.{patch}.{revision} commit = True tag = True @@ -9,4 +9,3 @@ tag = True [bdist_wheel] universal = True - From 8711d23b5752bbabac62474faa8fb89320a3f636 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Wed, 18 Sep 2019 10:35:55 -0400 Subject: [PATCH 07/11] update documentation, add new test environments for harness --- README.rst | 4 ++-- docs/getting_started.rst | 2 +- docs/index.rst | 6 +++--- setup.cfg | 2 ++ tox.ini | 12 +++++++++--- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index dea7835..2ef5d63 100644 --- a/README.rst +++ b/README.rst @@ -1,10 +1,10 @@ python-maec =========== -A Python library for parsing, manipulating, and generating `Malware Attribute Enumeration and Characterization (MAECâ„¢) `_ content. +A Python library for parsing, manipulating, and generating `Malware Attribute Enumeration and Characterization (MAECâ„¢) `_ v4.1 content. :Source: https://github.com/MAECProject/python-maec -:Documentation: http://maec.readthedocs.org +:Documentation: https://maec.readthedocs.io/ :Information: https://maecproject.github.io/ :Download: https://pypi.python.org/pypi/maec/ diff --git a/docs/getting_started.rst b/docs/getting_started.rst index ed5570e..069c224 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -23,7 +23,7 @@ Once you have installed python-maec, you can begin writing Python applications t .. note:: - The *python-maec* library provides **bindings** and **APIs**, both of which can be used to parse and write MAEC XML files. For in-depth description of the *APIs, bindings, and the differences between the two*, please refer to :doc:`api_vs_bindings/index` + The *python-maec* library provides **bindings** and **APIs**, both of which can be used to parse and write MAEC XML files. For in-depth description of the *APIs, bindings, and the differences between the two*, please refer to :doc:`api_vs_bindings/index` Creating a MAEC Package *********************** diff --git a/docs/index.rst b/docs/index.rst index f667181..c140535 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,13 +15,13 @@ version of MAEC. ============ =================== MAEC Version python-maec Version ============ =================== -4.1 4.1.0.12 (`PyPI`__) (`GitHub`__) +4.1 4.1.0.16 (`PyPI`__) (`GitHub`__) 4.0 4.0.1.0 (`PyPI`__) (`GitHub`__) 3.0 3.0.0b1 (`PyPI`__) (`GitHub`__) ============ =================== -__ https://pypi.python.org/pypi/maec/4.1.0.12 -__ https://github.com/MAECProject/python-maec/tree/v4.1.0.12 +__ https://pypi.python.org/pypi/maec/4.1.0.16 +__ https://github.com/MAECProject/python-maec/tree/v4.1.0.16 __ https://pypi.python.org/pypi/maec/4.0.1.0 __ https://github.com/MAECProject/python-maec/tree/v4.0.1.0 __ https://pypi.python.org/pypi/maec/3.0.0b1 diff --git a/setup.cfg b/setup.cfg index d481174..632bb88 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,5 +7,7 @@ tag = True [bumpversion:file:maec/version.py] +[bumpversion:file:docs/index.rst] + [bdist_wheel] universal = True diff --git a/tox.ini b/tox.ini index 0b520ed..3c839d3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36,py37 +envlist = py27, py34, py35, py36, py37, docs, packaging [testenv] commands = @@ -12,10 +12,16 @@ commands = sphinx-build -W -b doctest -d {envtmpdir}/doctrees docs {envtmpdir}/doctest sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html +[testenv:packaging] +deps = + readme_renderer +commands = + python setup.py check -r -s + [travis] python = - 2.7: py27 + 2.7: py27, docs, packaging 3.4: py34 3.5: py35 - 3.6: py36 + 3.6: py36, docs, packaging 3.7: py37 From 2da84ee607e18be8d44b50c768a97e967c650b66 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Wed, 18 Sep 2019 13:27:27 -0400 Subject: [PATCH 08/11] Update setup.py --- setup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c8a445c..72a4dd4 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ def get_long_description(): author_email="maec@mitre.org", description="An API for parsing and creating MAEC content.", long_description=get_long_description(), - url="http://maec.mitre.org", + url="https://maecproject.github.io/", packages=find_packages(), install_requires=install_requires, extras_require=extras_require, @@ -69,5 +69,10 @@ def get_long_description(): "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", - ] + ], + project_urls={ + 'Documentation': 'https://maec.readthedocs.io/', + 'Source Code': 'https://github.com/MAECProject/python-maec/', + 'Bug Tracker': 'https://github.com/MAECProject/python-maec/issues/', + }, ) From bbcfccd8ef4fe12b625f1a8b2ebeafa1de88d01d Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Mon, 16 Nov 2020 16:46:08 -0500 Subject: [PATCH 09/11] changes to prevent deprecation warnings --- maec/utils/comparator.py | 4 ++-- maec/utils/deduplicator.py | 4 ++-- setup.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/maec/utils/comparator.py b/maec/utils/comparator.py index 50e43fd..8aea9aa 100644 --- a/maec/utils/comparator.py +++ b/maec/utils/comparator.py @@ -1,5 +1,5 @@ # MAEC Comparator Classes -import collections +from mixbox import compat class ComparisonResult(object): def __init__(self, bundle_list, lookup_table): @@ -154,7 +154,7 @@ def get_val(cls, obj, typed_field, hash_val, nested_elements = None): val = getattr(obj.properties, str(typed_field)) if val is not None: hash_val += str(typed_field) + ":" - if isinstance(val, collections.MutableSequence): + if isinstance(val, compat.MutableSequence): for list_item in val: if '/' in str(nested_elements[0]): hash_val += '[' diff --git a/maec/utils/deduplicator.py b/maec/utils/deduplicator.py index b10f1d0..7b96fa3 100644 --- a/maec/utils/deduplicator.py +++ b/maec/utils/deduplicator.py @@ -4,9 +4,9 @@ # See LICENSE.txt for complete terms -import collections import copy +from mixbox import compat from mixbox import entities from cybox.core import RelatedObject, AssociatedObject @@ -179,7 +179,7 @@ def get_typedfield_values(cls, val, name, values, ignoreCase=False): # If the value is a mutable sequence, attempt to find TypedFields as # in each item. EntityLists are Entity subclasses that can have # TypedFields, so we don't make this an elif. - if isinstance(val, collections.MutableSequence): + if isinstance(val, compat.MutableSequence): for list_item in val: cls.get_typedfield_values(list_item, name, values, ignoreCase) diff --git a/setup.py b/setup.py index 72a4dd4..0d36427 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', ] From 58b4160c81981527bc21831e5027b308b851f1c5 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Mon, 16 Nov 2020 16:51:59 -0500 Subject: [PATCH 10/11] update CI and project requirements --- .travis.yml | 3 ++- CHANGES.txt | 4 ++++ setup.cfg | 3 +++ setup.py | 1 + tox.ini | 3 ++- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f090c2..e99e66d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ +os: linux language: python -sudo: false # Since this is an older project, this is not the default. cache: pip dist: xenial python: @@ -8,6 +8,7 @@ python: - "3.5" - "3.6" - "3.7" + - "3.8" install: - pip install -U pip setuptools - pip install tox-travis diff --git a/CHANGES.txt b/CHANGES.txt index 55721f9..6c2de9a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +Version 4.1.0.17 +2020-11-16 +- Remove deprecation warning for collections module + Version 4.1.0.16 2019-09-17 - [#96] Fix problem when installing from Python 2.7 diff --git a/setup.cfg b/setup.cfg index 632bb88..85d2e45 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,5 +9,8 @@ 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 0d36427..da68f08 100644 --- a/setup.py +++ b/setup.py @@ -65,6 +65,7 @@ def get_long_description(): "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", diff --git a/tox.ini b/tox.ini index 3c839d3..d50a0b4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py34, py35, py36, py37, docs, packaging +envlist = py27, py34, py35, py36, py37, py38, docs, packaging [testenv] commands = @@ -25,3 +25,4 @@ python = 3.5: py35 3.6: py36, docs, packaging 3.7: py37 + 3.8: py38 From 13e66105c9646156060d0896a4d54970ea358f44 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Mon, 16 Nov 2020 16:56:36 -0500 Subject: [PATCH 11/11] =?UTF-8?q?Bump=20version:=204.1.0.16=20=E2=86=92=20?= =?UTF-8?q?4.1.0.17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/index.rst | 6 +++--- maec/version.py | 2 +- setup.cfg | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index c140535..47a49af 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,13 +15,13 @@ version of MAEC. ============ =================== MAEC Version python-maec Version ============ =================== -4.1 4.1.0.16 (`PyPI`__) (`GitHub`__) +4.1 4.1.0.17 (`PyPI`__) (`GitHub`__) 4.0 4.0.1.0 (`PyPI`__) (`GitHub`__) 3.0 3.0.0b1 (`PyPI`__) (`GitHub`__) ============ =================== -__ https://pypi.python.org/pypi/maec/4.1.0.16 -__ https://github.com/MAECProject/python-maec/tree/v4.1.0.16 +__ https://pypi.python.org/pypi/maec/4.1.0.17 +__ https://github.com/MAECProject/python-maec/tree/v4.1.0.17 __ https://pypi.python.org/pypi/maec/4.0.1.0 __ https://github.com/MAECProject/python-maec/tree/v4.0.1.0 __ https://pypi.python.org/pypi/maec/3.0.0b1 diff --git a/maec/version.py b/maec/version.py index 26571b3..b87b594 100644 --- a/maec/version.py +++ b/maec/version.py @@ -1,4 +1,4 @@ # Copyright (c) 2018, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. -__version__ = "4.1.0.16" +__version__ = "4.1.0.17" diff --git a/setup.cfg b/setup.cfg index 85d2e45..395669c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 4.1.0.16 +current_version = 4.1.0.17 parse = (?P\d+)\.(?P\d+)\.(?P\d+).(?P\d+) serialize = {major}.{minor}.{patch}.{revision} commit = True @@ -14,3 +14,4 @@ license_file = LICENSE.txt [bdist_wheel] universal = True +