-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use npe2 adaptor when discovering plugins for the installed list #131
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #131 +/- ##
=======================================
Coverage 94.96% 94.97%
=======================================
Files 13 13
Lines 2107 2109 +2
=======================================
+ Hits 2001 2003 +2
Misses 106 106 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@Czaki I tried looking at ways to test this PR but I can't quite understand whether the current tests are actually covering the showing of the restart message or not. I think they're not... It would be awesome if you could take a look at this and see how I might add a test for this behaviour... I want to test that when an npe1 plugin is installed with |
you mean that it should be called when npe1 plugin is installed? |
Yes, the |
# Description This PR turns on the `Use npe2 adaptor` setting by default, and adds a start-up warning dialog listing adapted plugins for the user. After releasing this PR, installed npe1 plugins will be automatically converted to use the npe2 plugin engine. Users can still turn off the setting if they notice any issues with the plugins. The warning dialog will pop up on every napari start-up by default, or only when a new plugin is installed, if the user selects the checkbox or changes the warning level in the plugin preferences. Users will never see this dialog if: - they only have npe2 plugins installed - they turn off the `Use npe2 adaptor` setting If installing npe1 plugins from the plugin manager, [napari-plugin-manager/#131](napari/napari-plugin-manager#131), once merged, will ensure the user is told they need to restart (same as with native npe2 plugins). Once they restart, they will see the warning dialog. Warning dialog screenshot:  Preference dialog screenshot:  --------- Co-authored-by: Draga Doncila <[email protected]> Co-authored-by: Carol Willing <[email protected]> Co-authored-by: Grzegorz Bokota <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
I don't understand why this is failing now 😭 all I did was merge main smh @Czaki any ideas... |
Hmm I wonder if it's because we merged napari/#7627 in the meantime... Will take a look |
Tests are broken currently because of changes in the python matrix. (there may be other issues too of course!) |
OK if this passes CI I think we should merge without tests, assuming a couple of people actually pull it down to try it. If it fails I will try take a look at what the issue is, since it'll probs be related to the napari PR |
All of the fails are with napari from the repo. All of the release (0.5.6) pass. |
Prior to this PR, installing an npe1 plugin with
Use npe2 adaptor
turned on in napari didn't recognize it as a shimmed plugin. As a result, it didn't ask the user to restart (even though a restart is needed to load the plugin), and didn't display thenpe2 (adapted)
badge.This PR updates the manager to read the state of the setting and use it appropriately.
To test that this PR works:
napari
from main, launch a viewerUse npe2 adaptor
in Preferences. Restart napari (skip this if you already had the setting turned on)Install/Uninstall
pluginsnpe1
plugin e.g.Label-Creator
or anything off this list(npe1) adapted
label, the plugin widget is not listed inPlugins
(npe1) adapted
label, plugin widget is listed inPlugins
napari-plugin-manager
from this branch(npe1) adapted
label, and upon restarting, your widget is listed