Skip to content

Commit 6f21df3

Browse files
committed
jsonschema.py: strict-rfc3339 -> rfc3339-validator
Replace the strict-rfc3339 import in xcube/util/jsonschema.py with an rfc3339-validator import (see Issue #612).
1 parent 7afaefd commit 6f21df3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

xcube/util/jsonschema.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@
2121

2222
import collections.abc
2323
from abc import ABC, abstractmethod
24-
from typing import Dict, Any, Callable, Mapping, Sequence, Union, Tuple, Optional
24+
from typing import Dict, Any, Callable, Mapping, Sequence, Union, Tuple, \
25+
Optional
2526

26-
# Make sure strict-rfc3339 package is installed. The package jsonschema uses it for validating
27-
# instances of the JsonDateSchema and JsonDatetimeSchema.
28-
from xcube.util.assertions import assert_true
2927
from xcube.util.assertions import assert_instance
28+
from xcube.util.assertions import assert_true
29+
30+
# Make sure rfc3339-validator package is installed : jsonschema uses it for
31+
# validating instances of JsonDateSchema and JsonDatetimeSchema.
32+
# Use of __import__ avoids "unused package" warnings.
33+
__import__('rfc3339_validator')
3034

31-
__import__('strict_rfc3339')
3235
import jsonschema
3336

3437
from xcube.util.ipython import register_json_formatter

0 commit comments

Comments
 (0)