diff --git a/python-pytest-flake8.changes b/python-pytest-flake8.changes index b5c4f99..1d0de72 100644 --- a/python-pytest-flake8.changes +++ b/python-pytest-flake8.changes @@ -1,4 +1,6 @@ ------------------------------------------------------------------- -Mon Dec 15 23:28:43 UTC 2025 - Steve Kowalik +Tue Dec 16 01:44:24 UTC 2025 - Steve Kowalik - Initial release of 1.3.0. +- Add patch support-pytest-9.patch: + * Support pytest 9 changes. diff --git a/python-pytest-flake8.spec b/python-pytest-flake8.spec index 36ae758..406d07a 100644 --- a/python-pytest-flake8.spec +++ b/python-pytest-flake8.spec @@ -19,10 +19,11 @@ Name: python-pytest-flake8 Version: 1.3.0 Release: 0 -Summary: pytest plugin to check FLAKE8 requirements +Summary: Pytest plugin to check flake8 requirements License: MIT URL: https://github.com/coherent-oss/pytest-flake8 Source: https://files.pythonhosted.org/packages/source/p/pytest-flake8/pytest_flake8-1.3.0.tar.gz +Patch0: support-pytest-9.patch BuildRequires: python-rpm-macros BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 61.2} diff --git a/support-pytest-9.patch b/support-pytest-9.patch new file mode 100644 index 0000000..d43e98f --- /dev/null +++ b/support-pytest-9.patch @@ -0,0 +1,42 @@ +Sourced from https://github.com/OpenIndiana/oi-userland/pull/19860/commits/0d06abedf17256d1f2c89086acc05cfa53dbc647 + +https://github.com/coherent-oss/pytest-flake8/issues/5 + +--- pytest_flake8-1.3.0/pytest_flake8.py.orig ++++ pytest_flake8-1.3.0/pytest_flake8.py +@@ -4,6 +4,7 @@ + import re + from contextlib import redirect_stdout, redirect_stderr + from io import BytesIO, TextIOWrapper ++from fnmatch import fnmatch + + from flake8.main import application + +@@ -59,11 +60,11 @@ + config._flake8mtimes = config.cache.get(HISTKEY, {}) + + +-def pytest_collect_file(file_path, path, parent): ++def pytest_collect_file(file_path, parent): + """Filter files down to which ones should be checked.""" + config = parent.config + if config.option.flake8 and file_path.suffix in config._flake8exts: +- flake8ignore = config._flake8ignore(path) ++ flake8ignore = config._flake8ignore(file_path) + if flake8ignore is not None: + item = Flake8File.from_parent( + parent, +@@ -203,7 +204,12 @@ + def __call__(self, path): + l = [] # noqa: E741 + for glob, ignlist in self.ignores: +- if not glob or path.fnmatch(glob): ++ mpath = path ++ if glob and '/' in glob: ++ glob = "*" + glob ++ else: ++ mpath = str(path).split("/")[-1] ++ if not glob or fnmatch(mpath, glob): + if ignlist is None: + return None + l.extend(ignlist)