From 530adc25bd2f80556e91ba1d98044cb1921fc157a6c2bbe68a5367f882bfdac2 Mon Sep 17 00:00:00 2001 From: Kristyna Streitova Date: Thu, 26 Oct 2023 13:37:30 +0000 Subject: [PATCH] Accepting request 1120592 from home:kstreitova:branches:openSUSE:Tools - Clean up the SPEC file - Update to 1.2.2 bsc#1099674: * Expand python sitelib glob usage in files * Add new head category for PSP macros * Make flake8 happy and fix C416 * avoid adding curly braces to apparmor_reload * Bump CodeQL Actions version * Do not put curly brackets around python_libalternatives_reset_alternative * Try to fix coveralls in github actions * Update to actions/checkout@v3 and setup-python@v4 * Try to increase timeout for urlopen * Make flake8 and mypy happy * Set headers for urlopen to avoid 403 code * ubuntu-latest doesn't support 3.6 anymore * Replace calls to w3m with calls to curl * move logic that tries to change the URL field to https into _make_secure_url * Fix pep8 errors to pass flake8 tests (#296) * Extend support for patterns (boo#1195092) * update coveralls config * Ignore error N818 from pep8-naming for now * Fix URL expectations on tests * Do not put brackets on %obsolete_legacy_pattern * Fix #287: Incorrect curlification for more systemd-macros * Add new script for rpmlint. * Use github token directly - Remove spec-cleaner-psp-macros.patch that is already included in 1.2.2 release - Install new *.toml files with licenses OBS-URL: https://build.opensuse.org/request/show/1120592 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/spec-cleaner?expand=0&rev=162 --- fix_tests_needing_web_connection.patch | 51 ++++++ spec-cleaner-1.2.1.tar.gz | 3 - spec-cleaner-1.2.2.tar.gz | 3 + spec-cleaner-psp-macros.patch | 226 ------------------------- spec-cleaner.changes | 36 ++++ spec-cleaner.spec | 57 ++----- 6 files changed, 102 insertions(+), 274 deletions(-) create mode 100644 fix_tests_needing_web_connection.patch delete mode 100644 spec-cleaner-1.2.1.tar.gz create mode 100644 spec-cleaner-1.2.2.tar.gz delete mode 100644 spec-cleaner-psp-macros.patch diff --git a/fix_tests_needing_web_connection.patch b/fix_tests_needing_web_connection.patch new file mode 100644 index 0000000..f29e98f --- /dev/null +++ b/fix_tests_needing_web_connection.patch @@ -0,0 +1,51 @@ +--- + tests/in/mingw32-clutter.spec | 2 +- + tests/in/replace_pwdutils.spec | 2 +- + tests/out-minimal/mingw32-clutter.spec | 2 +- + tests/out-minimal/replace_pwdutils.spec | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +--- a/tests/in/mingw32-clutter.spec ++++ b/tests/in/mingw32-clutter.spec +@@ -22,7 +22,7 @@ Release: 0 + Summary: The clutter library + License: LGPL-2.1+ + Group: Development/Libraries +-Url: http://clutter-project.org/ ++Url: https://clutter-project.org/ + Source: http://www.clutter-project.org/sources/clutter/1.5/clutter-%{version}.tar.bz2 + Patch0: clutter-1.6.14-windows.patch + Patch1: clutter-1.6.20-ldl.patch +--- a/tests/in/replace_pwdutils.spec ++++ b/tests/in/replace_pwdutils.spec +@@ -4,7 +4,7 @@ Release: 0 + Summary: A Job Manager + License: GPL-2.0-or-later + Group: System/Daemons +-URL: http://ftp.debian.org/debian/pool/main/a/at ++URL: https://ftp.debian.org/debian/pool/main/a/at + Source: http://ftp.debian.org/debian/pool/main/a/at/%{name}_%{version}.orig.tar.gz + BuildRequires: autoconf >= 2.69 + BuildRequires: automake +--- a/tests/out-minimal/mingw32-clutter.spec ++++ b/tests/out-minimal/mingw32-clutter.spec +@@ -23,7 +23,7 @@ Release: 0 + Summary: The clutter library + License: LGPL-2.1-or-later + Group: Development/Libraries +-URL: http://clutter-project.org/ ++URL: https://clutter-project.org/ + Source: http://www.clutter-project.org/sources/clutter/1.5/clutter-%{version}.tar.bz2 + Patch0: clutter-1.6.14-windows.patch + Patch1: clutter-1.6.20-ldl.patch +--- a/tests/out-minimal/replace_pwdutils.spec ++++ b/tests/out-minimal/replace_pwdutils.spec +@@ -4,7 +4,7 @@ Release: 0 + Summary: A Job Manager + License: GPL-2.0-or-later + Group: System/Daemons +-URL: http://ftp.debian.org/debian/pool/main/a/at ++URL: https://ftp.debian.org/debian/pool/main/a/at + Source: http://ftp.debian.org/debian/pool/main/a/at/%{name}_%{version}.orig.tar.gz + BuildRequires: autoconf >= 2.69 + BuildRequires: automake diff --git a/spec-cleaner-1.2.1.tar.gz b/spec-cleaner-1.2.1.tar.gz deleted file mode 100644 index 379b5eb..0000000 --- a/spec-cleaner-1.2.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:613883863a11e2a788192b14f53dfffe7d676486bc27bdf788cdc6075cabc726 -size 506546 diff --git a/spec-cleaner-1.2.2.tar.gz b/spec-cleaner-1.2.2.tar.gz new file mode 100644 index 0000000..3d9b68a --- /dev/null +++ b/spec-cleaner-1.2.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d70be37326a29b8e4f391c6e9060e1f8f051942dd986ae3889f8fd2f3d8d0cd +size 522881 diff --git a/spec-cleaner-psp-macros.patch b/spec-cleaner-psp-macros.patch deleted file mode 100644 index fc5133e..0000000 --- a/spec-cleaner-psp-macros.patch +++ /dev/null @@ -1,226 +0,0 @@ -From 914c432eb26bae6af766f2da6e81587251ebf1c0 Mon Sep 17 00:00:00 2001 -From: Daniel Garcia Moreno -Date: Tue, 19 Sep 2023 08:03:51 +0200 -Subject: [PATCH] Add new head category for PSP macros - -This patch adds a new category "head", similar to the "tail" category, -to match the modern python macros for SUSE SLE -(sle15_python_module_pythons and sle15allpythons), these macros changed -the "pythons" definition, so they should go before any usage of the -python-rpm-macros. - -Fix https://github.com/rpm-software-management/spec-cleaner/issues/308 ---- - spec_cleaner/rpmpreamble.py | 4 ++++ - spec_cleaner/rpmpreambleelements.py | 3 +++ - spec_cleaner/rpmregexp.py | 1 + - tests/in/psp-macro-all.spec | 31 +++++++++++++++++++++++++++++ - tests/in/psp-macro.spec | 30 ++++++++++++++++++++++++++++ - tests/out/psp-macro-all.spec | 30 ++++++++++++++++++++++++++++ - tests/out/psp-macro.spec | 30 ++++++++++++++++++++++++++++ - 7 files changed, 129 insertions(+) - create mode 100644 tests/in/psp-macro-all.spec - create mode 100644 tests/in/psp-macro.spec - create mode 100644 tests/out/psp-macro-all.spec - create mode 100644 tests/out/psp-macro.spec - -diff --git a/spec_cleaner/rpmpreamble.py b/spec_cleaner/rpmpreamble.py -index 0273b0c..363a9e8 100644 ---- a/spec_cleaner/rpmpreamble.py -+++ b/spec_cleaner/rpmpreamble.py -@@ -115,6 +115,7 @@ def __init__(self, options): - 'excludearch': self.reg.re_excludearch, - 'exclusivearch': self.reg.re_exclusivearch, - 'tail': self.reg.re_tail_macros, -+ 'head': self.reg.re_head_macros, - } - - # deprecated definitions that we no longer want to see -@@ -693,6 +694,9 @@ def add(self, line): - else: - self._add_line_value_to('exclusivearch', value) - -+ elif self.reg.re_head_macros.match(line): -+ self._add_line_value_to('head', line) -+ - # loop for all other matching categories which - # do not require special attention - else: -diff --git a/spec_cleaner/rpmpreambleelements.py b/spec_cleaner/rpmpreambleelements.py -index 8270ec8..9024264 100644 ---- a/spec_cleaner/rpmpreambleelements.py -+++ b/spec_cleaner/rpmpreambleelements.py -@@ -54,6 +54,7 @@ class RpmPreambleElements(object): - 'define', - 'bconds', - 'bcond_conditions', -+ 'head', - 'name', - 'version', - 'release', -@@ -308,6 +309,8 @@ def compile_category_prefix(self, category, key=None): - - if category == 'tail': - return '' -+ if category == 'head': -+ return '' - elif key: - pass - elif category in self.category_to_key: -diff --git a/spec_cleaner/rpmregexp.py b/spec_cleaner/rpmregexp.py -index 832ac2a..5649651 100644 ---- a/spec_cleaner/rpmregexp.py -+++ b/spec_cleaner/rpmregexp.py -@@ -90,6 +90,7 @@ class Regexp(object): - re_patternmacro = re.compile(r'pattern(-\S+)?\(\)', re.IGNORECASE) - re_patternobsolete = re.compile(r'patterns-openSUSE-\S+', re.IGNORECASE) - re_tail_macros = re.compile(r'^%{?python_subpackages}?') -+ re_head_macros = re.compile(r'^%{?\??(sle15_python_module_pythons|sle15allpythons)}?') - re_preamble_prefix = re.compile(r'^Prefix:\s*(.*)', re.IGNORECASE) - # grab all macros with rpm call that query for version, this still might - # be bit too greedy but it is good enough now -diff --git a/tests/in/psp-macro-all.spec b/tests/in/psp-macro-all.spec -new file mode 100644 -index 0000000..4f03c68 ---- /dev/null -+++ b/tests/in/psp-macro-all.spec -@@ -0,0 +1,31 @@ -+# -+# spec file -+# -+# Copyright (c) 2023 SUSE LLC -+# -+# All modifications and additions to the file contributed by third parties -+# remain the property of their copyright owners, unless otherwise agreed -+# upon. The license for this file, and modifications and additions to the -+# file, is the same license as for the pristine package itself (unless the -+# license for the pristine package is not an Open Source License, in which -+# case the license is the MIT License). An "Open Source License" is a -+# license that conforms to the Open Source Definition (Version 1.9) -+# published by the Open Source Initiative. -+ -+# Please submit bugfixes or comments via https://bugs.opensuse.org/ -+# -+ -+ -+%{?sle15allpythons} -+Name: python-munch -+Version: 3.0.0 -+Release: 0 -+BuildRequires: python-rpm-macros -+Requires: python-six -+BuildArch: noarch -+# SECTION test requirements -+BuildRequires: %{python_module pytest} -+BuildRequires: %{python_module six} -+ -+%changelog -+ -diff --git a/tests/in/psp-macro.spec b/tests/in/psp-macro.spec -new file mode 100644 -index 0000000..7056059 ---- /dev/null -+++ b/tests/in/psp-macro.spec -@@ -0,0 +1,30 @@ -+# -+# spec file -+# -+# Copyright (c) 2023 SUSE LLC -+# -+# All modifications and additions to the file contributed by third parties -+# remain the property of their copyright owners, unless otherwise agreed -+# upon. The license for this file, and modifications and additions to the -+# file, is the same license as for the pristine package itself (unless the -+# license for the pristine package is not an Open Source License, in which -+# case the license is the MIT License). An "Open Source License" is a -+# license that conforms to the Open Source Definition (Version 1.9) -+# published by the Open Source Initiative. -+ -+# Please submit bugfixes or comments via https://bugs.opensuse.org/ -+# -+ -+ -+%{?sle15_python_module_pythons} -+Name: python-munch -+Version: 3.0.0 -+Release: 0 -+BuildRequires: python-rpm-macros -+Requires: python-six -+BuildArch: noarch -+# SECTION test requirements -+BuildRequires: %{python_module pytest} -+BuildRequires: %{python_module six} -+ -+%changelog -diff --git a/tests/out/psp-macro-all.spec b/tests/out/psp-macro-all.spec -new file mode 100644 -index 0000000..97dd863 ---- /dev/null -+++ b/tests/out/psp-macro-all.spec -@@ -0,0 +1,30 @@ -+# -+# spec file -+# -+# Copyright (c) 2023 SUSE LLC -+# -+# All modifications and additions to the file contributed by third parties -+# remain the property of their copyright owners, unless otherwise agreed -+# upon. The license for this file, and modifications and additions to the -+# file, is the same license as for the pristine package itself (unless the -+# license for the pristine package is not an Open Source License, in which -+# case the license is the MIT License). An "Open Source License" is a -+# license that conforms to the Open Source Definition (Version 1.9) -+# published by the Open Source Initiative. -+ -+# Please submit bugfixes or comments via https://bugs.opensuse.org/ -+# -+ -+ -+%{?sle15allpythons} -+Name: python-munch -+Version: 3.0.0 -+Release: 0 -+BuildRequires: python-rpm-macros -+Requires: python-six -+BuildArch: noarch -+# SECTION test requirements -+BuildRequires: %{python_module pytest} -+BuildRequires: %{python_module six} -+ -+%changelog -diff --git a/tests/out/psp-macro.spec b/tests/out/psp-macro.spec -new file mode 100644 -index 0000000..7056059 ---- /dev/null -+++ b/tests/out/psp-macro.spec -@@ -0,0 +1,30 @@ -+# -+# spec file -+# -+# Copyright (c) 2023 SUSE LLC -+# -+# All modifications and additions to the file contributed by third parties -+# remain the property of their copyright owners, unless otherwise agreed -+# upon. The license for this file, and modifications and additions to the -+# file, is the same license as for the pristine package itself (unless the -+# license for the pristine package is not an Open Source License, in which -+# case the license is the MIT License). An "Open Source License" is a -+# license that conforms to the Open Source Definition (Version 1.9) -+# published by the Open Source Initiative. -+ -+# Please submit bugfixes or comments via https://bugs.opensuse.org/ -+# -+ -+ -+%{?sle15_python_module_pythons} -+Name: python-munch -+Version: 3.0.0 -+Release: 0 -+BuildRequires: python-rpm-macros -+Requires: python-six -+BuildArch: noarch -+# SECTION test requirements -+BuildRequires: %{python_module pytest} -+BuildRequires: %{python_module six} -+ -+%changelog diff --git a/spec-cleaner.changes b/spec-cleaner.changes index 81aa807..fdaca6b 100644 --- a/spec-cleaner.changes +++ b/spec-cleaner.changes @@ -1,3 +1,39 @@ +------------------------------------------------------------------- +Thu Oct 26 11:54:41 UTC 2023 - Matej Cepl + +- Clean up the SPEC file + +------------------------------------------------------------------- +Wed Oct 25 15:49:31 UTC 2023 - Kristyna Streitova + +- Update to 1.2.2 bsc#1099674: + * Expand python sitelib glob usage in files + * Add new head category for PSP macros + * Make flake8 happy and fix C416 + * avoid adding curly braces to apparmor_reload + * Bump CodeQL Actions version + * Do not put curly brackets around python_libalternatives_reset_alternative + * Try to fix coveralls in github actions + * Update to actions/checkout@v3 and setup-python@v4 + * Try to increase timeout for urlopen + * Make flake8 and mypy happy + * Set headers for urlopen to avoid 403 code + * ubuntu-latest doesn't support 3.6 anymore + * Replace calls to w3m with calls to curl + * move logic that tries to change the URL field to https into _make_secure_url + * Fix pep8 errors to pass flake8 tests (#296) + * Extend support for patterns (boo#1195092) + * update coveralls config + * Ignore error N818 from pep8-naming for now + * Fix URL expectations on tests + * Do not put brackets on %obsolete_legacy_pattern + * Fix #287: Incorrect curlification for more systemd-macros + * Add new script for rpmlint. + * Use github token directly +- Remove spec-cleaner-psp-macros.patch that is already included in + 1.2.2 release +- Install new *.toml files with licenses + ------------------------------------------------------------------- Tue Oct 24 13:45:01 UTC 2023 - Dirk Müller diff --git a/spec-cleaner.spec b/spec-cleaner.spec index 824a848..2b38f84 100644 --- a/spec-cleaner.spec +++ b/spec-cleaner.spec @@ -18,19 +18,20 @@ Name: spec-cleaner -Version: 1.2.1 +Version: 1.2.2 Release: 0 Summary: .spec file cleaner License: BSD-3-Clause URL: https://github.com/rpm-software-management/spec-cleaner Source0: https://github.com/rpm-software-management/spec-cleaner/archive/%{name}-%{version}.tar.gz -# PATCH-FIX-UPSTREAM: https://github.com/rpm-software-management/spec-cleaner/commit/914c432eb26bae6af766f2da6e81587251ebf1c0 -Patch1: spec-cleaner-psp-macros.patch +# PATCH-FIX-UPSTREAM: https://github.com/rpm-software-management/spec-cleaner/commit/fd0f64930a399dfcf4ff5d3e22a8ec9afa37043a +Patch0: fix_tests_needing_web_connection.patch +BuildRequires: fdupes BuildRequires: python-rpm-macros +BuildRequires: python3-pip BuildRequires: python3-pytest -BuildRequires: python3-setuptools +BuildRequires: python3-wheel # For the pkg_resources used in the binary loader -Requires: python3-setuptools BuildArch: noarch %description @@ -55,7 +56,7 @@ rm pytest.ini %if 0%{?mageia} %py3_build %else -%python3_build +%python3_pyproject_wheel %endif %check @@ -66,8 +67,9 @@ python3 -m pytest -k "not webtest" tests/*-tests.py %if 0%{?mageia} %py3_install %else -%python3_install +%python3_pyproject_install %endif +%fdupes %{buildroot}%{python3_sitelib} %files %license COPYING @@ -76,44 +78,9 @@ python3 -m pytest -k "not webtest" tests/*-tests.py %dir %{_prefix}/lib/obs/service/ %{_prefix}/lib/obs/service/clean_spec_file %{_prefix}/lib/obs/service/clean_spec_file.service -%dir %{python3_sitelib}/spec_cleaner/ -%{python3_sitelib}/spec_cleaner/__init__.py -%{python3_sitelib}/spec_cleaner/__main__.py -%{python3_sitelib}/spec_cleaner/dependency_parser.py -%{python3_sitelib}/spec_cleaner/fileutils.py -%{python3_sitelib}/spec_cleaner/rpmbuild.py -%{python3_sitelib}/spec_cleaner/rpmcheck.py -%{python3_sitelib}/spec_cleaner/rpmcleaner.py -%{python3_sitelib}/spec_cleaner/rpmcopyright.py -%{python3_sitelib}/spec_cleaner/rpmdescription.py -%{python3_sitelib}/spec_cleaner/rpmexception.py -%{python3_sitelib}/spec_cleaner/rpmfiles.py -%{python3_sitelib}/spec_cleaner/rpmhelpers.py -%{python3_sitelib}/spec_cleaner/rpminstall.py -%{python3_sitelib}/spec_cleaner/rpmpreamble.py -%{python3_sitelib}/spec_cleaner/rpmpreambleelements.py -%{python3_sitelib}/spec_cleaner/rpmprep.py -%{python3_sitelib}/spec_cleaner/rpmprune.py -%{python3_sitelib}/spec_cleaner/rpmregexp.py -%{python3_sitelib}/spec_cleaner/rpmrequirestoken.py -%{python3_sitelib}/spec_cleaner/rpmpackage.py -%{python3_sitelib}/spec_cleaner/rpmscriplets.py -%{python3_sitelib}/spec_cleaner/rpmsection.py -%{python3_sitelib}/spec_cleaner/__pycache__ -%if 0%{?mageia} -%{python3_sitelib}/*.egg-info -%else -%{python3_sitelib}/spec_cleaner-%{version}-py%{py3_ver}.egg-info -%endif -%dir %{_datadir}/%{name}/ -%{_datadir}/%{name}/excludes-bracketing.txt -%{_datadir}/%{name}/licenses_changes.txt -%{_datadir}/%{name}/pkgconfig_conversions.txt -%{_datadir}/%{name}/allowed_groups.txt -%{_datadir}/%{name}/licenses_exceptions.txt -%{_datadir}/%{name}/cmake_conversions.txt -%{_datadir}/%{name}/perl_conversions.txt -%{_datadir}/%{name}/tex_conversions.txt +%{python3_sitelib}/spec_cleaner +%{python3_sitelib}/spec_cleaner-%{version}*-info +%{_datadir}/%{name} %files format_spec_file %{_prefix}/lib/obs/service/format_spec_file