From 9242be774865c51024143b245a34b541e35d762b97b003082920e97e2ea01364 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 19 Jan 2024 08:46:29 +0000 Subject: [PATCH] Accepting request 1139803 from home:bnavigator:branches:devel:languages:python - Add logutils-pr1-fix-testasserts-py3.12.patch * https://bitbucket.org/vinay.sajip/logutils/pull-requests/1 * Fixes the test suite. This package is really old but still half-maintained - Switch to PEP517 - Deduplicate files OBS-URL: https://build.opensuse.org/request/show/1139803 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-logutils?expand=0&rev=13 --- logutils-pr1-fix-testasserts-py3.12.patch | 56 +++++++++++++++++++++++ python-logutils.changes | 10 ++++ python-logutils.spec | 21 ++++++--- 3 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 logutils-pr1-fix-testasserts-py3.12.patch diff --git a/logutils-pr1-fix-testasserts-py3.12.patch b/logutils-pr1-fix-testasserts-py3.12.patch new file mode 100644 index 0000000..249fd1f --- /dev/null +++ b/logutils-pr1-fix-testasserts-py3.12.patch @@ -0,0 +1,56 @@ +From 0a3af211128567c437e68261a02591ffe2682d95 Mon Sep 17 00:00:00 2001 +From: Hugo van Kemenade +Date: Thu, 6 Jan 2022 15:35:16 +0200 +Subject: [PATCH] Fix tests for Python 3.11 using teyit + +--- + tests/test_colorize.py | 2 +- + tests/test_dictconfig.py | 12 ++++++++---- + 2 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/tests/test_colorize.py b/tests/test_colorize.py +index b4f9fa6..b1a34b6 100644 +--- a/tests/test_colorize.py ++++ b/tests/test_colorize.py +@@ -33,7 +33,7 @@ class ColorizeTest(unittest.TestCase): + try: + logger.warning(u('Some unicode string')) + logfile_handle.seek(0) +- self.assertTrue('Some unicode string' in logfile_handle.read()) ++ self.assertIn('Some unicode string', logfile_handle.read()) + finally: + logger.removeHandler(handler) + handler.close() +diff --git a/tests/test_dictconfig.py b/tests/test_dictconfig.py +index 3aee984..0cf4806 100644 +--- a/tests/test_dictconfig.py ++++ b/tests/test_dictconfig.py +@@ -568,8 +568,10 @@ class ConfigDictTest(unittest.TestCase): + raise RuntimeError() + except RuntimeError: + logging.exception("just testing") +- self.assertEquals(h.formatted[0], +- "ERROR:root:just testing\nGot a [RuntimeError]") ++ self.assertEqual( ++ h.formatted[0], ++ 'ERROR:root:just testing\nGot a [RuntimeError]' ++ ) + + def test_config4a_ok(self): + # A config specifying a custom formatter class. +@@ -580,8 +582,10 @@ class ConfigDictTest(unittest.TestCase): + raise RuntimeError() + except RuntimeError: + logging.exception("just testing") +- self.assertEquals(h.formatted[0], +- "ERROR:root:just testing\nGot a [RuntimeError]") ++ self.assertEqual( ++ h.formatted[0], ++ 'ERROR:root:just testing\nGot a [RuntimeError]' ++ ) + + def test_config5_ok(self): + self.test_config1_ok(config=self.config5) +-- +2.42.0 + diff --git a/python-logutils.changes b/python-logutils.changes index a3ec989..247fe94 100644 --- a/python-logutils.changes +++ b/python-logutils.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Jan 18 19:39:04 UTC 2024 - Ben Greiner + +- Add logutils-pr1-fix-testasserts-py3.12.patch + * https://bitbucket.org/vinay.sajip/logutils/pull-requests/1 + * Fixes the test suite. This package is really old but still + half-maintained +- Switch to PEP517 +- Deduplicate files + ------------------------------------------------------------------- Fri Feb 17 12:31:27 UTC 2023 - Dirk Müller diff --git a/python-logutils.spec b/python-logutils.spec index 601df69..07a5891 100644 --- a/python-logutils.spec +++ b/python-logutils.spec @@ -1,7 +1,7 @@ # # spec file for package python-logutils # -# Copyright (c) 2023 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 @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-logutils Version: 0.3.5 Release: 0 @@ -26,8 +25,13 @@ Group: Development/Languages/Python URL: https://logutils.readthedocs.io/ Source: https://files.pythonhosted.org/packages/source/l/logutils/logutils-%{version}.tar.gz Patch0: sphinx4.patch +# PATCH-FIX-UPSTREAM logutils-pr1-fix-testasserts-py3.12.patch https://bitbucket.org/vinay.sajip/logutils/pull-requests/1 +Patch1: https://bitbucket.org/hugovk/logutils/commits/0a3af211128567c437e68261a02591ffe2682d95/raw#/logutils-pr1-fix-testasserts-py3.12.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module redis} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-Sphinx BuildRequires: redis @@ -64,11 +68,15 @@ This package contains the documentation. %autopatch -p1 %build -%python_build -cd doc && make html +%pyproject_wheel +pushd doc +make html +rm _build/html/.buildinfo +popd %install -%python_install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} %check export PATH="$PATH:/sbin:/usr/sbin" @@ -77,7 +85,8 @@ export PATH="$PATH:/sbin:/usr/sbin" %files %{python_files} %license LICENSE.txt %doc NEWS.txt README.rst -%{python_sitelib}/* +%{python_sitelib}/logutils +%{python_sitelib}/logutils-%{version}.dist-info %files -n python-logutils-doc %license LICENSE.txt