commit
74873aadc0
|
@ -9,7 +9,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
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
|
name: Python ${{ matrix.python-version }} Build
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -16,7 +16,7 @@ repos:
|
||||||
args:
|
args:
|
||||||
- --max-line-length=160
|
- --max-line-length=160
|
||||||
- repo: https://github.com/PyCQA/isort
|
- repo: https://github.com/PyCQA/isort
|
||||||
rev: 5.7.0
|
rev: 5.12.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
name: Sort python imports (shows diff)
|
name: Sort python imports (shows diff)
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -38,14 +38,15 @@ setup(
|
||||||
'Topic :: Security',
|
'Topic :: Security',
|
||||||
'License :: OSI Approved :: BSD License',
|
'License :: OSI Approved :: BSD License',
|
||||||
'Programming Language :: Python :: 3',
|
'Programming Language :: Python :: 3',
|
||||||
'Programming Language :: Python :: 3.7',
|
|
||||||
'Programming Language :: Python :: 3.8',
|
'Programming Language :: Python :: 3.8',
|
||||||
'Programming Language :: Python :: 3.9',
|
'Programming Language :: Python :: 3.9',
|
||||||
'Programming Language :: Python :: 3.10',
|
'Programming Language :: Python :: 3.10',
|
||||||
|
'Programming Language :: Python :: 3.11',
|
||||||
|
'Programming Language :: Python :: 3.12',
|
||||||
],
|
],
|
||||||
keywords='stix stix2 json cti cyber threat intelligence',
|
keywords='stix stix2 json cti cyber threat intelligence',
|
||||||
packages=find_packages(exclude=['*.test', '*.test.*']),
|
packages=find_packages(exclude=['*.test', '*.test.*']),
|
||||||
python_requires='>=3.7',
|
python_requires='>=3.8',
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'pytz',
|
'pytz',
|
||||||
'requests',
|
'requests',
|
||||||
|
|
|
@ -515,12 +515,12 @@ def test_graph_similarity_with_filesystem_source(ds, fs):
|
||||||
prop_scores2 = {}
|
prop_scores2 = {}
|
||||||
env2 = stix2.Environment().graph_similarity(ds, fs, prop_scores2, ignore_spec_version=True)
|
env2 = stix2.Environment().graph_similarity(ds, fs, prop_scores2, ignore_spec_version=True)
|
||||||
|
|
||||||
assert round(env1) == 25
|
assert round(env1) == 19
|
||||||
assert round(prop_scores1["matching_score"]) == 451
|
assert round(prop_scores1["matching_score"]) == 334
|
||||||
assert round(prop_scores1["len_pairs"]) == 18
|
assert round(prop_scores1["len_pairs"]) == 18
|
||||||
|
|
||||||
assert round(env2) == 25
|
assert round(env2) == 19
|
||||||
assert round(prop_scores2["matching_score"]) == 451
|
assert round(prop_scores2["matching_score"]) == 334
|
||||||
assert round(prop_scores2["len_pairs"]) == 18
|
assert round(prop_scores2["len_pairs"]) == 18
|
||||||
|
|
||||||
prop_scores1["matching_score"] = round(prop_scores1["matching_score"], 3)
|
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)
|
env2 = stix2.Environment().graph_equivalence(ds, fs, prop_scores2, ignore_spec_version=True)
|
||||||
|
|
||||||
assert env1 is False
|
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 round(prop_scores1["len_pairs"]) == 18
|
||||||
|
|
||||||
assert env2 is False
|
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
|
assert round(prop_scores2["len_pairs"]) == 18
|
||||||
|
|
||||||
prop_scores1["matching_score"] = round(prop_scores1["matching_score"], 3)
|
prop_scores1["matching_score"] = round(prop_scores1["matching_score"], 3)
|
||||||
|
|
|
@ -900,7 +900,7 @@ def test_object_similarity_prop_scores():
|
||||||
tool2 = stix2.v21.Tool(id=TOOL_ID, **TOOL2_KWARGS)
|
tool2 = stix2.v21.Tool(id=TOOL_ID, **TOOL2_KWARGS)
|
||||||
stix2.Environment().object_similarity(tool1, tool2, prop_scores)
|
stix2.Environment().object_similarity(tool1, tool2, prop_scores)
|
||||||
assert len(prop_scores) == 4
|
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
|
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,
|
max_depth=1,
|
||||||
)
|
)
|
||||||
|
|
||||||
assert round(env1) == 23
|
assert round(env1) == 17
|
||||||
assert round(prop_scores1["matching_score"]) == 411
|
assert round(prop_scores1["matching_score"]) == 308
|
||||||
assert round(prop_scores1["len_pairs"]) == 18
|
assert round(prop_scores1["len_pairs"]) == 18
|
||||||
|
|
||||||
assert round(env2) == 23
|
assert round(env2) == 17
|
||||||
assert round(prop_scores2["matching_score"]) == 411
|
assert round(prop_scores2["matching_score"]) == 308
|
||||||
assert round(prop_scores2["len_pairs"]) == 18
|
assert round(prop_scores2["len_pairs"]) == 18
|
||||||
|
|
||||||
prop_scores1["matching_score"] = round(prop_scores1["matching_score"], 3)
|
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)
|
env2 = stix2.Environment().graph_equivalence(ds, fs, prop_scores2, ignore_spec_version=True)
|
||||||
|
|
||||||
assert env1 is False
|
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 round(prop_scores1["len_pairs"]) == 18
|
||||||
|
|
||||||
assert env2 is False
|
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
|
assert round(prop_scores2["len_pairs"]) == 18
|
||||||
|
|
||||||
prop_scores1["matching_score"] = round(prop_scores1["matching_score"], 3)
|
prop_scores1["matching_score"] = round(prop_scores1["matching_score"], 3)
|
||||||
|
|
8
tox.ini
8
tox.ini
|
@ -1,9 +1,8 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py37,py38,py39,py310,packaging,pre-commit-check
|
envlist = py38,py39,py310,py311,py312,packaging,pre-commit-check
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
deps =
|
deps =
|
||||||
-U
|
|
||||||
tox
|
tox
|
||||||
pytest
|
pytest
|
||||||
pytest-cov
|
pytest-cov
|
||||||
|
@ -32,7 +31,8 @@ commands =
|
||||||
|
|
||||||
[gh-actions]
|
[gh-actions]
|
||||||
python =
|
python =
|
||||||
3.7: py37
|
|
||||||
3.8: py38
|
3.8: py38
|
||||||
3.9: py39, packaging, pre-commit-check
|
3.9: py39
|
||||||
3.10: py310
|
3.10: py310
|
||||||
|
3.11: py311, packaging, pre-commit-check
|
||||||
|
3.12: py312
|
||||||
|
|
Loading…
Reference in New Issue