- Add patch to build with pyflakes-2.0.x:

* python-flake8-3.5.0-pyflakes-2.0.0.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8?expand=0&rev=36
This commit is contained in:
Tomáš Chvátal 2018-08-08 21:44:53 +00:00 committed by Git OBS Bridge
parent f1e28beae6
commit 734d1f2728
3 changed files with 104 additions and 13 deletions

View File

@ -0,0 +1,85 @@
From 527af5c214ef0eccfde3dd58d7ea15e09c483bd3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
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(-)
Index: flake8-3.5.0/docs/source/user/error-codes.rst
===================================================================
--- flake8-3.5.0.orig/docs/source/user/error-codes.rst
+++ flake8-3.5.0/docs/source/user/error-codes.rst
@@ -54,6 +54,9 @@ generates its own :term:`error code`\ s
+------+---------------------------------------------------------------------+
| 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
+------+---------------------------------------------------------------------+
| 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.
Index: flake8-3.5.0/setup.cfg
===================================================================
--- flake8-3.5.0.orig/setup.cfg
+++ flake8-3.5.0/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.0.0, < 2.5.0
mccabe >= 0.6.0, < 0.7.0
Index: flake8-3.5.0/setup.py
===================================================================
--- flake8-3.5.0.orig/setup.py
+++ flake8-3.5.0/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.0.0, < 2.5.0",
"mccabe >= 0.6.0, < 0.7.0",
"setuptools >= 30",
Index: flake8-3.5.0/src/flake8/plugins/pyflakes.py
===================================================================
--- flake8-3.5.0.orig/src/flake8/plugins/pyflakes.py
+++ flake8-3.5.0/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',
}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 8 21:40:39 UTC 2018 - tchvatal@suse.com
- Add patch to build with pyflakes-2.0.x:
* python-flake8-3.5.0-pyflakes-2.0.0.patch
-------------------------------------------------------------------
Sun Apr 15 10:20:40 UTC 2018 - sebix+novell.com@sebix.at

View File

@ -16,27 +16,33 @@
#
%bcond_without python2
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
Name: python-flake8
Version: 3.5.0
Release: 0
Summary: Modular source code checker: pep8, pyflakes and co
License: MIT
Group: Development/Languages/Python
Url: https://gitlab.com/pycqa/flake8
URL: https://gitlab.com/pycqa/flake8
Source: https://files.pythonhosted.org/packages/source/f/flake8/flake8-%{version}.tar.gz
#PATCH-FIX-UPSTREAM fix_pycodestyle_240.patch
Patch0: fix_pycodestyle_240.patch
BuildRequires: %{python_module devel}
Patch1: python-flake8-3.5.0-pyflakes-2.0.0.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-mccabe >= 0.6.0
Requires: python-pycodestyle >= 2.4.0
Requires: python-pyflakes >= 2.0.0
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module mccabe >= 0.2.1}
BuildRequires: %{python_module mock >= 2.0.0}
BuildRequires: %{python_module pycodestyle >= 2.0.0}
BuildRequires: %{python_module pyflakes >= 1.5.0}
BuildRequires: %{python_module pycodestyle >= 2.4.0}
BuildRequires: %{python_module pyflakes >= 2.0.0}
BuildRequires: %{python_module pytest-runner}
BuildRequires: %{python_module pytest}
%if %{with python2}
@ -44,16 +50,10 @@ BuildRequires: python2-configparser
BuildRequires: python2-enum34
%endif
# /SECTION
Requires: python-mccabe >= 0.6.0
Requires: python-pycodestyle >= 2.0.0
Requires: python-pyflakes >= 1.5.0
%ifpython2
Requires: python-configparser
Requires: python-enum34
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%python_subpackages
%description
@ -67,7 +67,7 @@ Flake8 runs all the tools by launching the single ``flake8`` script.
%prep
%setup -q -n flake8-%{version}
%patch0 -p1
%autopatch -p1
%build
%python_build
@ -75,7 +75,7 @@ Flake8 runs all the tools by launching the single ``flake8`` script.
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/flake8
%fdupes %{buildroot}%{_prefix}
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%post
%python_install_alternative flake8