Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #56

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.950"
rev: "v1.14.0"
hooks:
- id: mypy
1 change: 1 addition & 0 deletions napari_plugin_engine/callers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Call loop machinery."""

import sys
from types import TracebackType
from typing import Any, List, Optional, Tuple, Type, Union
Expand Down
6 changes: 2 additions & 4 deletions napari_plugin_engine/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions napari_plugin_engine/hooks.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions napari_plugin_engine/markers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Hook annotation decorators"""

from typing import Callable, Optional

from .implementation import HookImplementation, HookSpecification
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 1 addition & 2 deletions testing/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions testing/test_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ def myhook(self, arg1):
def test_repr():
class Hook:
@hookspec
def myhook(arg):
...
def myhook(arg): ...

class Plugin:
@hookimpl
Expand Down
18 changes: 6 additions & 12 deletions testing/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_'
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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_'
Expand Down
1 change: 1 addition & 0 deletions testing/test_pluginmanager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
``PluginManager`` unit and public API testing.
"""

import pytest

from napari_plugin_engine import (
Expand Down
6 changes: 2 additions & 4 deletions testing/test_testsupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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()
Expand Down
Loading