From a15f4220a71e5065738d8e7cc71e0431aedaf77f482b9efa2b47af1a0131d825 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 5 Feb 2019 10:24:45 +0000 Subject: [PATCH] Accepting request 671477 from home:alarrosa:branches:devel:languages:python - Update to version 3.7.5: * Bugs Fixed + Fix reporting of pyflakes "referenced before assignment" error (See also GitLab!301, GitLab#503) - Update to version 3.7.4: * Bugs Fixed + Fix performance regression with lots of per-file-ignores and errors (See also GitLab!299, GitLab#501) - Update to version 3.7.3: * Bugs Fixed + Fix imports of typing in python 3.5.0 / 3.5.1 (See also GitLab!294, GitLab#498) + Fix flake8 --statistics (See also GitLab!295, GitLab#499) + Gracefully ignore flake8-per-file-ignores plugin if installed (See also GitLab!297, GitLab#495) + Improve error message for malformed per-file-ignores (See also GitLab!298, GitLab#489) - Update to version 3.7.2: * Bugs Fixed + Fix broken flake8 --diff (regressed in 3.7.0) (See also GitLab!292, GitLab#490) + Fix typo in plugin exception reporting (See also GitLab!275, GitLab#491) + Fix AttributeError while attempting to use the legacy api (regressed in 3.7.0) (See also GitLab!293, GitLab#497) - Update to version 3.7.1: * Bugs Fixed + Fix capitalized filenames in per-file-ignores setting (See also GitLab!290, GitLab#488) - Update to version 3.7.0: * New Dependency Information + Add dependency on entrypoints >= 0.3, < 0.4 OBS-URL: https://build.opensuse.org/request/show/671477 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8?expand=0&rev=44 --- flake8-3.6.0.tar.gz | 3 -- flake8-3.7.5.tar.gz | 3 ++ pyflakes21.patch | 65 ------------------------------------ python-flake8.changes | 62 ++++++++++++++++++++++++++++++++++ python-flake8.spec | 22 ++++++++---- remove_mock_dependency.patch | 32 ++++++++++-------- 6 files changed, 99 insertions(+), 88 deletions(-) delete mode 100644 flake8-3.6.0.tar.gz create mode 100644 flake8-3.7.5.tar.gz delete mode 100644 pyflakes21.patch diff --git a/flake8-3.6.0.tar.gz b/flake8-3.6.0.tar.gz deleted file mode 100644 index 90a2e1b..0000000 --- a/flake8-3.6.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6a35f5b8761f45c5513e3405f110a86bea57982c3b75b766ce7b65217abe1670 -size 144684 diff --git a/flake8-3.7.5.tar.gz b/flake8-3.7.5.tar.gz new file mode 100644 index 0000000..f8ceccf --- /dev/null +++ b/flake8-3.7.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd9ddf503110bf3d8b1d270e8c673aab29ccb3dd6abf29bae1f54e5116ab4a91 +size 148039 diff --git a/pyflakes21.patch b/pyflakes21.patch deleted file mode 100644 index dea8a0d..0000000 --- a/pyflakes21.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 03ea38df168036a38aff7af916c07c05fe1f2eb2 Mon Sep 17 00:00:00 2001 -From: Anthony Sottile -Date: Sat, 19 Jan 2019 11:59:38 -0800 -Subject: [PATCH] WIP: use latest pyflakes - ---- - setup.py | 2 +- - src/flake8/plugins/pyflakes.py | 10 ++++++++-- - 2 files changed, 9 insertions(+), 3 deletions(-) - -Index: flake8-3.6.0/setup.py -=================================================================== ---- flake8-3.6.0.orig/setup.py -+++ flake8-3.6.0/setup.py -@@ -25,7 +25,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 >= 2.0.0, < 2.1.0", -+ "pyflakes >= 2.1.0, < 2.2.0", - "pycodestyle >= 2.4.0, < 2.5.0", - "mccabe >= 0.6.0, < 0.7.0", - "setuptools >= 30", -Index: flake8-3.6.0/src/flake8/plugins/pyflakes.py -=================================================================== ---- flake8-3.6.0.orig/src/flake8/plugins/pyflakes.py -+++ flake8-3.6.0/src/flake8/plugins/pyflakes.py -@@ -30,6 +30,8 @@ FLAKE8_PYFLAKES_CODES = { - "TooManyExpressionsInStarredAssignment": "F621", - "TwoStarredExpressions": "F622", - "AssertTuple": "F631", -+ "IsLiteral": "F632", -+ "InvalidPrintSyntax": "F633", - "BreakOutsideLoop": "F701", - "ContinueOutsideLoop": "F702", - "ContinueInFinally": "F703", -@@ -39,6 +41,7 @@ FLAKE8_PYFLAKES_CODES = { - "DefaultExceptNotLast": "F707", - "DoctestSyntaxError": "F721", - "ForwardAnnotationSyntaxError": "F722", -+ "CommentAnnotationSyntaxError": "F723", - "RedefinedWhileUnused": "F811", - "RedefinedInListComp": "F812", - "UndefinedName": "F821", -@@ -72,7 +75,7 @@ class FlakesChecker(pyflakes.checker.Che - include_in_doctest = [] - exclude_from_doctest = [] - -- def __init__(self, tree, filename): -+ def __init__(self, tree, file_tokens, filename): - """Initialize the PyFlakes plugin with an AST tree and filename.""" - filename = utils.normalize_paths(filename)[0] - with_doctest = self.with_doctest -@@ -97,7 +100,10 @@ class FlakesChecker(pyflakes.checker.Che - with_doctest = True - - super(FlakesChecker, self).__init__( -- tree, filename, withDoctest=with_doctest -+ tree, -+ filename=filename, -+ withDoctest=with_doctest, -+ file_tokens=file_tokens, - ) - - @classmethod diff --git a/python-flake8.changes b/python-flake8.changes index 75ad8ac..fb602d4 100644 --- a/python-flake8.changes +++ b/python-flake8.changes @@ -1,3 +1,65 @@ +------------------------------------------------------------------- +Tue Feb 5 09:21:47 UTC 2019 - Antonio Larrosa + +- Update to version 3.7.5: + * Bugs Fixed + + Fix reporting of pyflakes "referenced before assignment" error + (See also GitLab!301, GitLab#503) + +- Update to version 3.7.4: + * Bugs Fixed + + Fix performance regression with lots of per-file-ignores and errors + (See also GitLab!299, GitLab#501) + +- Update to version 3.7.3: + * Bugs Fixed + + Fix imports of typing in python 3.5.0 / 3.5.1 (See also GitLab!294, + GitLab#498) + + Fix flake8 --statistics (See also GitLab!295, GitLab#499) + + Gracefully ignore flake8-per-file-ignores plugin if installed + (See also GitLab!297, GitLab#495) + + Improve error message for malformed per-file-ignores + (See also GitLab!298, GitLab#489) + +- Update to version 3.7.2: + * Bugs Fixed + + Fix broken flake8 --diff (regressed in 3.7.0) (See also GitLab!292, + GitLab#490) + + Fix typo in plugin exception reporting (See also GitLab!275, GitLab#491) + + Fix AttributeError while attempting to use the legacy api + (regressed in 3.7.0) (See also GitLab!293, GitLab#497) + +- Update to version 3.7.1: + * Bugs Fixed + + Fix capitalized filenames in per-file-ignores setting (See also GitLab!290, GitLab#488) + +- Update to version 3.7.0: + * New Dependency Information + + Add dependency on entrypoints >= 0.3, < 0.4 + (See also GitLab!264, GitLab!288) + + Pyflakes has been updated to >= 2.1.0, < 2.2.0 + (See also GitLab!283, GitLab!285) + + pycodestyle has been updated to >= 2.5.0, < 2.6.0 + (See also GitLab!287) + * Features + + Add support for per-file-ignores (See also GitLab!259, GitLab#156, + GitLab!281, GitLab#471) + + Enable use of float and complex option types (See also GitLab!261, + GitLab#452) + + Improve startup performance by switching from pkg_resources to + entrypoints (See also GitLab!264) + + Add metadata for use through the pre-commit git hooks framework + (See also GitLab!268, GitLab!284) + + Allow physical line checks to return more than one result + (See also GitLab!269) + + Allow # noqa:X123 comments without space between the colon and codes list + (See also GitLab!273, GitLab#470) + + Remove broken and unused flake8.listen plugin type + (See also GitLab!274, GitLab#480) + +- Remove pyflakes21.patch which is already included upstream +- Rebase remove_mock_dependency.patch + ------------------------------------------------------------------- Tue Jan 29 09:19:47 UTC 2019 - Tomáš Chvátal diff --git a/python-flake8.spec b/python-flake8.spec index 3ac1248..857abe2 100644 --- a/python-flake8.spec +++ b/python-flake8.spec @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without python2 Name: python-flake8 -Version: 3.6.0 +Version: 3.7.5 Release: 0 Summary: Modular source code checker: pep8, pyflakes and co License: MIT @@ -27,31 +27,39 @@ Group: Development/Languages/Python URL: https://gitlab.com/pycqa/flake8 Source: https://files.pythonhosted.org/packages/source/f/flake8/flake8-%{version}.tar.gz Patch0: remove_mock_dependency.patch -Patch1: pyflakes21.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-entrypoints >= 0.3 Requires: python-mccabe >= 0.6.0 -Requires: python-pycodestyle >= 2.4.0 -Requires: python-pyflakes >= 2.0.0 +Requires: python-pycodestyle >= 2.5.0 +Requires: python-pyflakes >= 2.1.0 Requires(post): update-alternatives Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module mccabe >= 0.2.1} -BuildRequires: %{python_module pycodestyle >= 2.4.0} -BuildRequires: %{python_module pyflakes >= 2.0.0} +BuildRequires: %{python_module entrypoints >= 0.3} +BuildRequires: %{python_module mccabe >= 0.6.0} +BuildRequires: %{python_module pycodestyle >= 2.5.0} +BuildRequires: %{python_module pyflakes >= 2.1.0} BuildRequires: %{python_module pytest-runner} BuildRequires: %{python_module pytest} %if %{with python2} BuildRequires: python2-configparser BuildRequires: python2-enum34 +BuildRequires: python2-functools32 BuildRequires: python2-mock +BuildRequires: python2-typing +%endif +%if 0%{?suse_version} < 1500 +BuildRequires: python3-typing %endif # /SECTION %ifpython2 Requires: python-configparser Requires: python-enum34 +Requires: python-functools32 +Requires: python-typing %endif %python_subpackages diff --git a/remove_mock_dependency.patch b/remove_mock_dependency.patch index d794fd2..e9c399a 100644 --- a/remove_mock_dependency.patch +++ b/remove_mock_dependency.patch @@ -23,7 +23,7 @@ + import mock import pytest - from flake8 import exceptions + from flake8.main import application as app --- a/tests/unit/test_base_formatter.py +++ b/tests/unit/test_base_formatter.py @@ -1,7 +1,10 @@ @@ -68,16 +68,17 @@ from flake8.options import config --- a/tests/unit/test_debug.py +++ b/tests/unit/test_debug.py -@@ -1,5 +1,8 @@ +@@ -1,6 +1,9 @@ """Tests for our debugging module.""" + import entrypoints -import mock +try: + import unittest.mock as mock +except ImportError: + import mock import pytest - import setuptools + from flake8.main import debug --- a/tests/unit/test_file_checker.py +++ b/tests/unit/test_file_checker.py @@ -1,5 +1,8 @@ @@ -87,14 +88,14 @@ + import unittest.mock as mock +except ImportError: + import mock + import pytest - from flake8 import checker - + import flake8 --- a/tests/unit/test_file_processor.py +++ b/tests/unit/test_file_processor.py @@ -5,7 +5,10 @@ import tokenize - - from flake8 import processor + import ast + import tokenize -import mock +try: @@ -103,7 +104,7 @@ + import mock import pytest - + from flake8 import processor --- a/tests/unit/test_get_local_plugins.py +++ b/tests/unit/test_get_local_plugins.py @@ -1,5 +1,8 @@ @@ -233,7 +234,7 @@ + import mock import pytest - from flake8 import style_guide + from flake8 import statistics --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -1,7 +1,10 @@ @@ -247,7 +248,7 @@ + import mock import pytest - from flake8 import utils + from flake8 import exceptions --- a/tests/unit/test_violation.py +++ b/tests/unit/test_violation.py @@ -1,5 +1,8 @@ @@ -262,17 +263,22 @@ from flake8 import style_guide --- a/setup.py +++ b/setup.py -@@ -11,8 +11,12 @@ sys.path.insert(0, os.path.join(os.path. +@@ -11,6 +11,12 @@ import flake8 +PY2 = sys.version_info[0] == 2 - --tests_require = ['mock >= 2.0.0', 'pytest'] +tests_require = ['pytest'] + +if PY2: + tests_require.append('mock >= 2.0.0') ++ # NOTE(sigmavirus24): When updating these requirements, update them in # setup.cfg as well. +@@ -147,4 +153,5 @@ + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Quality Assurance", + ], ++ tests_require=tests_require, + )