From 365114dfa4ea10c5619be93b91e6008f58eea129 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Jun 11 2018 18:58:51 +0000 Subject: Make this build and run with pyflakes 2.0.0 (#1582075) --- diff --git a/python-flake8-3.5.0-fix-pycodestyle24.patch b/python-flake8-3.5.0-fix-pycodestyle24.patch index f352bd0..60a3e71 100644 --- a/python-flake8-3.5.0-fix-pycodestyle24.patch +++ b/python-flake8-3.5.0-fix-pycodestyle24.patch @@ -1,6 +1,7 @@ -diff -up flake8-3.5.0/setup.cfg.pycodestyle24 flake8-3.5.0/setup.cfg ---- flake8-3.5.0/setup.cfg.pycodestyle24 2018-06-04 10:46:24.488822895 -0400 -+++ flake8-3.5.0/setup.cfg 2018-06-04 10:46:37.544491979 -0400 +diff --git a/setup.cfg b/setup.cfg +index d1c2524..a9d4e66 100644 +--- a/setup.cfg ++++ b/setup.cfg @@ -9,7 +9,7 @@ requires-dist = enum34; python_version<"3.4" configparser; python_version<"3.2" @@ -10,9 +11,10 @@ diff -up flake8-3.5.0/setup.cfg.pycodestyle24 flake8-3.5.0/setup.cfg mccabe >= 0.6.0, < 0.7.0 [egg_info] -diff -up flake8-3.5.0/setup.py.pycodestyle24 flake8-3.5.0/setup.py ---- flake8-3.5.0/setup.py.pycodestyle24 2018-06-04 10:46:44.519315192 -0400 -+++ flake8-3.5.0/setup.py 2018-06-04 10:48:39.730394989 -0400 +diff --git a/setup.py b/setup.py +index aa45e43..b156feb 100644 +--- a/setup.py ++++ b/setup.py @@ -22,7 +22,7 @@ requires = [ # And in which releases we will update those ranges here: # http://flake8.pycqa.org/en/latest/internal/releases.html#releasing-flake8 diff --git a/python-flake8-3.5.0-pyflakes-2.0.0.patch b/python-flake8-3.5.0-pyflakes-2.0.0.patch new file mode 100644 index 0000000..f9a17fb --- /dev/null +++ b/python-flake8-3.5.0-pyflakes-2.0.0.patch @@ -0,0 +1,85 @@ +From 527af5c214ef0eccfde3dd58d7ea15e09c483bd3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Sun, 3 Jun 2018 22:18:48 +0200 +Subject: [PATCH] Update to pyflakes 2.0.0 + +- Add new pyflakes codes +- Bump the required versions +- Fixes https://gitlab.com/pycqa/flake8/issues/422 +--- + docs/source/user/error-codes.rst | 6 ++++++ + setup.cfg | 2 +- + setup.py | 2 +- + src/flake8/plugins/pyflakes.py | 2 ++ + 4 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/docs/source/user/error-codes.rst b/docs/source/user/error-codes.rst +index f14c4ec..89183fa 100644 +--- a/docs/source/user/error-codes.rst ++++ b/docs/source/user/error-codes.rst +@@ -54,6 +54,9 @@ generates its own :term:`error code`\ s for ``pyflakes``: + +------+---------------------------------------------------------------------+ + | F707 | an ``except:`` block as not the last exception handler | + +------+---------------------------------------------------------------------+ ++| F721 | doctest syntax error | ++| F722 | syntax error in forward type annotation | +++------+---------------------------------------------------------------------+ + +------+---------------------------------------------------------------------+ + | F811 | redefinition of unused ``name`` from line ``N`` | + +------+---------------------------------------------------------------------+ +@@ -69,6 +72,9 @@ generates its own :term:`error code`\ s for ``pyflakes``: + +------+---------------------------------------------------------------------+ + | F841 | local variable ``name`` is assigned to but never used | + +------+---------------------------------------------------------------------+ +++------+---------------------------------------------------------------------+ ++| F901 | ``raise NotImplemented`` should be ``raise NotImplementedError`` | +++------+---------------------------------------------------------------------+ + + Note that some of these entries behave differently on Python 2 and Python 3, + for example F812 is specific to Python 2 only. +diff --git a/setup.cfg b/setup.cfg +index a9d4e66..8236435 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -8,7 +8,7 @@ universal = 1 + requires-dist = + enum34; python_version<"3.4" + configparser; python_version<"3.2" +- pyflakes >= 1.5.0, < 1.7.0 ++ pyflakes >= 2.0.0, < 2.1.0 + pycodestyle >= 2.4.0, < 2.5.0 + mccabe >= 0.6.0, < 0.7.0 + +diff --git a/setup.py b/setup.py +index b156feb..00755e7 100644 +--- a/setup.py ++++ b/setup.py +@@ -21,7 +21,7 @@ requires = [ + # http://flake8.pycqa.org/en/latest/faq.html#why-does-flake8-use-ranges-for-its-dependencies + # And in which releases we will update those ranges here: + # http://flake8.pycqa.org/en/latest/internal/releases.html#releasing-flake8 +- "pyflakes >= 1.5.0, < 1.7.0", ++ "pyflakes >= 2.0.0, < 2.1.0", + "pycodestyle >= 2.4.0, < 2.5.0", + "mccabe >= 0.6.0, < 0.7.0", + "setuptools >= 30", +diff --git a/src/flake8/plugins/pyflakes.py b/src/flake8/plugins/pyflakes.py +index bc19291..9ef9e93 100644 +--- a/src/flake8/plugins/pyflakes.py ++++ b/src/flake8/plugins/pyflakes.py +@@ -38,6 +38,7 @@ FLAKE8_PYFLAKES_CODES = { + 'ReturnOutsideFunction': 'F706', + 'DefaultExceptNotLast': 'F707', + 'DoctestSyntaxError': 'F721', ++ 'ForwardAnnotationSyntaxError': 'F722', + 'RedefinedWhileUnused': 'F811', + 'RedefinedInListComp': 'F812', + 'UndefinedName': 'F821', +@@ -45,6 +46,7 @@ FLAKE8_PYFLAKES_CODES = { + 'UndefinedLocal': 'F823', + 'DuplicateArgument': 'F831', + 'UnusedVariable': 'F841', ++ 'RaiseNotImplemented': 'F901', + } + + diff --git a/python-flake8.spec b/python-flake8.spec index 6dff1b0..de21723 100644 --- a/python-flake8.spec +++ b/python-flake8.spec @@ -12,13 +12,13 @@ %global modname flake8 -%global pyflakes_dep >= 1.5.0 +%global pyflakes_dep >= 2.0.0 %global pycodestyle_dep >= 2.4.0 %global mccabe_dep >= 0.6.0 Name: python-%{modname} Version: 3.5.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Python code checking using pyflakes, pycodestyle, and mccabe License: MIT @@ -30,6 +30,9 @@ Source0: https://files.pythonhosted.org/packages/source/f/%{modname}/%{ # https://gitlab.com/pycqa/flake8/commit/ef1d5ceefcbfacf5dfe94534c4879ca814b130f0 Patch0: python-flake8-3.5.0-fix-pycodestyle24.patch +# https://gitlab.com/pycqa/flake8/merge_requests/239 +Patch1: python-flake8-3.5.0-pyflakes-2.0.0.patch + BuildArch: noarch %description @@ -114,7 +117,7 @@ This is version of the package running with Python 3. %prep -%autosetup -n %{modname}-%{version} +%autosetup -p1 -n %{modname}-%{version} %build @@ -168,6 +171,9 @@ ln -s flake8-%{defaultpython} %{buildroot}%{_bindir}/flake8 %changelog +* Mon Jun 11 2018 Miro Hrončok - 3.5.0-4 +- Make this build and run with pyflakes 2.0.0 (#1582075) + * Mon Jun 4 2018 Tom Callaway - 3.5.0-3 - apply upstream changes to use pycodestyle 2.4.0