File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,18 @@ def _check_ghostscript_version(gs_version: str) -> str | None:
96
96
return None
97
97
98
98
99
+ def _get_gdal_version ():
100
+ """
101
+ Get GDAL version.
102
+ """
103
+ try :
104
+ from osgeo import gdal
105
+
106
+ return gdal .__version__
107
+ except ImportError :
108
+ return None
109
+
110
+
99
111
def show_versions (file = sys .stdout ):
100
112
"""
101
113
Print various dependency versions which are useful when submitting bug reports.
@@ -120,6 +132,7 @@ def show_versions(file=sys.stdout):
120
132
}
121
133
deps = [Requirement (v ).name for v in importlib .metadata .requires ("pygmt" )]
122
134
gs_version = _get_ghostscript_version ()
135
+ gdal_version = _get_gdal_version ()
123
136
124
137
lines = []
125
138
lines .append ("PyGMT information:" )
@@ -128,6 +141,7 @@ def show_versions(file=sys.stdout):
128
141
lines .extend ([f" { key } : { val } " for key , val in sys_info .items ()])
129
142
lines .append ("Dependency information:" )
130
143
lines .extend ([f" { modname } : { _get_module_version (modname )} " for modname in deps ])
144
+ lines .append (f" gdal: { gdal_version } " )
131
145
lines .append (f" ghostscript: { gs_version } " )
132
146
lines .append ("GMT library information:" )
133
147
lines .extend ([f" { key } : { val } " for key , val in _get_clib_info ().items ()])
You can’t perform that action at this time.
0 commit comments