File tree 4 files changed +24
-6
lines changed
4 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 85
85
cd stac_fastapi/api && pipenv run pytest -svvv
86
86
env :
87
87
ENVIRONMENT : testing
88
-
88
+
89
+ - name : Run test suite
90
+ run : |
91
+ cd stac_fastapi/types && pipenv run pytest -svvv
92
+ env :
93
+ ENVIRONMENT : testing
94
+
89
95
- name : Run test suite
90
96
run : |
91
97
cd stac_fastapi/sqlalchemy && pipenv run pytest -svvv
Original file line number Diff line number Diff line change 9
9
### Removed
10
10
11
11
### Fixed
12
+ * ` ciso8601 ` fails to build in some environments, instead use ` pyiso8601 ` to parse datetimes.
12
13
13
14
## [ 2.4.0]
14
15
Original file line number Diff line number Diff line change 11
11
"pydantic[dotenv]" ,
12
12
"stac_pydantic==2.0.*" ,
13
13
"pystac==1.*" ,
14
- "ciso8601~=2.2.0 " ,
14
+ "iso8601~=1.0.2 " ,
15
15
]
16
16
17
17
extra_reqs = {
Original file line number Diff line number Diff line change 1
1
"""rfc3339."""
2
-
2
+ import re
3
3
from datetime import datetime , timezone
4
4
from typing import Optional , Tuple
5
5
6
- import ciso8601
6
+ import iso8601
7
7
from pystac .utils import datetime_to_str
8
8
9
+ RFC33339_PATTERN = r"^(\d\d\d\d)\-(\d\d)\-(\d\d)(T|t)(\d\d):(\d\d):(\d\d)([.]\d+)?(Z|([-+])(\d\d):(\d\d))$"
10
+
9
11
10
12
def rfc3339_str_to_datetime (s : str ) -> datetime :
11
13
"""Convert a string conforming to RFC 3339 to a :class:`datetime.datetime`.
12
14
13
- Uses :meth:`ciso8601.parse_rfc3339 ` under the hood.
15
+ Uses :meth:`iso8601.parse_date ` under the hood.
14
16
15
17
Args:
16
18
s (str) : The string to convert to :class:`datetime.datetime`.
@@ -21,7 +23,16 @@ def rfc3339_str_to_datetime(s: str) -> datetime:
21
23
Raises:
22
24
ValueError: If the string is not a valid RFC 3339 string.
23
25
"""
24
- return ciso8601 .parse_rfc3339 (s )
26
+ # Uppercase the string
27
+ s = s .upper ()
28
+
29
+ # Match against RFC3339 regex.
30
+ result = re .match (RFC33339_PATTERN , s )
31
+ if not result :
32
+ raise ValueError ("Invalid RFC3339 datetime." )
33
+
34
+ # Parse with pyiso8601
35
+ return iso8601 .parse_date (s )
25
36
26
37
27
38
def str_to_interval (
You can’t perform that action at this time.
0 commit comments