diff --git a/pyproject.toml b/pyproject.toml index 7eee739cd..064321742 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ description = "ValidMind Library" license = "Commercial License" name = "validmind" readme = "README.pypi.md" -version = "2.8.1" +version = "2.8.2" [tool.poetry.dependencies] aiohttp = {extras = ["speedups"], version = "*"} diff --git a/validmind/__init__.py b/validmind/__init__.py index 99a3d0d2c..3099934ce 100644 --- a/validmind/__init__.py +++ b/validmind/__init__.py @@ -30,8 +30,12 @@ After you have pasted the code snippet into your development source code and executed the code, the Python Library API will register with ValidMind. You can now use the ValidMind Library to document and test your models, and to upload to the ValidMind Platform. """ +import threading import warnings +import pkg_resources +from IPython.display import HTML, display + # Ignore Numba warnings. We are not requiring this package directly from numba.core.errors import NumbaDeprecationWarning, NumbaPendingDeprecationWarning @@ -51,8 +55,46 @@ ) from .tests.decorator import tags, tasks, test from .tests.run import print_env +from .utils import is_notebook, parse_version from .vm_models.result import RawData +__shown = False + + +def show_warning(installed, running): + global __shown + + if __shown: + return + __shown = True + + message = ( + f"⚠️ This kernel is running an older version of validmind ({running}) " + f"than the latest version installed on your system ({installed}).\n\n" + "You may need to restart the kernel if you are experiencing issues." + ) + display(HTML(f"