Skip to content

Commit

Permalink
Merge pull request #587 from oasis-open/upgrade-python
Browse files Browse the repository at this point in the history
Upgrade python
  • Loading branch information
rpiazza authored Mar 18, 2024
2 parents 7d7104a + 4a3f99f commit 74873aa
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
12 changes: 6 additions & 6 deletions stix2/test/v20/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions stix2/test/v21/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

0 comments on commit 74873aa

Please sign in to comment.