- update to 6.0.0:

* https://flake8.pycqa.org/en/latest/release-notes/6.0.0.html
  * Require python >= 3.8.1 (See also #1633, #1741).
  * List available formatters in for --format option in --help (See also #223, #1624).
  * Improve multiprocessing performance (See also #1723).
  * Enable multiprocessing on non-fork platforms (See also #1723).
  * Ensure results are sorted when discovered from files (See also #1670, #1726).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8?expand=0&rev=84
This commit is contained in:
Dirk Mueller 2022-12-15 20:59:09 +00:00 committed by Git OBS Bridge
parent b2b2663ff2
commit 9bc92b2de7
5 changed files with 29 additions and 20 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db
size 145862

3
flake8-6.0.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c61007e76655af75e6785a931f452915b371dc48f56efd765247c8fe68f2b181
size 138524

View File

@ -1,11 +1,12 @@
#!/usr/bin/env python3
from __future__ import annotations
import inspect
import os.path
from typing import Any
from typing import Callable
from typing import Generator
from typing import NamedTuple
from typing import Tuple
import pycodestyle
@ -20,7 +21,7 @@ def _too_long(s: str) -> str:
class Call(NamedTuple):
name: str
is_generator: bool
params: Tuple[str, ...]
params: tuple[str, ...]
def to_src(self) -> str:
params_s = ", ".join(self.params)
@ -35,7 +36,7 @@ class Call(NamedTuple):
return "\n".join(lines)
@classmethod
def from_func(cls, func: Callable[..., Any]) -> "Call":
def from_func(cls, func: Callable[..., Any]) -> Call:
spec = inspect.getfullargspec(func)
params = tuple(spec.args)
return cls(func.__name__, inspect.isgeneratorfunction(func), params)
@ -55,9 +56,10 @@ def lines() -> Generator[str, None, None]:
yield f'"""Generated using ./bin/{os.path.basename(__file__)}."""'
yield "# fmt: off"
yield "from __future__ import annotations"
yield ""
yield "from typing import Any"
yield "from typing import Generator"
yield "from typing import Tuple"
yield ""
imports = sorted(call.name for call in logical + physical)
for name in imports:
@ -69,7 +71,7 @@ def lines() -> Generator[str, None, None]:
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], None, None]:"
yield ' """Run pycodestyle logical checks."""'
for call in sorted(logical):
yield call.to_src()
@ -80,7 +82,7 @@ def lines() -> Generator[str, None, None]:
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], None, None]:"
yield ' """Run pycodestyle physical checks."""'
for call in sorted(physical):
yield call.to_src()

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Thu Dec 15 20:56:52 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 6.0.0:
* https://flake8.pycqa.org/en/latest/release-notes/6.0.0.html
* Require python >= 3.8.1 (See also #1633, #1741).
* List available formatters in for --format option in --help (See also #223, #1624).
* Improve multiprocessing performance (See also #1723).
* Enable multiprocessing on non-fork platforms (See also #1723).
* Ensure results are sorted when discovered from files (See also #1670, #1726).
-------------------------------------------------------------------
Sat Aug 27 09:12:43 UTC 2022 - Ben Greiner <code@bnavigator.de>

View File

@ -17,34 +17,30 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-flake8
Version: 5.0.4
Version: 6.0.0
Release: 0
Summary: Modular source code checker: pep8, pyflakes and co
License: MIT
URL: https://flake8.pycqa.org
Source: https://files.pythonhosted.org/packages/source/f/flake8/flake8-%{version}.tar.gz
# workaround for https://github.com/PyCQA/flake8/pull/1669
Source2: https://raw.githubusercontent.com/PyCQA/flake8/5.0.4/bin/gen-pycodestyle-plugin
Source2: https://raw.githubusercontent.com/PyCQA/flake8/%{version}/bin/gen-pycodestyle-plugin
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module importlib-metadata >= 1.1.0 if %python-version < 3.8}
BuildRequires: %{python_module mccabe >= 0.7.0 with %python-mccabe < 0.8.0}
BuildRequires: %{python_module pycodestyle >= 2.9.0 with %python-pycodestyle < 2.10.0}
BuildRequires: %{python_module pyflakes >= 2.5.0 with %python-pyflakes < 2.6.0}
BuildRequires: %{python_module pycodestyle >= 2.10.0 with %python-pycodestyle < 2.11.0}
BuildRequires: %{python_module pyflakes >= 3.0.0 with %python-pyflakes < 3.1.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.9.0 with python-pycodestyle < 2.10.0)
Requires: (python-pyflakes >= 2.5.0 with python-pyflakes < 2.6.0)
%if 0%{?python_version_nodots} < 38
Requires: python-importlib-metadata >= 1.1.0
%endif
Requires: (python-pycodestyle >= 2.10.0 with python-pycodestyle < 2.11.0)
Requires: (python-pyflakes >= 3.0.0 with python-pyflakes < 3.1.0)
Requires(post): update-alternatives
Requires(postun):update-alternatives
%python_subpackages