From f5ae9798f8bb40c71ce4737f3b97940a7cd388ef Mon Sep 17 00:00:00 2001 From: Rich Piazza Date: Thu, 14 Mar 2024 16:46:07 -0400 Subject: [PATCH 1/4] update python versions to 3.8-3.12 --- setup.py | 5 +++-- tox.ini | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 499af4f1..80edabb4 100644 --- a/setup.py +++ b/setup.py @@ -38,14 +38,15 @@ def get_long_description(): 'Topic :: Security', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], keywords='stix stix2 json cti cyber threat intelligence', packages=find_packages(exclude=['*.test', '*.test.*']), - python_requires='>=3.7', + python_requires='>=3.8', install_requires=[ 'pytz', 'requests', diff --git a/tox.ini b/tox.ini index 26974585..bc7bd5b6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,8 @@ [tox] -envlist = py37,py38,py39,py310,packaging,pre-commit-check +envlist = py38,py39,py310,py311,py312,packaging,pre-commit-check [testenv] deps = - -U tox pytest pytest-cov @@ -32,7 +31,8 @@ commands = [gh-actions] python = - 3.7: py37 3.8: py38 - 3.9: py39, packaging, pre-commit-check + 3.9: py39 3.10: py310 + 3.11: py311, packaging, pre-commit-check + 3.12: py312 From 9f70e6860e797ff0097a0aa40f49b1b4f8fa50cc Mon Sep 17 00:00:00 2001 From: Rich Piazza Date: Thu, 14 Mar 2024 16:53:31 -0400 Subject: [PATCH 2/4] fix workflows python versions --- .github/workflows/python-ci-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-ci-tests.yml b/.github/workflows/python-ci-tests.yml index 211aa4c5..6ca27d5f 100644 --- a/.github/workflows/python-ci-tests.yml +++ b/.github/workflows/python-ci-tests.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, '3.10'] + python-version: [3.8, 3.9, '3.10', '3.11', '3.12'] name: Python ${{ matrix.python-version }} Build steps: From 4f0e1d205abe43933bb17ee4f04047da88086c8a Mon Sep 17 00:00:00 2001 From: Rich Piazza Date: Sat, 16 Mar 2024 13:53:34 -0400 Subject: [PATCH 3/4] fiux test-environments - weights changed --- stix2/test/v20/test_environment.py | 12 ++++++------ stix2/test/v21/test_environment.py | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/stix2/test/v20/test_environment.py b/stix2/test/v20/test_environment.py index c8867b01..b6f3a0b3 100644 --- a/stix2/test/v20/test_environment.py +++ b/stix2/test/v20/test_environment.py @@ -515,12 +515,12 @@ def test_graph_similarity_with_filesystem_source(ds, fs): prop_scores2 = {} env2 = stix2.Environment().graph_similarity(ds, fs, prop_scores2, ignore_spec_version=True) - assert round(env1) == 25 - assert round(prop_scores1["matching_score"]) == 451 + assert round(env1) == 19 + assert round(prop_scores1["matching_score"]) == 334 assert round(prop_scores1["len_pairs"]) == 18 - assert round(env2) == 25 - assert round(prop_scores2["matching_score"]) == 451 + assert round(env2) == 19 + assert round(prop_scores2["matching_score"]) == 334 assert round(prop_scores2["len_pairs"]) == 18 prop_scores1["matching_score"] = round(prop_scores1["matching_score"], 3) @@ -587,11 +587,11 @@ def test_graph_equivalence_with_filesystem_source(ds, fs): env2 = stix2.Environment().graph_equivalence(ds, fs, prop_scores2, ignore_spec_version=True) assert env1 is False - assert round(prop_scores1["matching_score"]) == 451 + assert round(prop_scores1["matching_score"]) == 334 assert round(prop_scores1["len_pairs"]) == 18 assert env2 is False - assert round(prop_scores2["matching_score"]) == 451 + assert round(prop_scores2["matching_score"]) == 334 assert round(prop_scores2["len_pairs"]) == 18 prop_scores1["matching_score"] = round(prop_scores1["matching_score"], 3) diff --git a/stix2/test/v21/test_environment.py b/stix2/test/v21/test_environment.py index 883ff012..51ca15a5 100644 --- a/stix2/test/v21/test_environment.py +++ b/stix2/test/v21/test_environment.py @@ -900,7 +900,7 @@ def test_object_similarity_prop_scores(): tool2 = stix2.v21.Tool(id=TOOL_ID, **TOOL2_KWARGS) stix2.Environment().object_similarity(tool1, tool2, prop_scores) assert len(prop_scores) == 4 - assert round(prop_scores["matching_score"], 1) == 8.9 + assert round(prop_scores["matching_score"], 1) == 0.0 assert round(prop_scores["sum_weights"], 1) == 100.0 @@ -1050,12 +1050,12 @@ def test_graph_similarity_with_filesystem_source(ds, fs): max_depth=1, ) - assert round(env1) == 23 - assert round(prop_scores1["matching_score"]) == 411 + assert round(env1) == 17 + assert round(prop_scores1["matching_score"]) == 308 assert round(prop_scores1["len_pairs"]) == 18 - assert round(env2) == 23 - assert round(prop_scores2["matching_score"]) == 411 + assert round(env2) == 17 + assert round(prop_scores2["matching_score"]) == 308 assert round(prop_scores2["len_pairs"]) == 18 prop_scores1["matching_score"] = round(prop_scores1["matching_score"], 3) @@ -1225,11 +1225,11 @@ def test_graph_equivalence_with_filesystem_source(ds, fs): env2 = stix2.Environment().graph_equivalence(ds, fs, prop_scores2, ignore_spec_version=True) assert env1 is False - assert round(prop_scores1["matching_score"]) == 411 + assert round(prop_scores1["matching_score"]) == 308 assert round(prop_scores1["len_pairs"]) == 18 assert env2 is False - assert round(prop_scores2["matching_score"]) == 411 + assert round(prop_scores2["matching_score"]) == 308 assert round(prop_scores2["len_pairs"]) == 18 prop_scores1["matching_score"] = round(prop_scores1["matching_score"], 3) From 4a3f99f251d4a6c75c270fd1890c5e944cf8d33b Mon Sep 17 00:00:00 2001 From: Rich Piazza Date: Mon, 18 Mar 2024 09:57:59 -0400 Subject: [PATCH 4/4] update isort to 5.12 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 434eb957..c39aaf6d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: args: - --max-line-length=160 - repo: https://github.com/PyCQA/isort - rev: 5.7.0 + rev: 5.12.0 hooks: - id: isort name: Sort python imports (shows diff)