diff --git a/moist_thermodynamics/__init__.py b/moist_thermodynamics/__init__.py
index 956a73e1c269b0a63a5ad9c9ea1f6d7b72c06d2d..da2f7e850c41589dde2df498689307bfceb5aeb7 100644
--- a/moist_thermodynamics/__init__.py
+++ b/moist_thermodynamics/__init__.py
@@ -1,2 +1,5 @@
 from .functions import *
 from . import constants
+
+
+__version__ = "0.5.0"
diff --git a/setup.cfg b/setup.cfg
index c4a92a3f208746b8103b5ef9a88026231c60bb4d..551b604a6d2e11d014cb046cf101010de7c690d5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
 [metadata]
 name = moist_thermodynamics
-version = 0.5.0
+version = attr: moist_thermodynamics.__version__
 description = Constants and functions for the treatment of moist atmospheric thermodynamics.
 long_description = file: README.md
 license = BSD 3-Clause License