Skip to content

Commit bbc632a

Browse files
Phil-Duacursoragent
andcommitted
Register napari plugin and document setup for Curtis
Addresses Curtis's questions about making the napari plugin available: - Add napari.manifest entry point to pyproject.toml so napari discovers the plugin (napari-curvealign = napari_curvealign:napari.yaml) - Include napari.yaml in package data for non-editable installs - Add SETUP_GUIDE section 'Making the napari plugin available' explaining napari.yaml + pyproject entry point, and 'Running for testing' - Add troubleshooting for 'Plugin not showing in napari' - Update install script and QUICK_START plugin menu text Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent bd70d37 commit bbc632a

File tree

4 files changed

+46
-5
lines changed

4 files changed

+46
-5
lines changed

bin/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ main() {
274274
echo ""
275275
echo " uv run napari"
276276
echo ""
277-
echo "Plugins → napari-curvealign CurveAlign Widget"
277+
echo "Plugins → napari-curvealign (or CurveAlign for Napari)"
278278
echo ""
279279
}
280280

doc/installation/QUICK_START.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
cd tme-quant
99
```
1010

11-
2. **Install uv** (https://docs.astral.sh/uv/)
11+
2. **Install uv** (recommended: https://docs.astral.sh/uv/)
1212
```bash
1313
curl -LsSf https://astral.sh/uv/install.sh | sh
1414
```
@@ -40,7 +40,7 @@ The script will:
4040
uv run napari
4141
```
4242

43-
The CurveAlign widget appears in: **Plugins → napari-curvealignCurveAlign Widget**
43+
The CurveAlign widget appears in: **Plugins → napari-curvealign** (or **CurveAlign for Napari**)
4444

4545
## Directory Layout
4646

doc/installation/SETUP_GUIDE.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ Requires FFTW and CurveLab with `FFTW` and `FDCT` (or `CPPFLAGS`/`LDFLAGS`) set.
162162
- Ensure `FFTW` and `FDCT` (or `CPPFLAGS`/`LDFLAGS`) point to your install roots
163163
- Verify FFTW 2D/3D libraries were built
164164

165+
### Plugin not showing in napari
166+
167+
- Ensure the package is installed: `uv pip install -e .` (the install script does this)
168+
- Restart napari after installing
169+
- Check the plugin is registered: `uv run python -c "from importlib.metadata import entry_points; print([ep.name for ep in entry_points(group='napari.manifest') if 'curvealign' in ep.name])"`
170+
165171
## Activation
166172

167173
After installation:
@@ -170,4 +176,33 @@ After installation:
170176
uv run napari
171177
```
172178

173-
The CurveAlign widget appears in: **Plugins → napari-curvealign → CurveAlign Widget**
179+
The CurveAlign widget appears in: **Plugins → napari-curvealign** (or **CurveAlign for Napari**) → **CurveAlignPy**
180+
181+
## Making the napari plugin available (for developers)
182+
183+
The plugin is registered via two pieces:
184+
185+
1. **`src/napari_curvealign/napari.yaml`** – Declares the plugin (commands, widgets, display names).
186+
2. **`pyproject.toml`** – Entry point that tells napari where to find the manifest:
187+
```toml
188+
[project.entry-points."napari.manifest"]
189+
napari-curvealign = "napari_curvealign:napari.yaml"
190+
```
191+
192+
To make it available in your environment:
193+
194+
```bash
195+
# Install the package (editable, so changes take effect immediately)
196+
uv pip install -e .
197+
# or: uv sync (installs the project from pyproject.toml)
198+
199+
# Run napari
200+
uv run napari
201+
```
202+
203+
Then open **Plugins** in the napari menu and select the CurveAlign widget.
204+
205+
## Running for testing
206+
207+
- **Interactive:** `uv run napari` → Plugins → napari-curvealign
208+
- **Headless tests:** `QT_QPA_PLATFORM=offscreen make test` (or `uv run pytest`)

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,20 @@ curvelops = [
3333
"curvelops @ git+https://github.com/PyLops/curvelops@0.23.4",
3434
]
3535

36+
[project.entry-points."napari.manifest"]
37+
napari-curvealign = "napari_curvealign:napari.yaml"
38+
3639
[tool.setuptools]
3740
package-dir = { "" = "src" }
38-
include-package-data = false
41+
include-package-data = true
3942

4043
[tool.setuptools.packages.find]
4144
where = ["src"]
4245
namespaces = false
4346

47+
[tool.setuptools.package-data]
48+
napari_curvealign = ["napari.yaml"]
49+
4450
[tool.pytest.ini_options]
4551
testpaths = [
4652
"tests",

0 commit comments

Comments
 (0)