diff --git a/CHANGELOG.md b/CHANGELOG.md index 752671593..58ebd4c75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [UNRELEASED] neptune 1.5.0 + +### Fixes +- Load CLI plug-ins in try..except block to avoid a failure in loading a plug-in to crash entire CLI ([#1392](https://github.com/neptune-ai/neptune-client/pull/1392)) + + ## neptune 1.4.1 ### Fixes diff --git a/src/neptune/cli/__main__.py b/src/neptune/cli/__main__.py index 6262ada27..134166132 100644 --- a/src/neptune/cli/__main__.py +++ b/src/neptune/cli/__main__.py @@ -14,6 +14,8 @@ # limitations under the License. # +import warnings + import click import pkg_resources @@ -36,4 +38,11 @@ def main(): plugins = {entry_point.name: entry_point for entry_point in pkg_resources.iter_entry_points("neptune.plugins")} for name, entry_point in plugins.items(): - main.add_command(entry_point.load(), name) + # loading an entry_point may fail and this + # will cause all CLI commands to fail. + # So, we load the plug-ins in try and except block. + try: + loaded_plugin = entry_point.load() + except Exception as e: + warnings.warn(f"Failed loading neptune plug-in `{name}` with exception: {e}") + main.add_command(loaded_plugin, name)