napari / cookiecutter-napari-plugin

Cookiecutter for napari plugins
BSD 3-Clause "New" or "Revised" License
67 stars 39 forks source link

Missing lines in `napari.yaml` #172

Closed AJFSalomon closed 6 months ago

AJFSalomon commented 6 months ago

I've run the cookiecutter twice with two different sets of prompts, and got a problem with the second one:

include_reader_plugin [y]: n
include_writer_plugin [y]: n
include_sample_data_plugin [y]: n
include_dock_widget_plugin [y]: y

With these choices, the following lines are missing from the generated napari.yaml file.

contributions:
  commands:
    - id: napari-spinej-annotator.make_qwidget
      python_name: napari_spinej_annotator:ExampleQWidget
      title: Make example QWidget

This causes the Example QWidget not to work, with the following error message: KeyError: "command 'napari-spinej-annotator.make_qwidget' not registered"

I was easily able to solve the problem on my project by simply adding the missing lines, but thought it best to file an issue to fix the bug.

FYI, my first series of prompts was the following and did not cause the same problem:

include_reader_plugin [y]: y
include_writer_plugin [y]: y
include_sample_data_plugin [y]: n
include_dock_widget_plugin [y]: y
psobolewskiPhD commented 6 months ago

Thanks for opening the issue and providing such clear instructions. I can confirm the bug and will make a fix PR.