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

Allow arbitrary menu locations in npe2 #160

Merged
merged 6 commits into from
May 8, 2022
Merged

Conversation

sofroniewn
Copy link
Contributor

This PR is an alternative to #159 which allows for arbitrary menu locations in npe2. The validation would now happen in napari, or in subsequent PRs. The main change is to drop MenusContribution, and instead just have a dict, which allows us to use keys that are strings containing / and so we don't need to do any menu coercion.

This PR came from recommendations of @nclack and @tlambert03 after reviewing #159 in person together at the napari hackathon. cc @kne42 @Carreau

@sofroniewn sofroniewn requested review from tlambert03 and nclack May 7, 2022 23:30
@codecov
Copy link

codecov bot commented May 7, 2022

Codecov Report

Merging #160 (1b82cda) into main (73f0982) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #160   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines         1717      1707   -10     
=========================================
- Hits          1717      1707   -10     
Impacted Files Coverage Δ
npe2/_plugin_manager.py 100.00% <100.00%> (ø)
npe2/manifest/contributions/__init__.py 100.00% <100.00%> (ø)
npe2/manifest/contributions/_contributions.py 100.00% <100.00%> (ø)
npe2/manifest/contributions/_menus.py 100.00% <100.00%> (ø)
npe2/manifest/contributions/_submenu.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 73f0982...1b82cda. Read the comment docs.

Copy link
Member

@kne42 kne42 left a comment

Choose a reason for hiding this comment

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

much much easier to work with, thank you

Copy link
Collaborator

@tlambert03 tlambert03 left a comment

Choose a reason for hiding this comment

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

lovely

npe2/manifest/contributions/_submenu.py Show resolved Hide resolved
@nclack nclack merged commit 5587f4f into napari:main May 8, 2022
@tlambert03 tlambert03 added the enhancement New feature or request label Jun 12, 2022
tlambert03 added a commit to tlambert03/npe2 that referenced this pull request Jun 12, 2022
tlambert03 added a commit that referenced this pull request Jun 13, 2022
tlambert03 added a commit that referenced this pull request Jun 13, 2022
…ems (#175)

* Revert "Allow arbitrary menu locations in npe2 (#160)"

This reverts commit 5587f4f.

* change menus contribution to dict

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix bad merge

* fix test

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants