Fix: Make sure to not depend on PyQt#7
Open
psobolewskiPhD wants to merge 1 commit intojuglab:masterfrom
Open
Conversation
This was referenced Oct 2, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, your
requirements.txthasnapari[all], which ends up bringing PyQt5:See:
https://github.com/napari/napari/blob/3bf872cbb1df98665fdb7d5e0f3e1a4845a84202/setup.cfg#L97-L106
This is problematic when using conda installed napari, which will have Qt from conda that has a different name (
pyqt), breaking the environment. This can happen if the user uses the plugin GUI to install.Another example is on arm64 macOS where pip doesn't have a wheel for PyQt5, so conda-forge is the only option, because building the binary from source is problematic.
The napari guide for plugins suggests avoiding this:
https://napari.org/stable/plugins/best_practices.html#don-t-include-pyside2-or-pyqt5-in-your-plugin-s-dependencies
Likewise, there is an import from PyQt, which is likewise problematic.
So in this PR I've replaced the import from PyQt with the equivalent import from
qtpywhich can use whatever Qt is available and then changed the requirement fromnapari[all]tonapariwith the addition ofqtpy.Now on my arm64 macOS this package installs with no issues.