From 61ee510320171a095bcc77939684630c052c89f5387763ff449fe692d48148b0 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 2 Oct 2024 11:18:00 +0000 Subject: [PATCH] - Add tests-tests_require.patch fixing broken tests (gh#toabctl/metaextract#20). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-metaextract?expand=0&rev=41 --- python-metaextract.changes | 6 +++++ python-metaextract.spec | 16 ++++++++----- tests-tests_require.patch | 49 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 tests-tests_require.patch diff --git a/python-metaextract.changes b/python-metaextract.changes index 5b912ac..657c100 100644 --- a/python-metaextract.changes +++ b/python-metaextract.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Oct 2 11:17:35 UTC 2024 - Matej Cepl + +- Add tests-tests_require.patch fixing broken tests + (gh#toabctl/metaextract#20). + ------------------------------------------------------------------- Wed Jun 21 15:27:55 UTC 2023 - ecsos diff --git a/python-metaextract.spec b/python-metaextract.spec index ac3b21f..4f4d837 100644 --- a/python-metaextract.spec +++ b/python-metaextract.spec @@ -1,7 +1,7 @@ # # spec file for package python-metaextract # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,7 +25,11 @@ License: Apache-2.0 Group: Development/Languages/Python URL: http://github.com/toabctl/metaextract Source: https://github.com/toabctl/metaextract/archive/%{version}.tar.gz -BuildRequires: %{python_module setuptools} +# PATCH-FIX-UPSTREAM tests-tests_require.patch gh#toabctl/metaextract#20 mcepl@suse.com +# Fix failing tests +Patch0: tests-tests_require.patch +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros # Needed even though no tests are present @@ -35,7 +39,7 @@ Requires: python-setuptools BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives %python_subpackages %description @@ -46,13 +50,13 @@ tarball that was retrieved from the Python Package Index. The tool was first developed in py2pack but is now its own module. %prep -%setup -q -n metaextract-%{version} +%autosetup -p1 -n metaextract-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %python_clone -a %{buildroot}%{_bindir}/metaextract diff --git a/tests-tests_require.patch b/tests-tests_require.patch new file mode 100644 index 0000000..d6ccd43 --- /dev/null +++ b/tests-tests_require.patch @@ -0,0 +1,49 @@ +--- + metaextract/tests/test_metaextract.py | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/metaextract/tests/test_metaextract.py ++++ b/metaextract/tests/test_metaextract.py +@@ -147,7 +147,7 @@ class TestMetaExtract(object): + 'entry_points': None, 'extras_require': {'extra1': ['pkg1']}, + 'install_requires': ['bar', 'foo'], 'python_requires': None, + 'setup_requires': [], 'has_ext_modules': None, +- 'scripts': None, 'data_files': None, 'tests_require': None} ++ 'scripts': None, 'data_files': None} + ), + ( + "setuptools_simple_unicode", { +@@ -155,14 +155,14 @@ class TestMetaExtract(object): + 'extra1': ['pkg1'], 'extra2': ['pkg2', 'pkg3']}, + 'install_requires': ['bar', 'foo'], 'python_requires': None, + 'setup_requires': [], 'has_ext_modules': None, +- 'scripts': None, 'data_files': None, 'tests_require': None} ++ 'scripts': None, 'data_files': None} + ), + ( + "setuptools_simple_unicode_and_header", { + 'entry_points': None, 'extras_require': {}, + 'install_requires': ['bar', 'foo'], 'python_requires': None, + 'setup_requires': [], 'has_ext_modules': None, +- 'scripts': None, 'data_files': None, 'tests_require': None} ++ 'scripts': None, 'data_files': None} + ), + ( + "setuptools_full", { +@@ -174,7 +174,7 @@ class TestMetaExtract(object): + ['share/doc/testpgk', + ['AUTHORS', 'LICENSE', 'README.rst']], + ['share/doc/testpkg/html', ['doc/testpkg.html']], +- ], 'tests_require': ['testpkg1'], 'entry_points': ++ ], 'entry_points': + { + 'console_scripts': ['testpkgp1=testpkg:main'] + }, +@@ -207,7 +207,6 @@ class TestMetaExtract(object): + 'extras_require': {}, 'install_requires': [], + 'python_requires': None, 'setup_requires': ['pbr>=1.0'], + 'has_ext_modules': None, 'scripts': None, 'data_files': None, +- 'tests_require': None, + 'version': '1'} + ), + (