Skip to content

Commit

Permalink
add napari plugin manifest validation
Browse files Browse the repository at this point in the history
  • Loading branch information
vreuter committed Apr 28, 2024
1 parent 770a01d commit 473c036
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Install project
run: python -m pip install .[testsuite]
- name: Run unit tests on Python ${{ matrix.python-version }} on ${{ matrix.os }}
run: pytest tests -vv --cov
run: pytest
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ linting = [
"ruff >= 0.3",
]
testsuite = [
"npe2",
"pytest >= 7.1.0",
"pytest-cov >= 5.0.0",
"typer",
]

[tool.codespell]
Expand Down Expand Up @@ -91,6 +93,9 @@ disallow_subclassing_any = true
implicit_optional = false
strict_optional = true

[tool.pytest.ini_options]
addopts = "-vv --cov looptrace_loci_vis --cov-report term-missing"

[tool.ruff]
# Black uses line-length = 88, but allows exceptions when breaking the line
# would lead to other rule violations. Use 100 as a maximum hard limit:
Expand Down
12 changes: 12 additions & 0 deletions tests/test_manifest_validation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Test that the plugin will be able to be used by Napari."""

import npe2.cli
import pytest
import typer


def test_plugin_package_manifest_is_valid():
try:
npe2.cli.validate("looptrace-loci-vis")
except typer.Exit as e:
pytest.fail(f"Manifest validation failed: {e}")

0 comments on commit 473c036

Please sign in to comment.