File: _npe2_manifest.md.jinja

package info (click to toggle)
python-npe2 0.7.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 828 kB
  • sloc: python: 7,088; makefile: 19
file content (66 lines) | stat: -rw-r--r-- 2,008 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
54
55
56
57
58
59
60
61
62
63
64
65
66
# Manifest Reference

```{important}
Plugin manifests are a feature of the second generation napari plugin engine
("npe2").  If you are still using the first generation `napari-plugin-engine`
(i.e. the  `napari.plugin` entrypoint, along with `@napari_hook_implementation`
decorators) then this page does not apply to your plugin.
```

Every napari plugin needs to ship a manifest file with their package. By
convention, this file is called `napari.yaml` and it is placed in the top level
module of the package, but it can be named anything and placed anywhere.

You tell napari where to find your manifest by adding a `napari.manifest` [entry
point](https://packaging.python.org/en/latest/specifications/entry-points/) to
your package metadata:

```ini
# tell napari where to find to your manifest
[options.entry_points]
napari.manifest =
    example-plugin = example_plugin:napari.yaml

# make sure it gets included in your package
[options.package_data]
example-plugin = napari.yaml
```

## Fields

All fields are optional except those in **bold**.

| Name | Details |
|------|---------|
{%- for key, field in schema.properties.items() %}
{%- if not field.hide_docs %}
| {% if key in schema.required %} **`{{ key }}`** {%else%} `{{ key }}` {%endif%} | {{ field.description }}|
{%- endif %}
{%- endfor %}

```{note}
Standard python
[package metadata](https://packaging.python.org/en/latest/specifications/core-metadata/)
from your `setup.cfg` file will also be parsed for version, license, and other info.
```

## Example

Here is a complete example of what the manifest of a plugin providing *all*
contributions might look like. (Note: a plugin needn't implement
more than a single contribution type).

```{tip}
Both [YAML](https://yaml.org/) and [TOML](https://toml.io/en/) are supported
manifest formats, though YAML is the "default" and more common format.
```

::::{tab-set}
{% for format in ['yaml', 'toml'] %}
:::{tab-item} {{format}}
```{{format}}
{{ example[format]() }}
```
:::
{% endfor -%}
::::