Skip to content

Fix npe1 samples menu building#6739

Merged
jni merged 2 commits intonapari:mainfrom
lucyleeow:samples_npe1
Mar 21, 2024
Merged

Fix npe1 samples menu building#6739
jni merged 2 commits intonapari:mainfrom
lucyleeow:samples_npe1

Conversation

@lucyleeow
Copy link
Copy Markdown
Contributor

@lucyleeow lucyleeow commented Mar 13, 2024

References and relevant issues

Follows on from #4991

Description

  • Use partial for the npe1 sample menu build
  • Fix the looping, we should have one list of submenus and actions, which gets added at the end of all looping (I've tested in env with 2 npe1 plugins). This also allows us to add all actions and submenus to the unregister list, so actions are correct when plugin status is changed.

@lucyleeow
Copy link
Copy Markdown
Contributor Author

cc @DragaDoncila @Czaki

@github-actions github-actions Bot added the qt Relates to qt label Mar 13, 2024
@lucyleeow lucyleeow added this to the 0.5.0 milestone Mar 13, 2024
@lucyleeow lucyleeow added the bugfix PR with bugfix label Mar 13, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.29%. Comparing base (fa0c3b1) to head (dc217a5).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6739      +/-   ##
==========================================
- Coverage   92.34%   92.29%   -0.05%     
==========================================
  Files         613      613              
  Lines       54713    54713              
==========================================
- Hits        50525    50499      -26     
- Misses       4188     4214      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Collaborator

@Czaki Czaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok. Waiting on @DragaDoncila manual testing

stack=False,
)
_add_sample_partial = partial(
_add_sample,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where add sample is defined? It is function used currently by npe2?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the callback is the same for npe1 and npe2 for samples

Copy link
Copy Markdown
Contributor

@DragaDoncila DragaDoncila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with two npe1 plugins in env, both providing one or multiple samples, both URI and command based. Everything looks good to me. Thanks @lucyleeow!

@DragaDoncila
Copy link
Copy Markdown
Contributor

Adding ready-to-merge for this one. @Czaki feel free to remove if you need more time.

@DragaDoncila DragaDoncila added the ready to merge Last chance for comments! Will be merged in ~24h label Mar 19, 2024
@Czaki
Copy link
Copy Markdown
Collaborator

Czaki commented Mar 19, 2024

I just miss your review...

@jni jni merged commit f464121 into napari:main Mar 21, 2024
@jni jni removed the ready to merge Last chance for comments! Will be merged in ~24h label Mar 21, 2024
@lucyleeow lucyleeow deleted the samples_npe1 branch March 21, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR with bugfix qt Relates to qt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants