From 490b82102932fd714921a2d65abbaa825fb99ad281e00e9fa56fca136f9c7393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 6 Sep 2024 09:42:09 +0000 Subject: [PATCH 1/3] - Add patch logutils-intersphinx.patch to fix compatibility with recent Sphinx OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-logutils?expand=0&rev=15 --- .gitattributes | 23 ++++++ .gitignore | 1 + logutils-0.3.5.tar.gz | 3 + logutils-intersphinx.patch | 20 +++++ logutils-pr1-fix-testasserts-py3.12.patch | 56 +++++++++++++ python-logutils.changes | 54 +++++++++++++ python-logutils.spec | 97 +++++++++++++++++++++++ sphinx4.patch | 15 ++++ 8 files changed, 269 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 logutils-0.3.5.tar.gz create mode 100644 logutils-intersphinx.patch create mode 100644 logutils-pr1-fix-testasserts-py3.12.patch create mode 100644 python-logutils.changes create mode 100644 python-logutils.spec create mode 100644 sphinx4.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/logutils-0.3.5.tar.gz b/logutils-0.3.5.tar.gz new file mode 100644 index 0000000..b001d4e --- /dev/null +++ b/logutils-0.3.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc058a25d5c209461f134e1f03cab637d66a7a5ccc12e593db56fbb279899a82 +size 27703 diff --git a/logutils-intersphinx.patch b/logutils-intersphinx.patch new file mode 100644 index 0000000..c1d3075 --- /dev/null +++ b/logutils-intersphinx.patch @@ -0,0 +1,20 @@ +From 28565675eea39b1b1def8cd6706b0a9556f7e505 Mon Sep 17 00:00:00 2001 +From: Vinay Sajip +Date: Thu, 15 Jun 2023 16:13:41 +0100 +Subject: [PATCH] Add Read The Docs configuration. + +--- +diff --git a/doc/conf.py b/doc/conf.py +index afdd641..04e02eb 100644 +--- a/doc/conf.py ++++ b/doc/conf.py +@@ -194,6 +194,4 @@ latex_documents = [ + + + # Example configuration for intersphinx: refer to the Python standard library. +-intersphinx_mapping = { +- 'http://docs.python.org/dev': None, +-} ++intersphinx_mapping = {'python': ('http://docs.python.org/', None)} +-- +2.46.0 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 new file mode 100644 index 0000000..9edcd72 --- /dev/null +++ b/python-logutils.changes @@ -0,0 +1,54 @@ +------------------------------------------------------------------- +Thu Sep 5 18:08:30 UTC 2024 - Christoph G + +- Add patch logutils-intersphinx.patch to fix compatibility + with recent Sphinx + +------------------------------------------------------------------- +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 + +- update path for SLE15 + +------------------------------------------------------------------- +Wed Sep 1 12:28:43 UTC 2021 - pgajdos@suse.com + +- %check: use %pyunittest rpm macro + +------------------------------------------------------------------- +Sat Jun 5 19:05:36 UTC 2021 - Dirk Müller + +- add sphinx4.patch to enable build with Sphinx 4.x + +------------------------------------------------------------------- +Tue Dec 4 12:50:10 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Thu Jun 29 16:53:49 UTC 2017 - tbechtold@suse.com + +- update to 0.3.5: + - Bring QueueListener implementation in line with the version in the stdlib. + - Fixed a bug in ColorizingStreamHandler relating to encoding. + - Return non-zero error code from "setup.py test" when a test fails. + - Make the dictConfig tests work with both Python 2.x and 3.x. +- convert to singlespec +- fix Source url +- split -doc package +- update Url + +------------------------------------------------------------------- +Thu Jul 18 09:02:19 UTC 2013 - speilicke@suse.com + +- Initial version + diff --git a/python-logutils.spec b/python-logutils.spec new file mode 100644 index 0000000..a34b1cb --- /dev/null +++ b/python-logutils.spec @@ -0,0 +1,97 @@ +# +# spec file for package python-logutils +# +# 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 +# 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/ +# + + +Name: python-logutils +Version: 0.3.5 +Release: 0 +Summary: Logging utilities +License: BSD-3-Clause +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 +# PATCH-FIX-UPSTREA logutils-intersphinx.patch +Patch2: logutils-intersphinx.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 +BuildArch: noarch +%python_subpackages + +%description +The logutils package provides a set of handlers for the Python standard +library's logging package. + +Some of these handlers are out-of-scope for the standard library, and +so they are packaged here. Others are updated versions which have +appeared in recent Python releases, but are usable with older versions +of Python and so are packaged here. + +%package -n python-logutils-doc +Summary: Documentation for %{name} +Group: Documentation/Other +Provides: %{python_module logutils-doc = %{version}} + +%description -n python-logutils-doc +The logutils package provides a set of handlers for the Python standard +library's logging package. + +Some of these handlers are out-of-scope for the standard library, and +so they are packaged here. Others are updated versions which have +appeared in recent Python releases, but are usable with older versions +of Python and so are packaged here. + +This package contains the documentation. + +%prep +%setup -q -n logutils-%{version} +%autopatch -p1 + +%build +%pyproject_wheel +pushd doc +make html +rm _build/html/.buildinfo +popd + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +export PATH="$PATH:/sbin:/usr/sbin" +%pyunittest discover -v tests + +%files %{python_files} +%license LICENSE.txt +%doc NEWS.txt README.rst +%{python_sitelib}/logutils +%{python_sitelib}/logutils-%{version}.dist-info + +%files -n python-logutils-doc +%license LICENSE.txt +%doc doc/_build/html + +%changelog diff --git a/sphinx4.patch b/sphinx4.patch new file mode 100644 index 0000000..1d29727 --- /dev/null +++ b/sphinx4.patch @@ -0,0 +1,15 @@ +Index: logutils-0.3.5/doc/conf.py +=================================================================== +--- logutils-0.3.5.orig/doc/conf.py ++++ logutils-0.3.5/doc/conf.py +@@ -171,8 +171,8 @@ htmlhelp_basename = 'Logutilsdoc' + # Grouping the document tree into LaTeX files. List of tuples + # (source start file, target name, title, author, document class [howto/manual]). + latex_documents = [ +- ('index', 'Logutils.tex', ur'Logutils Documentation', +- ur'Vinay Sajip', 'manual'), ++ ('index', 'Logutils.tex', 'Logutils Documentation', ++ 'Vinay Sajip', 'manual'), + ] + + # The name of an image file (relative to this directory) to place at the top of From a2d8452bfa30af41644de4c7d48b52079a01024d4113db34e1c525b4652204df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 9 Sep 2024 07:19:01 +0000 Subject: [PATCH 2/3] quick sr to fix patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-logutils?expand=0&rev=16 --- logutils-pr1-fix-testasserts-py3.12.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logutils-pr1-fix-testasserts-py3.12.patch b/logutils-pr1-fix-testasserts-py3.12.patch index 249fd1f..84ece4c 100644 --- a/logutils-pr1-fix-testasserts-py3.12.patch +++ b/logutils-pr1-fix-testasserts-py3.12.patch @@ -52,5 +52,5 @@ index 3aee984..0cf4806 100644 def test_config5_ok(self): self.test_config1_ok(config=self.config5) -- -2.42.0 +2.46.0 From 24b9fa9ee3faaf0b46f70bf1b59928079859239447789cc727f9655755bfb6d6 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 10 Sep 2024 03:08:41 +0000 Subject: [PATCH 3/3] - Add patch use-logging-lock-directly.patch: * Use logging._lock as a context manager. - Switch to autosetup macro. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-logutils?expand=0&rev=17 --- python-logutils.changes | 7 ++++ python-logutils.spec | 9 ++--- use-logging-lock-directly.patch | 65 +++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 use-logging-lock-directly.patch diff --git a/python-logutils.changes b/python-logutils.changes index 9edcd72..a08efc8 100644 --- a/python-logutils.changes +++ b/python-logutils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Sep 10 03:08:22 UTC 2024 - Steve Kowalik + +- Add patch use-logging-lock-directly.patch: + * Use logging._lock as a context manager. +- Switch to autosetup macro. + ------------------------------------------------------------------- Thu Sep 5 18:08:30 UTC 2024 - Christoph G diff --git a/python-logutils.spec b/python-logutils.spec index a34b1cb..1835be8 100644 --- a/python-logutils.spec +++ b/python-logutils.spec @@ -21,14 +21,15 @@ Version: 0.3.5 Release: 0 Summary: Logging utilities License: BSD-3-Clause -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 -# PATCH-FIX-UPSTREA logutils-intersphinx.patch +# PATCH-FIX-UPSTREAM logutils-intersphinx.patch Patch2: logutils-intersphinx.patch +# PATCH-FIX-OPENSUSE Use logging._lock as a context manager directly +Patch3: use-logging-lock-directly.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module redis} BuildRequires: %{python_module setuptools} @@ -51,7 +52,6 @@ of Python and so are packaged here. %package -n python-logutils-doc Summary: Documentation for %{name} -Group: Documentation/Other Provides: %{python_module logutils-doc = %{version}} %description -n python-logutils-doc @@ -66,8 +66,7 @@ of Python and so are packaged here. This package contains the documentation. %prep -%setup -q -n logutils-%{version} -%autopatch -p1 +%autosetup -p1 -n logutils-%{version} %build %pyproject_wheel diff --git a/use-logging-lock-directly.patch b/use-logging-lock-directly.patch new file mode 100644 index 0000000..8c3ae08 --- /dev/null +++ b/use-logging-lock-directly.patch @@ -0,0 +1,65 @@ +Index: logutils-0.3.5/logutils/dictconfig.py +=================================================================== +--- logutils-0.3.5.orig/logutils/dictconfig.py ++++ logutils-0.3.5/logutils/dictconfig.py +@@ -290,8 +290,7 @@ class DictConfigurator(BaseConfigurator) + raise ValueError("Unsupported version: %s" % config['version']) + incremental = config.pop('incremental', False) + EMPTY_DICT = {} +- logging._acquireLock() +- try: ++ with logging._lock: + if incremental: + handlers = config.get('handlers', EMPTY_DICT) + # incremental handler config only if handler name +@@ -430,8 +429,6 @@ class DictConfigurator(BaseConfigurator) + e = sys.exc_info()[1] + raise ValueError('Unable to configure root ' + 'logger: %s' % e) +- finally: +- logging._releaseLock() + + def configure_formatter(self, config): + """Configure a formatter from a dictionary.""" +Index: logutils-0.3.5/tests/test_dictconfig.py +=================================================================== +--- logutils-0.3.5.orig/tests/test_dictconfig.py ++++ logutils-0.3.5/tests/test_dictconfig.py +@@ -39,8 +39,7 @@ class ConfigDictTest(unittest.TestCase): + self.adapter = LoggerAdapter(l, {}) + + logger_dict = logging.getLogger().manager.loggerDict +- logging._acquireLock() +- try: ++ with logging._lock: + self.saved_handlers = logging._handlers.copy() + self.saved_handler_list = logging._handlerList[:] + self.saved_loggers = logger_dict.copy() +@@ -49,8 +48,6 @@ class ConfigDictTest(unittest.TestCase): + else: + self.saved_level_to_name = logging._levelToName.copy() + self.saved_name_to_level = logging._nameToLevel.copy() +- finally: +- logging._releaseLock() + + self.root_logger = logging.getLogger("") + self.original_logging_level = self.root_logger.getEffectiveLevel() +@@ -58,8 +55,7 @@ class ConfigDictTest(unittest.TestCase): + + def tearDown(self): + self.root_logger.setLevel(self.original_logging_level) +- logging._acquireLock() +- try: ++ with logging._lock: + if hasattr(logging, '_levelNames'): + logging._levelNames.clear() + logging._levelNames.update(self.saved_level_names) +@@ -74,8 +70,6 @@ class ConfigDictTest(unittest.TestCase): + loggerDict = logging.getLogger().manager.loggerDict + loggerDict.clear() + loggerDict.update(self.saved_loggers) +- finally: +- logging._releaseLock() + + message_num = 0 +