You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the autoplugin sphinx plugin will crash sphinx if a minimal setup will cause the plugin being documented to crash in its init. This is because the plugin is actually executed to get some basic information. We could catch errors and try printing out a warning, though, this behavior can be a bit surprising in any case because if a plugin author does not access all the configuration variables before the init finishes or throws an exception; then not all the parameters will get documented. I don't see an easy way to "fix" this without rethinking how this is done, but maybe we can add some guidance to the auto-plugin documentation to make it less surprising.
EDIT: Examples of things that can't really be supported by autoplugin as is:
def__init__(self):
cfg1=self.config.as_str('cfg1')
# Something that crashes if cfg doesn't have a valuecfg2=self.config.as_Str('cfg2')
# cfg2 doesn't get documented
or
def__init__(self):
cfg1=self.config.as_str('cfg1')
ifcfg1=='magic':
cfg2=self.config.as_Str('cfg2')
# cfg2 doesn't get documented
Though, personally, I would extract all the configuration values first, and then override self.startTestRun() or self.pluginsLoaded() for anything that might crash or need to sys.exit().
The text was updated successfully, but these errors were encountered:
I think the first thing we can do is a "required" parameter to the as_int, as_list` etc. methods to say the attribute is mandatory. Then create a config method that prints all errors into stderr.
Currently, the autoplugin sphinx plugin will crash sphinx if a minimal setup will cause the plugin being documented to crash in its init. This is because the plugin is actually executed to get some basic information. We could catch errors and try printing out a warning, though, this behavior can be a bit surprising in any case because if a plugin author does not access all the configuration variables before the init finishes or throws an exception; then not all the parameters will get documented. I don't see an easy way to "fix" this without rethinking how this is done, but maybe we can add some guidance to the auto-plugin documentation to make it less surprising.
EDIT: Examples of things that can't really be supported by autoplugin as is:
or
Though, personally, I would extract all the configuration values first, and then override self.startTestRun() or self.pluginsLoaded() for anything that might crash or need to
sys.exit()
.The text was updated successfully, but these errors were encountered: