Fix naming of npe1 converted contribution commands and add tests #374
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this PR, declaring multiple implementations of the same hookspec in an npe1 plugin would lead to a converted manifest with multiple commands of the same ID e.g.
plugin_name.get_reader
multiple times, orplugin_name.write_labels
multiple times.Even though this is technically "valid" per the schema, it should not be, because this leads to errors in trying to register the commands in napari. App-model (correctly, imo), does not allow you to register multiple commands with the same ID.
We should update the schema validator to disallow multiple declarations of the same command ID, but in the meantime, this PR disambiguates converted commands for the same hook spec by using the function name instead of the spec name.