8000 Always add `Empty` context key, even if `action` is already registered by DragaDoncila · Pull Request #7106 · napari/napari · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Always add Empty context key, even if action is already registered #7106

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

Merged
merged 6 commits into from
Jul 22, 2024

Conversation

DragaDoncila
Copy link
Contributor
@DragaDoncila DragaDoncila commented Jul 19, 2024

References and relevant issues

Closes #7105

Description

This PR ensures that even if the dummy Empty action is registered with the app, we still assign its context_key. I checked that there's no danger in assigning the context key multiple times (like there is in registering an action multiple times), so this shouldn't have any undesirable side effects... 😬

Because new viewers in notebooks share the same app instance, the Empty dummy action is already registered with all launched viewers, but each launched viewer gets its own instance of the LayerList and therefore its own new instance of the context. This means we keep the registered actions, but have to reassign all the context keys. I think this is terrible, but should be fixed in concert with whatever we decide in #7101.

@github-actions github-actions bot added the qt Relates to qt label Jul 19, 2024
@DragaDoncila DragaDoncila requested review from jni and Czaki July 19, 2024 00:17
@DragaDoncila DragaDoncila added this to the 0.5.1 milestone Jul 19, 2024
@DragaDoncila DragaDoncila added the bugfix PR with bugfix label Jul 19, 2024
@DragaDoncila
Copy link
Contributor Author

Looking into the test failure on 3.9, could be legit.

Copy link
codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.86%. Comparing base (62ef757) to head (25d9fb5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7106      +/-   ##
==========================================
- Coverage   92.96%   92.86%   -0.10%     
==========================================
  Files         618      619       +1     
  Lines       56531    56550      +19     
==========================================
- Hits        52552    52515      -37     
- Misses       3979     4035      +56     

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

@psobolewskiPhD
Copy link
Member

Same min req test if failing in a different PR:
https://github.com/napari/napari/actions/runs/10000737369/job/27643590146?pr=7103

@DragaDoncila
Copy link
Contributor Author

Same min req test if failing in a different PR:

Music to my ears 😆

@psobolewskiPhD
Copy link
Member

I don't get it, cause the constraints should protect us from stuff like this. Nothing should have changed from yesterday.

@DragaDoncila
Copy link
Contributor Author
DragaDoncila commented Jul 19, 2024

I don't get it, cause the constraints should protect us from stuff like this. Nothing should have changed from yesterday.

Yeah I don't understand what would've changed - I guess a package that has no upper version constraint? But I don't even know where to go to look at the constraints we've set for min_req so 🤷‍♀️

@DragaDoncila
Copy link
Contributor Author

typing_extensions doesn't have an upper bound constraint when I run min_req tests, but it was last released Jun 8th so I would've thought we'd see this error already?

@DragaDoncila
Copy link
Contributor Author
DragaDoncila commented Jul 19, 2024

So looking more at the failure, it looks like setuptools is doing the import, and they DID release last night and we don't have an upper pin

    File "/home/runner/work/napari/napari/.tox/py39-linux-pyqt5-cov/lib/python3.9/site-packages/setuptools/_vendor/typeguard/_checkers.py", line 71, in <module>
      from typing_extensions import Any as SubclassableAny
  ImportError: cannot import name 'Any' from 'typing_extensions' (/home/runner/work/napari/napari/.tox/py39-linux-pyqt5-cov/lib/python3.9/site-packages/typing_extensions.py)

@psobolewskiPhD
Copy link
Member

Here's the constraints file, but it's empty:
https://github.com/napari/napari/blob/main/resources/constraints/constraints_py3.9_min_req.txt
So something is sketchy with the constraints files?

@DragaDoncila
Copy link
Contributor Author

I opened an issue for the min_req failure.

Here's the constraints file, but it's empty:

Yep, this confuses me too and I don't understand where we get the info from - see this zulip thread where @Czaki tells me how to run min_req, but would be good to understand where they all come from...

@psobolewskiPhD
Copy link
Member

Oh, it's cause we use a tox plugin:
https://github.com/czaki/tox-min-req#readme

@github-actions github-actions bot added the tests Something related to our tests label Jul 19, 2024
@jni jni added the ready to merge Last chance for comments! Will be merged in ~24h label Jul 19, 2024
Copy link
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

@jni jni merged commit f34b70f into napari:main Jul 22, 2024
34 checks passed
@github-actions github-actions bot removed the ready to merge Last chance for comments! Will be merged in ~24h label Jul 22, 2024
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 tests Something related to our tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

file menu error on closing/opening napari from jupyter
4 participants
0