diff --git a/CHANGELOG.md b/CHANGELOG.md index 04ef220d..e3405d43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ Authorization Code flow support for Azure AD applications. - [#374](https://github.com/equinor/webviz-config/pull/374) - Removed Webviz SSL certificate generation and forcing of HTTPS connections. +### Fixed +- [#380](https://github.com/equinor/webviz-config/pull/380) - Don't write warning +for multiple versions of same plugin if the metadata is equal. + ## [0.2.7] - 2021-01-14 ### Changed diff --git a/webviz_config/plugins/_utils.py b/webviz_config/plugins/_utils.py index fbb19bfc..f860e669 100644 --- a/webviz_config/plugins/_utils.py +++ b/webviz_config/plugins/_utils.py @@ -39,6 +39,18 @@ def load_webviz_plugins_with_metadata( } if entry_point.name in metadata: + if metadata[entry_point.name] == PluginDistInfo( + { + "dist_name": dist.metadata["name"], + "dist_version": dist.version, + "documentation_url": project_urls.get("Documentation"), + "download_url": project_urls.get("Download"), + "tracker_url": project_urls.get("Tracker"), + } + ): + # May occur if folders in virtual environment are symlinked. + continue + warnings.warn( f"Multiple versions of plugin with name {entry_point.name}. " f"Already loaded from project {metadata[entry_point.name]['dist_name']}. " @@ -46,13 +58,15 @@ def load_webviz_plugins_with_metadata( RuntimeWarning, ) - metadata[entry_point.name] = { - "dist_name": dist.metadata["name"], - "dist_version": dist.version, - "documentation_url": project_urls.get("Documentation"), - "download_url": project_urls.get("Download"), - "tracker_url": project_urls.get("Tracker"), - } + metadata[entry_point.name] = PluginDistInfo( + { + "dist_name": dist.metadata["name"], + "dist_version": dist.version, + "documentation_url": project_urls.get("Documentation"), + "download_url": project_urls.get("Download"), + "tracker_url": project_urls.get("Tracker"), + } + ) loaded_plugins[entry_point.name] = entry_point.load()