Bug 33

Title: Warning emitted when loading plugins
Type: behavior Severity: minor
Components: core Versions:
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: ced Nosy List: ced, lele, roundup-bot
Priority: Keywords: patch

Created on 2017-08-09 13:08 by lele, last changed 2017-09-29 00:18 by roundup-bot.

msg37 Author: [hidden] (lele) Date: 2017-08-09 13:08
Currently relatorio tries to import four "plugins", and on
ImportError it emits a warning.

I never used the chart plugin, so I end up filtering out
that warning in almost every app that uses relatorio.

With the rationale that a user should know what she needs, I
think it should be better one of the following options:

a) remove the warning
b) replace the warnings.warn() with a logging.warn() (or
.debug() even)
c) separate the "needed" plugins from extension ones, do a
plain import on the former, and let the user explicitly
import additional ones as she need

I would go with c), if it were just for me... :)
msg38 Author: [hidden] (ced) Date: 2017-08-11 10:37
review44271002 has been submitted.
msg39 Author: [hidden] (ced) Date: 2017-08-11 10:39
I'm wondering if we should not just rework to be
importable even if pycha is not installed. And so just fail
when trying to use it or not add it to the factory.
msg40 Author: [hidden] (lele) Date: 2017-08-11 12:10
We could, but would be the advantage? What's the point of
(always) importing the (non-working) plugin and fail later,
when we can simply detect the missing dependency at import
time? Maybe backward compatibility?
msg41 Author: [hidden] (ced) Date: 2017-08-11 12:14
It will give a better separation of responsibility.
Each module is responsible to register itself to the factory
and it should always be like that. The engine should not
care about specific plugin may or may not fail to import.
msg49 Author: [hidden] (ced) Date: 2017-09-21 19:10
Here is review39691002 which implements the design of msg39
msg54 Author: [hidden] (roundup-bot) Date: 2017-09-29 00:18
New changeset 351a6d5fb535 by C├ędric Krier in branch 'default':
Remove warning when import plugin fails
Date User Action Args
2017-09-29 00:18:54roundup-botsetstatus: open -> closed
nosy: + roundup-bot
messages: + msg54
2017-09-21 19:10:39cedsetstatus: new -> open
assignee: ced
messages: + msg49
2017-08-11 12:14:03cedsetmessages: + msg41
2017-08-11 12:10:09lelesetmessages: + msg40
2017-08-11 10:41:54cedsetkeywords: + patch
2017-08-11 10:39:29cedsetmessages: + msg39
2017-08-11 10:37:54cedsetnosy: + ced
messages: + msg38
2017-08-09 13:08:22lelecreate