diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b6fc5..ca1a09d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥". ## Unreleased +- [Improvement] Make `tutor plugins list` print plugins sorted by name. - [Improvement] Ignore Python plugins which cannot be loaded. ## v12.1.6 (2021-11-02) diff --git a/tutor/plugins.py b/tutor/plugins.py index d89ad24..3cdfbf0 100644 --- a/tutor/plugins.py +++ b/tutor/plugins.py @@ -363,11 +363,14 @@ class Plugins: prevent too many re-computations, which happens a lot. """ installed_plugin_names = set() + plugins = [] for PluginClass in cls.PLUGIN_CLASSES: for plugin in PluginClass.iter_installed(): if plugin.name not in installed_plugin_names: installed_plugin_names.add(plugin.name) - yield plugin + plugins.append(plugin) + plugins = sorted(plugins, key=lambda plugin: plugin.name) + yield from plugins def iter_enabled(self) -> Iterator[BasePlugin]: for plugin in self.iter_installed():