Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-flake8 for openSUSE:Factory checked in at 2025-05-20 09:30:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-flake8 (Old) and /work/SRC/openSUSE:Factory/.python-flake8.new.30101 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-flake8" Tue May 20 09:30:56 2025 rev:47 rq:1269469 version:7.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-flake8/python-flake8.changes 2024-08-22 18:10:47.795488134 +0200 +++ /work/SRC/openSUSE:Factory/.python-flake8.new.30101/python-flake8.changes 2025-05-20 09:30:59.079439249 +0200 @@ -1,0 +2,8 @@ +Tue Apr 15 07:54:43 UTC 2025 - Dirk Müller <dmuel...@suse.com> + +- update to 7.2.0: + * pycodestyle has been updated to >= 2.13.0, < 2.14.0 + * pyflakes has been updated to >= 3.3.0, < 3.4.0 + * Require python >= 3.9 (See also :pull:`1973`). + +------------------------------------------------------------------- Old: ---- flake8-7.1.1.tar.gz New: ---- flake8-7.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-flake8.spec ++++++ --- /var/tmp/diff_new_pack.hoBNWl/_old 2025-05-20 09:30:59.667463751 +0200 +++ /var/tmp/diff_new_pack.hoBNWl/_new 2025-05-20 09:30:59.667463751 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-flake8 # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-flake8 -Version: 7.1.1 +Version: 7.2.0 Release: 0 Summary: Modular source code checker: pep8, pyflakes and co License: MIT @@ -34,15 +34,15 @@ BuildRequires: python-rpm-macros # SECTION test requirements BuildRequires: %{python_module mccabe >= 0.7.0 with %python-mccabe < 0.8.0} -BuildRequires: %{python_module pycodestyle >= 2.12.0 with %python-pycodestyle < 2.13.0} -BuildRequires: %{python_module pyflakes >= 3.2.0 with %python-pyflakes < 3.3.0} +BuildRequires: %{python_module pycodestyle >= 2.13.0 with %python-pycodestyle < 2.14.0} +BuildRequires: %{python_module pyflakes >= 3.3.0 with %python-pyflakes < 3.4.0} BuildRequires: %{python_module pytest} # /SECTION BuildArch: noarch # https://flake8.pycqa.org/en/latest/faq.html#why-does-flake8-use-ranges-for-its-dependencies Requires: (python-mccabe >= 0.7.0 with python-mccabe < 0.8.0) -Requires: (python-pycodestyle >= 2.12.0 with python-pycodestyle < 2.13.0) -Requires: (python-pyflakes >= 3.2.0 with python-pyflakes < 3.3.0) +Requires: (python-pycodestyle >= 2.13.0 with python-pycodestyle < 2.14.0) +Requires: (python-pyflakes >= 3.3.0 with python-pyflakes < 3.4.0) Requires(post): update-alternatives Requires(postun): update-alternatives %python_subpackages ++++++ flake8-7.1.1.tar.gz -> flake8-7.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/.github/workflows/main.yml new/flake8-7.2.0/.github/workflows/main.yml --- old/flake8-7.1.1/.github/workflows/main.yml 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/.github/workflows/main.yml 2025-03-29 21:17:35.000000000 +0100 @@ -16,9 +16,6 @@ python: pypy-3.9 toxenv: py - os: ubuntu-latest - python: 3.8 - toxenv: py - - os: ubuntu-latest python: 3.9 toxenv: py - os: ubuntu-latest @@ -28,11 +25,14 @@ python: '3.11' toxenv: py - os: ubuntu-latest - python: '3.12-dev' + python: '3.12' + toxenv: py + - os: ubuntu-latest + python: '3.13' toxenv: py # windows - os: windows-latest - python: 3.8 + python: 3.9 toxenv: py # misc - os: ubuntu-latest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/.pre-commit-config.yaml new/flake8-7.2.0/.pre-commit-config.yaml --- old/flake8-7.1.1/.pre-commit-config.yaml 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/.pre-commit-config.yaml 2025-03-29 21:17:35.000000000 +0100 @@ -12,19 +12,19 @@ hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder-python-imports - rev: v3.12.0 + rev: v3.14.0 hooks: - id: reorder-python-imports args: [ --application-directories, '.:src', - --py38-plus, + --py39-plus, --add-import, 'from __future__ import annotations', ] - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.19.1 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/psf/black rev: 23.12.1 hooks: @@ -35,7 +35,7 @@ hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.15.0 hooks: - id: mypy exclude: ^(docs/|example-plugin/) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/bin/gen-pycodestyle-plugin new/flake8-7.2.0/bin/gen-pycodestyle-plugin --- old/flake8-7.1.1/bin/gen-pycodestyle-plugin 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/bin/gen-pycodestyle-plugin 2025-03-29 21:17:35.000000000 +0100 @@ -3,9 +3,9 @@ import inspect import os.path +from collections.abc import Generator from typing import Any from typing import Callable -from typing import Generator from typing import NamedTuple import pycodestyle @@ -42,7 +42,7 @@ return cls(func.__name__, inspect.isgeneratorfunction(func), params) -def lines() -> Generator[str, None, None]: +def lines() -> Generator[str]: logical = [] physical = [] @@ -58,8 +58,8 @@ yield "# fmt: off" yield "from __future__ import annotations" yield "" + yield "from collections.abc import Generator" yield "from typing import Any" - yield "from typing import Generator" yield "" imports = sorted(call.name for call in logical + physical) for name in imports: @@ -71,7 +71,7 @@ logical_params = {param for call in logical for param in call.params} for param in sorted(logical_params): yield f" {param}: Any," - yield ") -> Generator[tuple[int, str], None, None]:" + yield ") -> Generator[tuple[int, str]]:" yield ' """Run pycodestyle logical checks."""' for call in sorted(logical): yield call.to_src() @@ -82,7 +82,7 @@ physical_params = {param for call in physical for param in call.params} for param in sorted(physical_params): yield f" {param}: Any," - yield ") -> Generator[tuple[int, str], None, None]:" + yield ") -> Generator[tuple[int, str]]:" yield ' """Run pycodestyle physical checks."""' for call in sorted(physical): yield call.to_src() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/docs/source/internal/releases.rst new/flake8-7.2.0/docs/source/internal/releases.rst --- old/flake8-7.1.1/docs/source/internal/releases.rst 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/docs/source/internal/releases.rst 2025-03-29 21:17:35.000000000 +0100 @@ -81,9 +81,9 @@ Before releasing, the following tox test environments must pass: -- Python 3.8 (a.k.a., ``tox -e py38``) +- Python 3.9 (a.k.a., ``tox -e py39``) -- Python 3.12 (a.k.a., ``tox -e py312``) +- Python 3.13 (a.k.a., ``tox -e py313``) - PyPy 3 (a.k.a., ``tox -e pypy3``) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/docs/source/release-notes/7.1.2.rst new/flake8-7.2.0/docs/source/release-notes/7.1.2.rst --- old/flake8-7.1.1/docs/source/release-notes/7.1.2.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/flake8-7.2.0/docs/source/release-notes/7.1.2.rst 2025-03-29 21:17:35.000000000 +0100 @@ -0,0 +1,15 @@ +7.1.2 -- 2025-02-16 +------------------- + +You can view the `7.1.2 milestone`_ on GitHub for more details. + +Bugs Fixed +~~~~~~~~~~ + +- Avoid starting unnecessary processes when "# files" < "jobs". + (See also :pull:`1966`). + + +.. all links +.. _7.1.2 milestone: + https://github.com/PyCQA/flake8/milestone/52 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/docs/source/release-notes/7.2.0.rst new/flake8-7.2.0/docs/source/release-notes/7.2.0.rst --- old/flake8-7.1.1/docs/source/release-notes/7.2.0.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/flake8-7.2.0/docs/source/release-notes/7.2.0.rst 2025-03-29 21:17:35.000000000 +0100 @@ -0,0 +1,19 @@ +7.2.0 -- 2025-03-29 +------------------- + +You can view the `7.2.0 milestone`_ on GitHub for more details. + +New Dependency Information +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- pycodestyle has been updated to >= 2.13.0, < 2.14.0 (See also :pull:`1974`). +- pyflakes has been updated to >= 3.3.0, < 3.4.0 (See also :pull:`1974`). + +Features +~~~~~~~~ + +- Require python >= 3.9 (See also :pull:`1973`). + +.. all links +.. _7.2.0 milestone: + https://github.com/PyCQA/flake8/milestone/53 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/docs/source/release-notes/index.rst new/flake8-7.2.0/docs/source/release-notes/index.rst --- old/flake8-7.1.1/docs/source/release-notes/index.rst 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/docs/source/release-notes/index.rst 2025-03-29 21:17:35.000000000 +0100 @@ -12,6 +12,8 @@ 7.0.0 7.1.0 7.1.1 + 7.1.2 + 7.2.0 6.x Release Series ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/docs/source/user/invocation.rst new/flake8-7.2.0/docs/source/user/invocation.rst --- old/flake8-7.1.1/docs/source/user/invocation.rst 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/docs/source/user/invocation.rst 2025-03-29 21:17:35.000000000 +0100 @@ -14,25 +14,25 @@ Where you simply allow the shell running in your terminal to locate |Flake8|. In some cases, though, you may have installed |Flake8| for multiple versions -of Python (e.g., Python 3.8 and Python 3.9) and you need to call a specific +of Python (e.g., Python 3.13 and Python 3.14) and you need to call a specific version. In that case, you will have much better results using: .. prompt:: bash - python3.8 -m flake8 + python3.13 -m flake8 Or .. prompt:: bash - python3.9 -m flake8 + python3.14 -m flake8 Since that will tell the correct version of Python to run |Flake8|. .. note:: - Installing |Flake8| once will not install it on both Python 3.8 and - Python 3.9. It will only install it for the version of Python that + Installing |Flake8| once will not install it on both Python 3.13 and + Python 3.14. It will only install it for the version of Python that is running pip. It is also possible to specify command-line options directly to |Flake8|: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/example-plugin/setup.py new/flake8-7.2.0/example-plugin/setup.py --- old/flake8-7.1.1/example-plugin/setup.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/example-plugin/setup.py 2025-03-29 21:17:35.000000000 +0100 @@ -23,8 +23,6 @@ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Quality Assurance", ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/setup.cfg new/flake8-7.2.0/setup.cfg --- old/flake8-7.1.1/setup.cfg 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/setup.cfg 2025-03-29 21:17:35.000000000 +0100 @@ -29,9 +29,9 @@ packages = find: install_requires = mccabe>=0.7.0,<0.8.0 - pycodestyle>=2.12.0,<2.13.0 - pyflakes>=3.2.0,<3.3.0 -python_requires = >=3.8.1 + pycodestyle>=2.13.0,<2.14.0 + pyflakes>=3.3.0,<3.4.0 +python_requires = >=3.9 package_dir = =src diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/__init__.py new/flake8-7.2.0/src/flake8/__init__.py --- old/flake8-7.1.1/src/flake8/__init__.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/__init__.py 2025-03-29 21:17:35.000000000 +0100 @@ -17,7 +17,7 @@ LOG = logging.getLogger(__name__) LOG.addHandler(logging.NullHandler()) -__version__ = "7.1.1" +__version__ = "7.2.0" __version_info__ = tuple(int(i) for i in __version__.split(".") if i.isdigit()) _VERBOSITY_TO_LOG_LEVEL = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/checker.py new/flake8-7.2.0/src/flake8/checker.py --- old/flake8-7.1.1/src/flake8/checker.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/checker.py 2025-03-29 21:17:35.000000000 +0100 @@ -9,12 +9,10 @@ import operator import signal import tokenize +from collections.abc import Generator +from collections.abc import Sequence from typing import Any -from typing import Generator -from typing import List from typing import Optional -from typing import Sequence -from typing import Tuple from flake8 import defaults from flake8 import exceptions @@ -27,7 +25,7 @@ from flake8.plugins.finder import LoadedPlugin from flake8.style_guide import StyleGuideManager -Results = List[Tuple[str, int, int, str, Optional[str]]] +Results = list[tuple[str, int, int, str, Optional[str]]] LOG = logging.getLogger(__name__) @@ -53,7 +51,7 @@ @contextlib.contextmanager def _mp_prefork( plugins: Checkers, options: argparse.Namespace -) -> Generator[None, None, None]: +) -> Generator[None]: # we can save significant startup work w/ `fork` multiprocessing global _mp_plugins, _mp_options _mp_plugins, _mp_options = plugins, options @@ -256,6 +254,7 @@ exclude=self.exclude, ) ) + self.jobs = min(len(self.filenames), self.jobs) def stop(self) -> None: """Stop checking files.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/discover_files.py new/flake8-7.2.0/src/flake8/discover_files.py --- old/flake8-7.1.1/src/flake8/discover_files.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/discover_files.py 2025-03-29 21:17:35.000000000 +0100 @@ -3,9 +3,9 @@ import logging import os.path +from collections.abc import Generator +from collections.abc import Sequence from typing import Callable -from typing import Generator -from typing import Sequence from flake8 import utils @@ -16,7 +16,7 @@ arg: str, *, predicate: Callable[[str], bool], -) -> Generator[str, None, None]: +) -> Generator[str]: """Generate filenames from an argument. :param arg: @@ -55,7 +55,7 @@ stdin_display_name: str, filename_patterns: Sequence[str], exclude: Sequence[str], -) -> Generator[str, None, None]: +) -> Generator[str]: """Expand out ``paths`` from commandline to the lintable files.""" if not paths: paths = ["."] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/main/application.py new/flake8-7.2.0/src/flake8/main/application.py --- old/flake8-7.1.1/src/flake8/main/application.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/main/application.py 2025-03-29 21:17:35.000000000 +0100 @@ -5,7 +5,7 @@ import json import logging import time -from typing import Sequence +from collections.abc import Sequence import flake8 from flake8 import checker diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/main/cli.py new/flake8-7.2.0/src/flake8/main/cli.py --- old/flake8-7.1.1/src/flake8/main/cli.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/main/cli.py 2025-03-29 21:17:35.000000000 +0100 @@ -2,7 +2,7 @@ from __future__ import annotations import sys -from typing import Sequence +from collections.abc import Sequence from flake8.main import application diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/options/aggregator.py new/flake8-7.2.0/src/flake8/options/aggregator.py --- old/flake8-7.1.1/src/flake8/options/aggregator.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/options/aggregator.py 2025-03-29 21:17:35.000000000 +0100 @@ -8,7 +8,7 @@ import argparse import configparser import logging -from typing import Sequence +from collections.abc import Sequence from flake8.options import config from flake8.options.manager import OptionManager diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/options/manager.py new/flake8-7.2.0/src/flake8/options/manager.py --- old/flake8-7.1.1/src/flake8/options/manager.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/options/manager.py 2025-03-29 21:17:35.000000000 +0100 @@ -5,9 +5,9 @@ import enum import functools import logging +from collections.abc import Sequence from typing import Any from typing import Callable -from typing import Sequence from flake8 import utils from flake8.plugins.finder import Plugins diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/options/parse_args.py new/flake8-7.2.0/src/flake8/options/parse_args.py --- old/flake8-7.1.1/src/flake8/options/parse_args.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/options/parse_args.py 2025-03-29 21:17:35.000000000 +0100 @@ -2,7 +2,7 @@ from __future__ import annotations import argparse -from typing import Sequence +from collections.abc import Sequence import flake8 from flake8.main import options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/plugins/finder.py new/flake8-7.2.0/src/flake8/plugins/finder.py --- old/flake8-7.1.1/src/flake8/plugins/finder.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/plugins/finder.py 2025-03-29 21:17:35.000000000 +0100 @@ -7,9 +7,9 @@ import itertools import logging import sys +from collections.abc import Generator +from collections.abc import Iterable from typing import Any -from typing import Generator -from typing import Iterable from typing import NamedTuple from flake8 import utils @@ -68,7 +68,7 @@ reporters: dict[str, LoadedPlugin] disabled: list[LoadedPlugin] - def all_plugins(self) -> Generator[LoadedPlugin, None, None]: + def all_plugins(self) -> Generator[LoadedPlugin]: """Return an iterator over all :class:`LoadedPlugin`s.""" yield from self.checkers.tree yield from self.checkers.logical_line @@ -151,7 +151,7 @@ eps: Iterable[importlib.metadata.EntryPoint], name: str, version: str, -) -> Generator[Plugin, None, None]: +) -> Generator[Plugin]: pyflakes_meta = importlib.metadata.distribution("pyflakes").metadata pycodestyle_meta = importlib.metadata.distribution("pycodestyle").metadata @@ -173,7 +173,7 @@ yield Plugin(name, version, ep) -def _find_importlib_plugins() -> Generator[Plugin, None, None]: +def _find_importlib_plugins() -> Generator[Plugin]: # some misconfigured pythons (RHEL) have things on `sys.path` twice seen = set() for dist in importlib.metadata.distributions(): @@ -212,7 +212,7 @@ def _find_local_plugins( cfg: configparser.RawConfigParser, -) -> Generator[Plugin, None, None]: +) -> Generator[Plugin]: for plugin_type in ("extension", "report"): group = f"flake8.{plugin_type}" for plugin_s in utils.parse_comma_separated_list( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/plugins/pycodestyle.py new/flake8-7.2.0/src/flake8/plugins/pycodestyle.py --- old/flake8-7.1.1/src/flake8/plugins/pycodestyle.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/plugins/pycodestyle.py 2025-03-29 21:17:35.000000000 +0100 @@ -2,8 +2,8 @@ # fmt: off from __future__ import annotations +from collections.abc import Generator from typing import Any -from typing import Generator from pycodestyle import ambiguous_identifier as _ambiguous_identifier from pycodestyle import bare_except as _bare_except @@ -55,7 +55,7 @@ previous_unindented_logical_line: Any, tokens: Any, verbose: Any, -) -> Generator[tuple[int, str], None, None]: +) -> Generator[tuple[int, str]]: """Run pycodestyle logical checks.""" yield from _ambiguous_identifier(logical_line, tokens) yield from _bare_except(logical_line, noqa) @@ -93,7 +93,7 @@ noqa: Any, physical_line: Any, total_lines: Any, -) -> Generator[tuple[int, str], None, None]: +) -> Generator[tuple[int, str]]: """Run pycodestyle physical checks.""" ret = _maximum_line_length(physical_line, max_line_length, multiline, line_number, noqa) # noqa: E501 if ret is not None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/plugins/pyflakes.py new/flake8-7.2.0/src/flake8/plugins/pyflakes.py --- old/flake8-7.1.1/src/flake8/plugins/pyflakes.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/plugins/pyflakes.py 2025-03-29 21:17:35.000000000 +0100 @@ -4,8 +4,8 @@ import argparse import ast import logging +from collections.abc import Generator from typing import Any -from typing import Generator import pyflakes.checker @@ -55,6 +55,7 @@ "UndefinedName": "F821", "UndefinedExport": "F822", "UndefinedLocal": "F823", + "UnusedIndirectAssignment": "F824", "DuplicateArgument": "F831", "UnusedVariable": "F841", "UnusedAnnotation": "F842", @@ -97,7 +98,7 @@ cls.builtIns = cls.builtIns.union(options.builtins) cls.with_doctest = options.doctests - def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: + def run(self) -> Generator[tuple[int, int, str, type[Any]]]: """Run the plugin.""" for message in self.messages: col = getattr(message, "col", 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/processor.py new/flake8-7.2.0/src/flake8/processor.py --- old/flake8-7.1.1/src/flake8/processor.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/processor.py 2025-03-29 21:17:35.000000000 +0100 @@ -6,10 +6,8 @@ import functools import logging import tokenize +from collections.abc import Generator from typing import Any -from typing import Generator -from typing import List -from typing import Tuple from flake8 import defaults from flake8 import utils @@ -24,8 +22,8 @@ [tokenize.NL, tokenize.NEWLINE, tokenize.INDENT, tokenize.DEDENT] ) -_LogicalMapping = List[Tuple[int, Tuple[int, int]]] -_Logical = Tuple[List[str], List[str], _LogicalMapping] +_LogicalMapping = list[tuple[int, tuple[int, int]]] +_Logical = tuple[list[str], list[str], _LogicalMapping] class FileProcessor: @@ -127,9 +125,7 @@ """Signal the beginning of an fstring.""" self._fstring_start = lineno - def multiline_string( - self, token: tokenize.TokenInfo - ) -> Generator[str, None, None]: + def multiline_string(self, token: tokenize.TokenInfo) -> Generator[str]: """Iterate through the lines of a multiline string.""" if token.type == FSTRING_END: # pragma: >=3.12 cover start = self._fstring_start @@ -210,7 +206,7 @@ brace_offset = text.count("{") + text.count("}") text = "x" * (len(text) + brace_offset) end = (end[0], end[1] + brace_offset) - if previous_row: + if previous_row is not None and previous_column is not None: (start_row, start_column) = start if previous_row != start_row: row_index = previous_row - 1 @@ -263,7 +259,7 @@ ) return ret - def generate_tokens(self) -> Generator[tokenize.TokenInfo, None, None]: + def generate_tokens(self) -> Generator[tokenize.TokenInfo]: """Tokenize the file and yield the tokens.""" for token in tokenize.generate_tokens(self.next_line): if token[2][0] > self.total_lines: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/statistics.py new/flake8-7.2.0/src/flake8/statistics.py --- old/flake8-7.1.1/src/flake8/statistics.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/statistics.py 2025-03-29 21:17:35.000000000 +0100 @@ -1,7 +1,7 @@ """Statistic collection logic for Flake8.""" from __future__ import annotations -from typing import Generator +from collections.abc import Generator from typing import NamedTuple from flake8.violation import Violation @@ -36,7 +36,7 @@ def statistics_for( self, prefix: str, filename: str | None = None - ) -> Generator[Statistic, None, None]: + ) -> Generator[Statistic]: """Generate statistics for the prefix and filename. If you have a :class:`Statistics` object that has recorded errors, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/style_guide.py new/flake8-7.2.0/src/flake8/style_guide.py --- old/flake8-7.1.1/src/flake8/style_guide.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/style_guide.py 2025-03-29 21:17:35.000000000 +0100 @@ -7,8 +7,8 @@ import enum import functools import logging -from typing import Generator -from typing import Sequence +from collections.abc import Generator +from collections.abc import Sequence from flake8 import defaults from flake8 import statistics @@ -225,13 +225,11 @@ *self.populate_style_guides_with(options), ] - self.style_guide_for = functools.lru_cache(maxsize=None)( - self._style_guide_for - ) + self.style_guide_for = functools.cache(self._style_guide_for) def populate_style_guides_with( self, options: argparse.Namespace - ) -> Generator[StyleGuide, None, None]: + ) -> Generator[StyleGuide]: """Generate style guides from the per-file-ignores option. :param options: @@ -253,9 +251,7 @@ ) @contextlib.contextmanager - def processing_file( - self, filename: str - ) -> Generator[StyleGuide, None, None]: + def processing_file(self, filename: str) -> Generator[StyleGuide]: """Record the fact that we're processing the file's results.""" guide = self.style_guide_for(filename) with guide.processing_file(filename): @@ -338,9 +334,7 @@ ) @contextlib.contextmanager - def processing_file( - self, filename: str - ) -> Generator[StyleGuide, None, None]: + def processing_file(self, filename: str) -> Generator[StyleGuide]: """Record the fact that we're processing the file's results.""" self.formatter.beginning(filename) yield self diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/utils.py new/flake8-7.2.0/src/flake8/utils.py --- old/flake8-7.1.1/src/flake8/utils.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/utils.py 2025-03-29 21:17:35.000000000 +0100 @@ -11,9 +11,9 @@ import sys import textwrap import tokenize +from collections.abc import Sequence +from re import Pattern from typing import NamedTuple -from typing import Pattern -from typing import Sequence from flake8 import exceptions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/src/flake8/violation.py new/flake8-7.2.0/src/flake8/violation.py --- old/flake8-7.1.1/src/flake8/violation.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/src/flake8/violation.py 2025-03-29 21:17:35.000000000 +0100 @@ -4,7 +4,7 @@ import functools import linecache import logging -from typing import Match +from re import Match from typing import NamedTuple from flake8 import defaults diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.1/tests/unit/test_checker_manager.py new/flake8-7.2.0/tests/unit/test_checker_manager.py --- old/flake8-7.1.1/tests/unit/test_checker_manager.py 2024-08-04 22:31:56.000000000 +0200 +++ new/flake8-7.2.0/tests/unit/test_checker_manager.py 2025-03-29 21:17:35.000000000 +0100 @@ -61,14 +61,20 @@ assert manager.jobs == 0 -def test_make_checkers(): - """Verify that we create a list of FileChecker instances.""" +def test_jobs_count_limited_to_file_count(): style_guide = style_guide_mock() + style_guide.options.jobs = JobsArgument("4") style_guide.options.filenames = ["file1", "file2"] manager = checker.Manager(style_guide, finder.Checkers([], [], []), []) + assert manager.jobs == 4 + manager.start() + assert manager.jobs == 2 - with mock.patch("flake8.utils.fnmatch", return_value=True): - with mock.patch("flake8.processor.FileProcessor"): - manager.start() +def test_make_checkers(): + """Verify that we create a list of FileChecker instances.""" + style_guide = style_guide_mock() + style_guide.options.filenames = ["file1", "file2"] + manager = checker.Manager(style_guide, finder.Checkers([], [], []), []) + manager.start() assert manager.filenames == ("file1", "file2") ++++++ gen-pycodestyle-plugin ++++++ --- /var/tmp/diff_new_pack.hoBNWl/_old 2025-05-20 09:30:59.851471418 +0200 +++ /var/tmp/diff_new_pack.hoBNWl/_new 2025-05-20 09:30:59.855471584 +0200 @@ -3,9 +3,9 @@ import inspect import os.path +from collections.abc import Generator from typing import Any from typing import Callable -from typing import Generator from typing import NamedTuple import pycodestyle @@ -42,7 +42,7 @@ return cls(func.__name__, inspect.isgeneratorfunction(func), params) -def lines() -> Generator[str, None, None]: +def lines() -> Generator[str]: logical = [] physical = [] @@ -58,8 +58,8 @@ yield "# fmt: off" yield "from __future__ import annotations" yield "" + yield "from collections.abc import Generator" yield "from typing import Any" - yield "from typing import Generator" yield "" imports = sorted(call.name for call in logical + physical) for name in imports: @@ -71,7 +71,7 @@ logical_params = {param for call in logical for param in call.params} for param in sorted(logical_params): yield f" {param}: Any," - yield ") -> Generator[tuple[int, str], None, None]:" + yield ") -> Generator[tuple[int, str]]:" yield ' """Run pycodestyle logical checks."""' for call in sorted(logical): yield call.to_src() @@ -82,7 +82,7 @@ physical_params = {param for call in physical for param in call.params} for param in sorted(physical_params): yield f" {param}: Any," - yield ") -> Generator[tuple[int, str], None, None]:" + yield ") -> Generator[tuple[int, str]]:" yield ' """Run pycodestyle physical checks."""' for call in sorted(physical): yield call.to_src()