Skip to content

Build-a-plugin tutorial fails #674

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

Open
edoumazane opened this issue Apr 19, 2025 · 6 comments
Open

Build-a-plugin tutorial fails #674

edoumazane opened this issue Apr 19, 2025 · 6 comments
Labels
documentation Improvements or additions to documentation priority-high

Comments

@edoumazane
Copy link

📚 Documentation

When running the build-a-plugin tutorial:

This step fails because there is no Qt binding.

I would suggest editing the section immediately before by replacing napari by napari[all] in the setup.cfg template, which solved the issue on my setup.

@edoumazane edoumazane added the documentation Improvements or additions to documentation label Apr 19, 2025
@jni jni transferred this issue from napari/napari Apr 20, 2025
@jni
Copy link
Member

jni commented Apr 20, 2025

Thanks @edoumazane! I've transferred your issue to the docs repo. I think I agree with the fix.

@psobolewskiPhD
Copy link
Member

Thanks for opening this, we are in the process of updating a lot of the plugin related docs and had missed this one!
But also no no! please don't add napari[all] to your plugin dependencies, it's really problematic.
napari supports multiple backends (pyqt5, pyside2, pyqt6) and conda as well as pypi. If you add napari[all] to your direct dependencies then you will break environments where conda or pyside2 or pyqt6 is used, because pyqt5 from pypi will be installed.

If you want to install napari[all] with your plugin the correct way to do this is to add the [all] as an optional dependency group that depends on napari[all].

Also, we should probably update this whole guide to pyproject.toml to match the plugin template repo:
https://github.com/napari/napari-plugin-template

@psobolewskiPhD
Copy link
Member

Here's the issue for the documentation updates:
#440

@jni
Copy link
Member

jni commented Apr 22, 2025

Oops, I didn't read carefully enough! (I thought this was about adding napari[all] to tutorial instructions, not to a plugin's default dependencies.) What @psobolewskiPhD said! 😅 (See also PEP-771 for the future fix! 🚀)

@TimMonko
Copy link
Contributor

Ahh goodness, I'm sorry about your experience @edoumazane. Thanks for bringing this up!
I would recommend looking at the napari-plugin-template for the most up to date recommendations on structuring your python library. Let us know if you have any other questions. I'll be able to swing back to the docs themselves again likely next week (unless I try from mobile).

In the napari-plugin-template, we use the [all] optional dependency that Peter write's about.

@TimMonko
Copy link
Contributor

AlI just merged napari/napari-plugin-template#56 with the most up to date info about how to include Qt bindings when setting up project dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation priority-high
Projects
None yet
Development

No branches or pull requests

4 participants