From c92807a59afa0f8605f7c6f3a1f3015d0d96bc31 Mon Sep 17 00:00:00 2001 From: Chris Lenk Date: Tue, 7 Jul 2020 09:02:36 -0400 Subject: [PATCH 1/2] Restrict version of six library --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ca63890..1c16e43 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ setup( 'pytz', 'requests', 'simplejson', - 'six', + 'six>=1.13.0', 'stix2-patterns', ], project_urls={ From b29527cae126bd23da8e882120783792fb184686 Mon Sep 17 00:00:00 2001 From: Chris Lenk Date: Tue, 7 Jul 2020 09:03:07 -0400 Subject: [PATCH 2/2] Fix for isort v5.0.0 --- .isort.cfg | 1 - stix2/environment.py | 3 +-- tox.ini | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index db580a5..e409e00 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,6 +1,5 @@ [settings] skip = workbench.py -not_skip = __init__.py known_third_party = antlr4, dateutil, diff --git a/stix2/environment.py b/stix2/environment.py index 4ba912c..5ba82e9 100644 --- a/stix2/environment.py +++ b/stix2/environment.py @@ -1,5 +1,4 @@ """Python STIX2 Environment API.""" - import copy import logging import time @@ -463,7 +462,7 @@ def partial_location_distance(lat1, long1, lat2, long2, threshold): float: Number between 0.0 and 1.0 depending on match. """ - from haversine import haversine, Unit + from haversine import Unit, haversine distance = haversine((lat1, long1), (lat2, long2), unit=Unit.KILOMETERS) result = 1 - (distance / threshold) logger.debug( diff --git a/tox.ini b/tox.ini index 328c03a..857414f 100644 --- a/tox.ini +++ b/tox.ini @@ -30,8 +30,8 @@ max-line-length = 160 [testenv:isort-check] deps = isort commands = - isort -rc stix2 examples -df - isort -rc stix2 examples -c + isort stix2 examples --df + isort stix2 examples -c [testenv:packaging] deps =