From 6722bafeee51e7aa9f57418644ffc6b7a630b8db Mon Sep 17 00:00:00 2001 From: Michal Domonkos Date: Wed, 12 Jan 2022 17:15:23 +0100 Subject: [PATCH] Disable flake8 self-test RHEL-9 doesn't ship flake8. Note that it was already disabled for %check anyway, but we also have an internal beaker test that runs test.sh where we would have to disable it too, at which point it's just easier to do that in test.sh itself. While at it, remove all traces of flake8 from the spec file as well, to avoid confusion in the future. Related: #1929210 --- rpmlint-1.11-disable-flake8-self-test.patch | 23 +++++++++++++++++++++ rpmlint.spec | 14 ++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 rpmlint-1.11-disable-flake8-self-test.patch diff --git a/rpmlint-1.11-disable-flake8-self-test.patch b/rpmlint-1.11-disable-flake8-self-test.patch new file mode 100644 index 0000000..be5834b --- /dev/null +++ b/rpmlint-1.11-disable-flake8-self-test.patch @@ -0,0 +1,23 @@ +diff -up rpmlint-rpmlint-1.11/test.sh.orig rpmlint-rpmlint-1.11/test.sh +--- rpmlint-rpmlint-1.11/test.sh.orig 2022-01-12 17:23:52.565790275 +0100 ++++ rpmlint-rpmlint-1.11/test.sh 2022-01-12 17:24:02.043920708 +0100 +@@ -2,7 +2,7 @@ + + export PYTHONPATH=$(pwd)/tools:$(pwd) + export TESTPATH="$(pwd)/test/" +-: ${PYTHON:=python} ${PYTEST:=py.test} ${FLAKE8:=flake8} ++: ${PYTHON:=python} ${PYTEST:=py.test} + : ${PYTHONWARNINGS:=all} + export PYTHONWARNINGS + +@@ -40,10 +40,6 @@ $PYTEST -v || exit $? + + unset PYTHONWARNINGS + +-echo "$FLAKE8 tests" +-$FLAKE8 --version +-$FLAKE8 . ./rpmdiff ./rpmlint || exit $? +- + echo "man page tests" + if man --help 2>&1 | grep -q -- --warnings; then + tmpfile=$(mktemp) || exit 1 diff --git a/rpmlint.spec b/rpmlint.spec index 2ec38ca..a972e16 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -15,12 +15,9 @@ %global pytest py.test %endif -# linitng is flaky, so we fake it -%global flake8 true - Name: rpmlint Version: 1.11 -Release: 18%{?dist} +Release: 19%{?dist} Summary: Tool for checking common errors in RPM packages License: GPLv2 URL: https://github.com/rpm-software-management/rpmlint @@ -42,6 +39,7 @@ Patch214: rpmlint-1.11-no-python-macro.patch # Downstream-only patches Patch215: rpmlint-1.11-spellcheck-handle-missing-language-error.patch +Patch216: rpmlint-1.11-disable-flake8-self-test.patch BuildArch: noarch BuildRequires: make @@ -49,14 +47,12 @@ BuildRequires: make BuildRequires: python3-devel BuildRequires: python3-rpm >= 4.4.2.2 BuildRequires: python3-pytest -#BuildRequires: python3-flake8-import-order Requires: python3 Requires: python3-rpm >= 4.4.2.2 %else BuildRequires: python >= 2.6 BuildRequires: rpm-python >= 4.4.2.2 BuildRequires: pytest -#BuildRequires: python2-flake8-import-order Requires: python >= 2.6 Requires: rpm-python >= 4.4.2.2 %endif @@ -107,6 +103,7 @@ and source packages as well as spec files can be checked. %patch213 -p1 %patch214 -p1 %patch215 -p1 +%patch216 -p1 sed -i 's|1.10|%{version}|g' Makefile @@ -143,7 +140,7 @@ sed -i 's/test_pyc_m/xxx_pyc_m/' test/test_files.py sed -i 's/test_inconsistent_file_extension/xxx_inconsistent_file_extension/' test/test_sources.py %endif -make check PYTHON=%{python} PYTEST=%{pytest} FLAKE8=%{flake8} +make check PYTHON=%{python} PYTEST=%{pytest} %files @@ -158,6 +155,9 @@ make check PYTHON=%{python} PYTEST=%{pytest} FLAKE8=%{flake8} %{_mandir}/man1/rpmlint.1* %changelog +* Wed Jan 12 2022 Michal Domonkos - 1.11-19 +- Disable flake8 self-test (#1929210) + * Mon Jan 10 2022 Michal Domonkos - 1.11-18 - Enable bash-completion (#1999654) - Handle missing language error during spellcheck (#1929210)