diff --git a/CHANGELOG.md b/CHANGELOG.md index 6adb6e89..d0ef11b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). --> ------ ## [v7.1.4](https://github.com/asfadmin/Discovery-asf_search/compare/v7.1.3...v7.1.4) +### Changed +- replaces `ciso8601` package with `dateutil` for package wheel compatibility. `ciso8601` used when installed via `extra` dependency ### Fixed - Fixes syntax warning with escaped slash in `translate.py` diff --git a/asf_search/CMR/translate.py b/asf_search/CMR/translate.py index 7f6973f5..2c645f5b 100644 --- a/asf_search/CMR/translate.py +++ b/asf_search/CMR/translate.py @@ -9,9 +9,13 @@ from shapely.geometry.base import BaseGeometry from .field_map import field_map from .datasets import collections_per_platform -import ciso8601 import logging +try: + from ciso8601 import parse_datetime +except ImportError: + from dateutil.parser import parse as parse_datetime + def translate_opts(opts: ASFSearchOptions) -> List: # Need to add params which ASFSearchOptions cant support (like temporal), @@ -158,7 +162,7 @@ def try_parse_date(value: str) -> Optional[str]: return None try: - date = ciso8601.parse_datetime(value) + date = parse_datetime(value) except ValueError: return None diff --git a/asf_search/baseline/calc.py b/asf_search/baseline/calc.py index faa6442e..6e861d60 100644 --- a/asf_search/baseline/calc.py +++ b/asf_search/baseline/calc.py @@ -1,10 +1,14 @@ +from asf_search import ASFProduct from math import sqrt, cos, sin, radians from typing import List import numpy as np -from ciso8601 import parse_datetime -from asf_search import ASFProduct +try: + from ciso8601 import parse_datetime +except ImportError: + from dateutil.parser import parse as parse_datetime + # WGS84 constants a = 6378137 f = pow((1.0 - 1 / 298.257224), 2) diff --git a/asf_search/baseline/stack.py b/asf_search/baseline/stack.py index c443adae..4a686f7b 100644 --- a/asf_search/baseline/stack.py +++ b/asf_search/baseline/stack.py @@ -1,10 +1,12 @@ +from asf_search import ASFProduct, ASFStackableProduct, ASFSearchResults from typing import Tuple, List -from ciso8601 import parse_datetime import pytz - from .calc import calculate_perpendicular_baselines -from asf_search import ASFProduct, ASFStackableProduct, ASFSearchResults +try: + from ciso8601 import parse_datetime +except ImportError: + from dateutil.parser import parse as parse_datetime def get_baseline_from_stack(reference: ASFProduct, stack: ASFSearchResults) -> Tuple[ASFSearchResults, List[dict]]: warnings = [] diff --git a/setup.py b/setup.py index 36d31fc8..dff08b72 100644 --- a/setup.py +++ b/setup.py @@ -8,8 +8,8 @@ "importlib_metadata", "numpy", "dateparser", + "python-dateutil", "tenacity == 8.2.2", - "ciso8601" ] test_requirements = [ @@ -25,7 +25,8 @@ ] extra_requirements = [ - "remotezip>=0.10.0" + "remotezip>=0.10.0", + "ciso8601", ]