Skip to content

Commit 6d34b34

Browse files
committed
openeo.client_version(): return installed version if possible
1 parent f774268 commit 6d34b34

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

openeo/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ class BaseOpenEoException(Exception):
3434

3535

3636
def client_version() -> str:
37-
return __version__
37+
try:
38+
import importlib.metadata
39+
return importlib.metadata.version("openeo")
40+
except Exception:
41+
return __version__

0 commit comments

Comments
 (0)