From 924f0b5d4559c68c8c7701c9732442d27d18e2c127faf4eb48419337fedd3563 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Thu, 8 Sep 2022 04:39:26 +0000 Subject: [PATCH] - Update to 1.1.1: * Update classifiers to indicate older versions are no longer supported * No longer use deprecated pytest constructs * Bump requirements to more accurately indicate what is currently needed * Drop Python 2 support and dependency on py; from @erikkemperman * Drop support for Python 3.5, 3.6 * Add a `flake8-max-doc-length` option; from @rodrigomologni - Add patch support-flake8-5.patch: * Support flake8 >= 5.0, adjust {Build,}Requires. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-flake8?expand=0&rev=12 --- pytest-flake8-1.0.7.tar.gz | 3 --- pytest-flake8-1.1.1.tar.gz | 3 +++ python-pytest-flake8.changes | 13 ++++++++++ python-pytest-flake8.spec | 13 +++++----- support-flake8-5.patch | 50 ++++++++++++++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 9 deletions(-) delete mode 100644 pytest-flake8-1.0.7.tar.gz create mode 100644 pytest-flake8-1.1.1.tar.gz create mode 100644 support-flake8-5.patch diff --git a/pytest-flake8-1.0.7.tar.gz b/pytest-flake8-1.0.7.tar.gz deleted file mode 100644 index 9d99632..0000000 --- a/pytest-flake8-1.0.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f0259761a903563f33d6f099914afef339c085085e643bee8343eb323b32dd6b -size 9560 diff --git a/pytest-flake8-1.1.1.tar.gz b/pytest-flake8-1.1.1.tar.gz new file mode 100644 index 0000000..1fba553 --- /dev/null +++ b/pytest-flake8-1.1.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba4f243de3cb4c2486ed9e70752c80dd4b636f7ccb27d4eba763c35ed0cd316e +size 9144 diff --git a/python-pytest-flake8.changes b/python-pytest-flake8.changes index a7e6885..eeae665 100644 --- a/python-pytest-flake8.changes +++ b/python-pytest-flake8.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Thu Sep 8 04:38:54 UTC 2022 - Steve Kowalik + +- Update to 1.1.1: + * Update classifiers to indicate older versions are no longer supported + * No longer use deprecated pytest constructs + * Bump requirements to more accurately indicate what is currently needed + * Drop Python 2 support and dependency on py; from @erikkemperman + * Drop support for Python 3.5, 3.6 + * Add a `flake8-max-doc-length` option; from @rodrigomologni +- Add patch support-flake8-5.patch: + * Support flake8 >= 5.0, adjust {Build,}Requires. + ------------------------------------------------------------------- Mon Aug 16 14:37:49 UTC 2021 - Martin Liška diff --git a/python-pytest-flake8.spec b/python-pytest-flake8.spec index 53b4ebc..ba456ce 100644 --- a/python-pytest-flake8.spec +++ b/python-pytest-flake8.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-flake8 # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,19 +18,20 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pytest-flake8 -Version: 1.0.7 +Version: 1.1.1 Release: 0 Summary: Plugin for pytest to check FLAKE8 requirements License: BSD-2-Clause -Group: Development/Languages/Python URL: https://github.com/tholo/pytest-flake8 Source: https://files.pythonhosted.org/packages/source/p/pytest-flake8/pytest-flake8-%{version}.tar.gz -BuildRequires: %{python_module flake8 >= 3.5} +# PATCH-FIX-UPSTREAM Support flake8 >= 5.0 gh#tholo/pytest-flake8#88 +Patch0: support-flake8-5.patch +BuildRequires: %{python_module flake8 >= 5.0} BuildRequires: %{python_module pytest >= 3.5} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-flake8 >= 3.5 +Requires: python-flake8 >= 5.0 Requires: python-pytest >= 3.5 BuildArch: noarch %python_subpackages @@ -39,7 +40,7 @@ BuildArch: noarch Plugin for py.test for efficiently checking PEP8 compliance. %prep -%setup -q -n pytest-flake8-%{version} +%autosetup -p1 -n pytest-flake8-%{version} %build %python_build diff --git a/support-flake8-5.patch b/support-flake8-5.patch new file mode 100644 index 0000000..7b48c88 --- /dev/null +++ b/support-flake8-5.patch @@ -0,0 +1,50 @@ +From 976e6180201f7808a3007c8c5903a1637b18c0c8 Mon Sep 17 00:00:00 2001 +From: Dominic Oram +Date: Fri, 5 Aug 2022 17:55:24 +0100 +Subject: [PATCH] Update to work for flake8==5.0.0 + +--- + pytest_flake8.py | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +diff --git a/pytest_flake8.py b/pytest_flake8.py +index 2555f8a..c693789 100644 +--- a/pytest_flake8.py ++++ b/pytest_flake8.py +@@ -212,23 +212,28 @@ def check_file(path, flake8ignore, maxlength, maxdoclenght, maxcomplexity, + args += ['--show-source'] + if statistics: + args += ['--statistics'] ++ args += [str(path)] + app = application.Application() + prelim_opts, remaining_args = app.parse_preliminary_options(args) +- config_finder = config.ConfigFileFinder( +- app.program, +- prelim_opts.append_config, +- config_file=prelim_opts.config, +- ignore_config_files=prelim_opts.isolated, ++ cfg, cfg_dir = config.load_config( ++ config=prelim_opts.config, ++ extra=prelim_opts.append_config, ++ isolated=prelim_opts.isolated, ++ ) ++ app.find_plugins( ++ cfg, ++ cfg_dir, ++ enable_extensions=prelim_opts.enable_extensions, ++ require_plugins=prelim_opts.require_plugins, + ) +- app.find_plugins(config_finder) + app.register_plugin_options() +- app.parse_configuration_and_cli(config_finder, remaining_args) ++ app.parse_configuration_and_cli(cfg, cfg_dir, remaining_args) + if flake8ignore: + app.options.ignore = flake8ignore + app.make_formatter() # fix this + app.make_guide() + app.make_file_checker_manager() +- app.run_checks([str(path)]) ++ app.run_checks() + app.formatter.start() + app.report_errors() + app.formatter.stop()