From 8adaf12845b76d9c158bf3aba7bfc3cde48abcd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Mon, 13 Jun 2022 09:12:41 +0200 Subject: [PATCH] added __version__ attribute --- FESTIM/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/FESTIM/__init__.py b/FESTIM/__init__.py index faaab9477..bfe1a9255 100644 --- a/FESTIM/__init__.py +++ b/FESTIM/__init__.py @@ -1,3 +1,18 @@ +try: + # Python 3.8+ + from importlib import metadata +except ImportError: + try: + import importlib_metadata as metadata + except ImportError: + __version__ = "unknown" + +try: + __version__ = metadata.version("FESTIM") +except Exception: + __version__ = "unknown" + + import sympy as sp x, y, z, t = sp.symbols("x[0] x[1] x[2] t")