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

How to handle dev tools for optional napari dependency #42

Closed
niksirbi opened this issue Nov 10, 2023 · 1 comment
Closed

How to handle dev tools for optional napari dependency #42

niksirbi opened this issue Nov 10, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@niksirbi
Copy link
Member

For several BrainGlobe repositories, we have decided to include napari as an optional dependency, so that users can specify tool[napari] when they want to use the napari widgets of that tool, and omit [napari] otherwise.

This is accomplished by adding napari and qtpy as optional dependencies in pyproject.toml, for example:

[project.optional-dependencies]
napari = [
  "napari>=0.4.18",
  "qtpy",
]

That said, during the development of napari widgets, we also need pytest-qt, which in turn also requires qtpy and a graphics backend, for example PyQt5. The logical place for these requirements to go is the dev dependencies. This is how I handled it in this PR for brainglobe-utils. brainreg handles the same problem by putting napari[pyqt5] in both the dev and the napari optional dependencies.

However, that creates the following problem. If one does pip install -e .[dev,napari], as would be the case when developing the napari widgets, we constrain the graphical backend to the one specified in the dev dependencies, which is in general considered bad practice by napari.

@niksirbi niksirbi added the enhancement New feature or request label Nov 10, 2023
@adamltyson
Copy link
Member

Decision made to include all dependencies within [dev]. And run either pip install [dev] or pip install [napari] .

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

No branches or pull requests

2 participants