Skip to content

Commit

Permalink
Can't get the cartopy version if it ain't installed!
Browse files Browse the repository at this point in the history
Found while building conda packages
  • Loading branch information
mx-moth committed Jul 10, 2024
1 parent 9aa55ca commit 644c0a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/emsarray/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@

_requires_plot = requires_extra(extra='plot', import_error=IMPORT_EXCEPTION)

CARTOPY_VERSION = packaging.version.Version(importlib.metadata.version('cartopy'))
if CAN_PLOT:
CARTOPY_VERSION = packaging.version.Version(importlib.metadata.version('cartopy'))
else:
CARTOPY_VERSION = packaging.version.Version('0')
CARTOPY_0_23 = CARTOPY_VERSION >= packaging.version.Version('0.23')


Expand Down

0 comments on commit 644c0a0

Please sign in to comment.