Commit 40b67d7
Fix naming of npe1 converted contribution commands and add tests (#374)
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, or `plugin_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.
---------
Co-authored-by: Draga Doncila <[email protected]>1 parent c536e39 commit 40b67d7
File tree
3 files changed
+37
-3
lines changed- src/npe2/_inspection
- tests
- npe1-plugin/npe1_module
3 files changed
+37
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | 407 | | |
411 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
28 | 54 | | |
29 | 55 | | |
30 | 56 | | |
| |||
0 commit comments