diff --git a/stubs/pyflakes/@tests/stubtest_allowlist.txt b/stubs/pyflakes/@tests/stubtest_allowlist.txt index 4b8726c19..3ea354771 100644 --- a/stubs/pyflakes/@tests/stubtest_allowlist.txt +++ b/stubs/pyflakes/@tests/stubtest_allowlist.txt @@ -1,5 +1,4 @@ # These all have class-level defaults that differ from the instance attributes -pyflakes.messages.CommentAnnotationSyntaxError.message_args pyflakes.messages.DuplicateArgument.message_args pyflakes.messages.ForwardAnnotationSyntaxError.message_args pyflakes.messages.FutureFeatureNotDefined.message_args @@ -21,5 +20,6 @@ pyflakes.messages.StringDotFormatMissingArgument.message_args pyflakes.messages.UndefinedExport.message_args pyflakes.messages.UndefinedLocal.message_args pyflakes.messages.UndefinedName.message_args +pyflakes.messages.UnusedAnnotation.message_args pyflakes.messages.UnusedImport.message_args pyflakes.messages.UnusedVariable.message_args diff --git a/stubs/pyflakes/METADATA.toml b/stubs/pyflakes/METADATA.toml index 43ea0392c..4a8e90c0c 100644 --- a/stubs/pyflakes/METADATA.toml +++ b/stubs/pyflakes/METADATA.toml @@ -1 +1 @@ -version = "2.5.*" +version = "3.0.*" diff --git a/stubs/pyflakes/pyflakes/checker.pyi b/stubs/pyflakes/pyflakes/checker.pyi index 4ed32421d..76fc31e7e 100644 --- a/stubs/pyflakes/pyflakes/checker.pyi +++ b/stubs/pyflakes/pyflakes/checker.pyi @@ -2,7 +2,6 @@ import ast import sys from collections.abc import Callable, Iterable, Iterator from re import Pattern -from tokenize import TokenInfo from typing import Any, ClassVar, TypeVar, overload from typing_extensions import Literal, ParamSpec, TypeAlias @@ -19,10 +18,6 @@ PYPY: bool def getAlternatives(n: ast.If | ast.Try) -> list[ast.AST]: ... FOR_TYPES: tuple[type[ast.For], type[ast.AsyncFor]] -TYPE_COMMENT_RE: Pattern[str] -ASCII_NON_ALNUM: str -TYPE_IGNORE_RE: Pattern[str] -TYPE_FUNC_RE: Pattern[str] MAPPING_KEY_RE: Pattern[str] CONVERSION_FLAG_RE: Pattern[str] WIDTH_RE: Pattern[str] @@ -122,17 +117,13 @@ class FunctionScope(Scope): returnValue: Any isGenerator: bool def __init__(self) -> None: ... - def unusedAssignments(self) -> Iterator[tuple[str, Binding]]: ... + def unused_assignments(self) -> Iterator[tuple[str, Binding]]: ... + def unused_annotations(self) -> Iterator[tuple[str, Annotation]]: ... class GeneratorScope(Scope): ... class ModuleScope(Scope): ... class DoctestScope(ModuleScope): ... -class DummyNode: - lineno: int - col_offset: int - def __init__(self, lineno: int, col_offset: int) -> None: ... - class DetectClassScopedMagic: names: list[str] @@ -149,7 +140,6 @@ class AnnotationState: def in_annotation(func: _F) -> _F: ... def in_string_annotation(func: _F) -> _F: ... -def make_tokens(code: str | bytes) -> tuple[TokenInfo, ...]: ... if sys.version_info >= (3, 8): _NamedExpr: TypeAlias = ast.NamedExpr diff --git a/stubs/pyflakes/pyflakes/messages.pyi b/stubs/pyflakes/pyflakes/messages.pyi index e4d6ebabb..9cad06981 100644 --- a/stubs/pyflakes/pyflakes/messages.pyi +++ b/stubs/pyflakes/pyflakes/messages.pyi @@ -75,6 +75,10 @@ class UnusedVariable(Message): message_args: tuple[Any] def __init__(self, filename, loc: ast.AST, names) -> None: ... +class UnusedAnnotation(Message): + message_args: tuple[Any] + def __init__(self, filename, loc: ast.AST, names) -> None: ... + class ReturnOutsideFunction(Message): ... class YieldOutsideFunction(Message): ... class ContinueOutsideLoop(Message): ... @@ -90,10 +94,6 @@ class ForwardAnnotationSyntaxError(Message): message_args: tuple[Any] def __init__(self, filename, loc: ast.AST, annotation) -> None: ... -class CommentAnnotationSyntaxError(Message): - message_args: tuple[Any] - def __init__(self, filename, loc: ast.AST, annotation) -> None: ... - class RaiseNotImplemented(Message): ... class InvalidPrintSyntax(Message): ... class IsLiteral(Message): ...