7 ms·
In that case the CLI only needs to import the plugin that defined that sub command, not all plugins?
by Inufu 1y ago
In that case the CLI only needs to import the plugin that defined that sub command, not all plugins?
- simonw 1y agoIt doesn't know which plugin defines a subcommand until it imports the plugin's module. I'm happy with the solution I have now, which is to encourage plugin authors not to import PyTorch or other heavy dependencies at the root level of their plugin code.
- peterfirefly 1y ago> It doesn't know which plugin defines a subcommand until it imports the plugin's module. That might be considered a design mistake -- one that should be easy to migrate away from. You won't need to do anything, of course, if the lazy import becomes available on common Python installs some day in the future. That might take years, though.