Skip to content
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

Add NPE1Shim, to convert npe1 plugins to the npe2 interface #86

Closed
wants to merge 42 commits into from

Conversation

tlambert03
Copy link
Collaborator

@tlambert03 tlambert03 commented Jan 16, 2022

Still experimenting, but this PR would
a) discover npe1 plugins along with npe2 during the discovery process
b) have some sort of way to generate a manifest from the entrypoints (using same logic as npe2 convert)
c) cache that manifest for use on later launches

this could be used to help us transition to npe2 being the only plugin manager

@codecov
Copy link

codecov bot commented Jan 24, 2022

Codecov Report

Merging #86 (fe34923) into main (41c557d) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              main       #86    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           23        24     +1     
  Lines         1355      1583   +228     
==========================================
+ Hits          1355      1583   +228     
Impacted Files Coverage Δ
npe2/_command_registry.py 100.00% <100.00%> (ø)
npe2/_from_npe1.py 100.00% <100.00%> (ø)
npe2/_plugin_manager.py 100.00% <100.00%> (ø)
npe2/cli.py 100.00% <100.00%> (ø)
npe2/manifest/_npe1_shim.py 100.00% <100.00%> (ø)
npe2/manifest/schema.py 100.00% <100.00%> (ø)
npe2/manifest/utils.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41c557d...fe34923. Read the comment docs.

@nclack
Copy link
Collaborator

nclack commented Jan 26, 2022

There was some good discussion in the plugin working group meeting. See notes.

Most of the discussion was around the caching behavior.

We discussed disable/uninstall support being tied to this which I think is great but probably a follow up pr?

@tlambert03 tlambert03 changed the title [WIP] npe2 shim for npe1 plugins Add NPE1Shim, to convert npe1 plugins to the npe2 interface Mar 13, 2022
@tlambert03
Copy link
Collaborator Author

OK @nclack, @Carreau, this is now ready to go. Due to the many moving parts, this has unfortunately ballooned into a massive PR. So I broke it up into three PRs.

  1. NPE1Adapter Part 1 - updated _from_npe1 conversion logic to prepare for locally defined objects #124 - a more realistic test npe1 plugin, and logic to deal with locally defined objects in hookimpl scopes
  2. NPE1Adapter Part 2 - adding the NPE1Adapter object. #125 - the shim object itself, discovery logic, and plugin_manager awareness
  3. NPE1Adapter Part 3 - caching of adapter manifests #126 - caching logic and utilities

each PR contains the previous one... and #126 should actually be identical to this one. If you prefer, you can also simply review this one (and I would just close those PRs).

The whole thing can be tested in concert by checking out this branch (or the branch from #126) along with napari/napari#4015

@tlambert03 tlambert03 marked this pull request as draft March 14, 2022 13:31
@tlambert03 tlambert03 closed this Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants