Skip to content

Commit

Permalink
Fix flake8 errors on updated jsonschema stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
sirosen committed May 26, 2022
1 parent a966aee commit 9a3a65f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions stubs/jsonschema/jsonschema/_format.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from collections.abc import Iterable
from typing import Any, Callable, TypeVar

F = TypeVar("F", bound=Callable[..., Any])
_F = TypeVar("_F", bound=Callable[..., Any])

class FormatChecker:
checkers: dict[str, tuple[Callable[[Any], bool], Exception | tuple[Exception, ...],],]
checkers: dict[str, tuple[Callable[[Any], bool], Exception | tuple[Exception, ...]]]

def __init__(self, formats: Iterable[str] | None = ...) -> None: ...
def checks(self, format: str, raises: Exception | tuple[Exception, ...] = ...) -> Callable[[F], F]: ...
def checks(self, format: str, raises: Exception | tuple[Exception, ...] = ...) -> Callable[[_F], _F]: ...
@classmethod
def cls_checks(cls, format: str, raises: Exception | tuple[Exception, ...] = ...) -> Callable[[F], F]: ...
def cls_checks(cls, format: str, raises: Exception | tuple[Exception, ...] = ...) -> Callable[[_F], _F]: ...
def check(self, instance: Any, format: str) -> None: ...
def conforms(self, instance: Any, format: str) -> bool: ...

Expand Down
12 changes: 6 additions & 6 deletions stubs/jsonschema/jsonschema/exceptions.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from _typeshed import Self
from collections import deque
from collections.abc import Container
from typing import Any, Callable, Iterable, Sequence
from collections.abc import Callable, Container, Iterable, Sequence
from typing import Any

from jsonschema import _utils, protocols

RelevanceFuncType = Callable[[ValidationError], Any]
_RelevanceFuncType = Callable[[ValidationError], Any]

WEAK_MATCHES: frozenset[str]
STRONG_MATCHES: frozenset[str]
Expand Down Expand Up @@ -78,8 +78,8 @@ class ErrorTree:
@property
def total_errors(self): ...

def by_relevance(weak: Container[str] = ..., strong: Container[str] = ...) -> RelevanceFuncType: ...
def by_relevance(weak: Container[str] = ..., strong: Container[str] = ...) -> _RelevanceFuncType: ...

relevance: RelevanceFuncType
relevance: _RelevanceFuncType

def best_match(errors: Iterable[ValidationError], key: RelevanceFuncType = ...): ...
def best_match(errors: Iterable[ValidationError], key: _RelevanceFuncType = ...): ...

0 comments on commit 9a3a65f

Please sign in to comment.