Closed SnoopJ closed 1 week ago
sopel-plugins list
is also affected by this
As is the .version
command from sopel.builtins.version
Didn't we agree that reload wasn't an option anymore for non-single file plugins?
Didn't we agree that reload wasn't an option anymore for non-single file plugins?
The issue title is about reloading, but this bug affects a lot more than that.
We've definitely talked about reload not working properly once you move beyond a single .py
file (and even then, it can be a little wonky), but nothing yet prevents trying to .reload
any type of plugin. I thought #1056 had more talk (from you) than it does about future possibilities after Python 2 support was dropped, but the current state prior to 8.0 was (AFAIK) more like "we'd still like to improve this if it's possible in newer versions of Python".
Meanwhile, there's #2043 about actually making .reload
explicitly not work on handlers other than PyFilePlugin
, but both of us agreed not to pursue it, eventually. (Among other things, it's not even particularly straightforward to differentiate PyFilePlugin
that will reload a single file, and PyFilePlugin
that should actually reload an entire folder.)
Which means that, as described for now, it is a duplicate of #1056 (with added details), which disqualifies it for Sopel 8.0.1 in my opinion.
The version stuff, however, is something to fix, of course (and I think the related PR is doing that).
Description
I have observed that an entrypoint-style Sopel plugin cannot be reloaded if its project name does not exactly match the top-level import name.
I believe this is caused by catching
ValueError
specifically in theget_version
logic, where other exceptions may bubble up out of theimportlib
machinery.Log error report
Reproduction steps
Broken
setup.cfg
For a plugin whose top-level import name is
sopel_dummy
Expected behavior
I expect the plugin to be reloaded
Relevant logs
No response
Notes
No response
Sopel version
973a489
Installation method
pip install
Python version
3.8.18
Operating system
Ubuntu 20.04
IRCd
No response
Relevant plugins
No response