diff --git a/napari_plugin_engine/callers.py b/napari_plugin_engine/callers.py index 81b5436..27bbdee 100644 --- a/napari_plugin_engine/callers.py +++ b/napari_plugin_engine/callers.py @@ -1,4 +1,5 @@ """Call loop machinery.""" + import sys from types import TracebackType from typing import Any, List, Optional, Tuple, Type, Union diff --git a/napari_plugin_engine/dist.py b/napari_plugin_engine/dist.py index 43390c1..0f23e25 100644 --- a/napari_plugin_engine/dist.py +++ b/napari_plugin_engine/dist.py @@ -63,15 +63,13 @@ def get_version(plugin) -> str: @overload -def get_metadata(plugin, arg: str, *args: None) -> Optional[str]: - ... +def get_metadata(plugin, arg: str, *args: None) -> Optional[str]: ... @overload # noqa: F811 def get_metadata( # noqa: F811 plugin, arg: str, *args: str -) -> Dict[str, Optional[str]]: - ... +) -> Dict[str, Optional[str]]: ... def get_metadata(plugin, *args): # noqa: F811 diff --git a/napari_plugin_engine/hooks.py b/napari_plugin_engine/hooks.py index 0bf47ce..501828a 100644 --- a/napari_plugin_engine/hooks.py +++ b/napari_plugin_engine/hooks.py @@ -1,6 +1,7 @@ """ Internal hook annotation, representation and calling machinery. """ + import warnings from collections.abc import Sequence from typing import Any, Callable, List, Optional, Union diff --git a/napari_plugin_engine/markers.py b/napari_plugin_engine/markers.py index 9d42994..81d9350 100644 --- a/napari_plugin_engine/markers.py +++ b/napari_plugin_engine/markers.py @@ -1,4 +1,5 @@ """Hook annotation decorators""" + from typing import Callable, Optional from .implementation import HookImplementation, HookSpecification diff --git a/setup.py b/setup.py index 25cd27b..d5b9b13 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ PEP 517 doesn’t support editable installs so this file is currently here to support "pip install -e ." """ + from setuptools import setup setup( diff --git a/testing/conftest.py b/testing/conftest.py index c62106d..9e65533 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -12,8 +12,7 @@ def he_pm(request, pm): class Hooks: @hookspec - def he_method1(self, arg): - ... + def he_method1(self, arg): ... pm.add_hookspecs(request.param(Hooks)) return pm diff --git a/testing/test_details.py b/testing/test_details.py index 3811cf3..7584df8 100644 --- a/testing/test_details.py +++ b/testing/test_details.py @@ -91,8 +91,7 @@ def myhook(self, arg1): def test_repr(): class Hook: @hookspec - def myhook(arg): - ... + def myhook(arg): ... class Plugin: @hookimpl diff --git a/testing/test_discovery.py b/testing/test_discovery.py index a5c88e7..f465efd 100644 --- a/testing/test_discovery.py +++ b/testing/test_discovery.py @@ -122,8 +122,7 @@ def full_plugin_manager( double_convention_plugin, ): @add_specification - def test_specification(arg1, arg2): - ... + def test_specification(arg1, arg2): ... test_plugin_manager.discover_entry_point = 'app.plugin' test_plugin_manager.discover_prefix = 'app_' @@ -194,8 +193,7 @@ def test_double_convention( """Plugins using both naming convention and entrypoints only register once.""" @add_specification - def test_specification(arg1, arg2): - ... + def test_specification(arg1, arg2): ... assert not test_plugin_manager.plugins @@ -241,8 +239,7 @@ def test_plugin_discovery_by_prefix( """Make sure discovery by package prefix works""" @add_specification - def test_specification(arg1, arg2): - ... + def test_specification(arg1, arg2): ... assert test_plugin_manager.hook.test_specification.spec assert not test_plugin_manager.plugins @@ -299,8 +296,7 @@ def test_plugin_discovery_by_entry_point( invalid_entrypoint_plugin, ): @add_specification - def test_specification(arg1, arg2): - ... + def test_specification(arg1, arg2): ... hook_caller = test_plugin_manager.hook.test_specification assert hook_caller.spec @@ -383,8 +379,7 @@ def test_lazy_autodiscovery( with test_plugin_manager.discovery_blocked(): @add_specification - def test_specification(arg1, arg2): - ... + def test_specification(arg1, arg2): ... assert test_plugin_manager.hook._needs_discovery is True @@ -436,8 +431,7 @@ def test_env_var_disable( monkeypatch, ): @add_specification - def test_specification(arg1, arg2): - ... + def test_specification(arg1, arg2): ... test_plugin_manager.discover_entry_point = 'app.plugin' test_plugin_manager.discover_prefix = 'app_' diff --git a/testing/test_pluginmanager.py b/testing/test_pluginmanager.py index 942e8a9..d95ab0c 100644 --- a/testing/test_pluginmanager.py +++ b/testing/test_pluginmanager.py @@ -1,6 +1,7 @@ """ ``PluginManager`` unit and public API testing. """ + import pytest from napari_plugin_engine import ( diff --git a/testing/test_testsupport.py b/testing/test_testsupport.py index 9948dd7..06313aa 100644 --- a/testing/test_testsupport.py +++ b/testing/test_testsupport.py @@ -3,8 +3,7 @@ def test_spec(test_plugin_manager, add_specification): assert not hasattr(test_plugin_manager.hook, 'my_spec') @add_specification - def my_spec(arg1, arg2): - ... + def my_spec(arg1, arg2): ... assert hasattr(test_plugin_manager.hook, 'my_spec') assert hasattr(test_plugin_manager.hook.my_spec, 'spec') @@ -15,8 +14,7 @@ def test_full(test_plugin_manager, add_specification, add_implementation): assert not relay.items() @add_specification - def my_spec(arg1, arg2): - ... + def my_spec(arg1, arg2): ... assert hasattr(relay, 'my_spec') assert not relay.my_spec.get_hookimpls()