-
Notifications
You must be signed in to change notification settings - Fork 232
[CLI]: make top-level verdi pluginable via entry points
#7053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Declare the `verdi` Click group with `cls=Pluginable` and `entry_point_group="aiida.cmdline.verdi"`. - Enables external packages to contribute first-level commands (e.g. `verdi gui`, `verdi restapi`) without touching aiida-core. - Mirrors the same pattern used by `verdi data`.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7053 +/- ##
==========================================
- Coverage 79.29% 79.28% -0.00%
==========================================
Files 566 566
Lines 43847 43847
==========================================
- Hits 34763 34761 -2
- Misses 9084 9086 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@superstar54 thank you for the benchmark. Was this benchmarked with or without aiida-gui being installed in the environment? Can you benchmark also the other case? |
Hi @danielhollas, yes, this test was run with aidia-gui installed. In order to test more plugins, I created five more fake commands in five different plugin packages. The time difference only increases from ~ 50 ms to ~60 ms.
Yes, indeed. |
|
Comment from @giovannipizzi , expose all plugin commands under the |

Why is this change needed?
Two new possible use-cases require top-level
verdiextensibility:aiida-guipackage that should exposeverdi gui.restapiThis PR
mirrors the same pattern used by
verdi data:verdiClick group withcls=Pluginableandentry_point_group="aiida.cmdline.verdi".verdi gui) without touching aiida-core.Affect on the performance of
verdiOne concern is that loading the entry point from the plugins will cause
verdito have a slow response.Benchmark:
verdi --helpmeasured with and without this change shows an additional ~50 ms on average in my environment. This overhead is negligible compared to the benefits. Thanks @danielhollas for the tip.Name conflicts
Improving conflict handling is out of scope for this PR and can be addressed for all Pluginable groups in a further PR..