We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9aa55ca commit 7c747f6Copy full SHA for 7c747f6
src/emsarray/plot.py
@@ -1,3 +1,7 @@
1
+# required as this module imports optional
2
+# dependencies that are used for type hints.
3
+from __future__ import annotations
4
+
5
import importlib.metadata
6
from collections.abc import Callable, Iterable
7
from typing import Any, Literal
@@ -34,7 +38,10 @@
34
38
35
39
_requires_plot = requires_extra(extra='plot', import_error=IMPORT_EXCEPTION)
36
40
37
-CARTOPY_VERSION = packaging.version.Version(importlib.metadata.version('cartopy'))
41
+if CAN_PLOT:
42
+ CARTOPY_VERSION = packaging.version.Version(importlib.metadata.version('cartopy'))
43
+else:
44
+ CARTOPY_VERSION = packaging.version.Version('0')
45
CARTOPY_0_23 = CARTOPY_VERSION >= packaging.version.Version('0.23')
46
47
0 commit comments