diff --git a/drop-nose-requirement.patch b/drop-nose-requirement.patch index 57aefcc..9eec7bd 100644 --- a/drop-nose-requirement.patch +++ b/drop-nose-requirement.patch @@ -1,8 +1,16 @@ -Index: columnize-0.3.10/setup.py -=================================================================== ---- columnize-0.3.10.orig/setup.py -+++ columnize-0.3.10/setup.py -@@ -34,6 +34,5 @@ setup( +--- + setup.py | 2 -- + 1 file changed, 2 deletions(-) + +--- a/setup.py ++++ b/setup.py +@@ -28,12 +28,10 @@ setup( + long_description = long_description, + long_description_content_type = "text/x-rst", + name = modname, +- test_suite = 'nose.collector', + url = web, + version = VERSION, py_modules = py_modules, install_requires = install_requires, tests_require = tests_require, diff --git a/python-columnize-no-mock.patch b/python-columnize-no-mock.patch new file mode 100644 index 0000000..639b7ee --- /dev/null +++ b/python-columnize-no-mock.patch @@ -0,0 +1,28 @@ +--- + __pkginfo__.py | 2 +- + test_columnize.py | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +--- a/__pkginfo__.py ++++ b/__pkginfo__.py +@@ -45,7 +45,7 @@ exec( + ) + ) + +-tests_require = ["mock"] ++tests_require = [""] + web = "https://github.com/rocky/pycolumnize" + # tracebacks in zip files are funky and not debuggable + zip_safe = False +--- a/test_columnize.py ++++ b/test_columnize.py +@@ -1,7 +1,8 @@ + #!/usr/bin/env python + # -*- Python -*- + "Unit test for Columnize" +-import mock, operator, os, sys, unittest ++import operator, os, sys, unittest ++import unittest.mock as mock + + top_builddir = os.path.join(os.path.dirname(__file__), os.path.pardir) + if top_builddir[-1] != os.path.sep: diff --git a/python-columnize.changes b/python-columnize.changes index 5180bad..4c05954 100644 --- a/python-columnize.changes +++ b/python-columnize.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Mar 8 10:13:54 UTC 2022 - Matej Cepl + +- Rearrange and reapply patches. + +------------------------------------------------------------------- +Tue Mar 8 06:50:19 UTC 2022 - pgajdos@suse.com + +- do not require python-mock for build +- added patches + fix https://github.com/rocky/pycolumnize/issues/28 + + python-columnize-no-mock.patch + ------------------------------------------------------------------- Sat Feb 5 17:08:57 UTC 2022 - Atri Bhattacharya diff --git a/python-columnize.spec b/python-columnize.spec index e4feb1a..acc6347 100644 --- a/python-columnize.spec +++ b/python-columnize.spec @@ -1,7 +1,7 @@ # # spec file for package python-columnize # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# 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 @@ -12,27 +12,32 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# %define modname columnize %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 Name: python-columnize Version: 0.3.10 Release: 0 License: MIT Summary: Format a simple (i.e. not nested) list into aligned columns -Url: https://github.com/rocky/pycolumnize +URL: https://github.com/rocky/pycolumnize Group: Development/Languages/Python Source0: https://files.pythonhosted.org/packages/source/c/columnize/columnize-%{version}.tar.gz -# Include test file missed from being included in source tarball -Source1: https://raw.githubusercontent.com/rocky/pycolumnize/%{version}/test_columnize.py +# Include test file missed from being included in source tarball gh#rocky/pycolumnize#29 +# https://raw.githubusercontent.com/rocky/pycolumnize/%%{version}/test_columnize.py +Source1: test_columnize.py # PATCH-FEATURE-OPENSUSE drop-nose-requirement.patch badshah400@gmail.com -- Drop requirement on outdated nose; we do not run tests anyway Patch0: drop-nose-requirement.patch -BuildRequires: python-rpm-macros +# PATCH-FIX-UPSTREAM python-columnize-no-mock.patch gh#rocky/pycolumnize#28 mcepl@suse.com +# remove the need for external mock package +Patch1: python-columnize-no-mock.patch BuildRequires: %{python_module setuptools} +BuildRequires: python-rpm-macros # SECTION For tests -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest} # /SECTION BuildRequires: fdupes @@ -44,9 +49,9 @@ BuildArch: noarch Format a simple (i.e. not nested) list into aligned columns. %prep -%autosetup -p1 -n columnize-%{version} - +%setup -q -n columnize-%{version} cp %{SOURCE1} ./ +%autopatch -p1 %build %python_build