tlambert03 / napari-plugin-checks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests pre-commit.ci status codecov

napari-plugin-checks

A tool (and pre-commit hook) to statically some best practices for napari plugins

For background, read Best practices when developing napari plugins

As a pre-commit hook

See pre-commit for instructions on using pre-commit.

Sample .pre-commit-config.yaml:

-   repo: https://github.com/tlambert03/napari-plugin-checks
    rev: v0.3.0
    hooks:
    -   id: napari-plugin-checks

checks

Don’t include PySide2 or PyQt5 in your plugin’s dependencies.

may break user environment if they use conda pyqt, or use pyside2

# bad setup.cfg
[options]
install_requires =
    PyQt5
# good setup.cfg
[options]
install_requires =
    qtpy

details

Don't import directly from PyQt5 import PySide2

# bad
from PyQt5 import QtWidgets
# good
from qtpy import QtWidgets
  • your plugin may not work depending on the environment

About

License:MIT License


Languages

Language:Python 100.0%