From 95a2775aedd8d60542a9a215f98de4eba11195ac Mon Sep 17 00:00:00 2001 From: paugier Date: Fri, 22 Nov 2024 16:58:06 +0100 Subject: [PATCH] Fix version fluidsim_core --- lib/fluidsim_core/__init__.py | 10 +++++++++- lib/fluidsim_core/_version.py | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) delete mode 100644 lib/fluidsim_core/_version.py diff --git a/lib/fluidsim_core/__init__.py b/lib/fluidsim_core/__init__.py index e59f9725c..62de0e19c 100644 --- a/lib/fluidsim_core/__init__.py +++ b/lib/fluidsim_core/__init__.py @@ -18,4 +18,12 @@ """ -from ._version import __version__ + +def __getattr__(name): + if name == "__version__": + + from importlib import metadata + + return metadata.version(__package__) + + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") diff --git a/lib/fluidsim_core/_version.py b/lib/fluidsim_core/_version.py deleted file mode 100644 index ed9d4d87b..000000000 --- a/lib/fluidsim_core/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.7.4"