A repo with tools and services for napari plugin developers
This tool can be installed via pip: pip install napari-plugin-devtools
,
you can also add it to your requirements.txt to be installed with other
dependencies automatically.
The validation tools provides automated tests for plugin developers, these checks verify that the plugin is available for users of napari to install, and would register entry points with napari.
There are two parts to the validation tool. One part is a command line interface, and the other is a pytest fixture.
see CLI_usage.md
devtools provides a pytest fixture: napari_plugin_tester in the plugin_tester.py, it extends a plugin manager used by napari and have additional assertion modes ready:
def test_pm(napari_plugin_tester):
napari_plugin_tester.assert_plugin_name_registered("test-plugin")
napari_plugin_tester.assert_module_registered(_test)
napari_plugin_tester.assert_implementations_registered(
"test-plugin", "napari_get_reader"
)
where you can check more specifically on a module or function
being registered under napari annotations, see
hook specifications
to find what other annotations are avaiable in addition to napari_get_reader