diff --git a/python-colorlog.changes b/python-colorlog.changes index be4a51e..e96fcae 100644 --- a/python-colorlog.changes +++ b/python-colorlog.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Oct 29 04:28:54 UTC 2024 - Steve Kowalik + +- Switch to autosetup and pyproject macros. +- Set this package to noarch, since it doesn't ship any arch-dep files. +- Add patch support-python-313.patch: + * Support Python 3.13's logging changes. + ------------------------------------------------------------------- Tue Jan 30 12:20:13 UTC 2024 - Dirk Müller diff --git a/python-colorlog.spec b/python-colorlog.spec index b78613a..7e049a1 100644 --- a/python-colorlog.spec +++ b/python-colorlog.spec @@ -24,10 +24,15 @@ Summary: Log formatting with colors License: MIT URL: https://github.com/borntyping/python-colorlog Source: https://files.pythonhosted.org/packages/source/c/colorlog/colorlog-%{version}.tar.gz +# PATCH-FIX-UPSTREAM Partial patch from gh#borntyping/python-colorlog#607485def2d60b60c40c0d682574324b47fc30ba +Patch0: support-python-313.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros +BuildArch: noarch %python_subpackages %description @@ -38,13 +43,13 @@ This is accomplished by added a set of terminal color codes to the record before it is used to format the string. %prep -%setup -q -n colorlog-%{version} +%autosetup -p1 -n colorlog-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -54,6 +59,6 @@ before it is used to format the string. %doc README.md %license LICENSE %{python_sitelib}/colorlog -%{python_sitelib}/colorlog-%{version}-py%{python_version}.egg-info +%{python_sitelib}/colorlog-%{version}.dist-info %changelog diff --git a/support-python-313.patch b/support-python-313.patch new file mode 100644 index 0000000..a7bb284 --- /dev/null +++ b/support-python-313.patch @@ -0,0 +1,54 @@ +From 607485def2d60b60c40c0d682574324b47fc30ba Mon Sep 17 00:00:00 2001 +From: Sam Clements +Date: Fri, 26 Jan 2024 14:06:47 +0000 +Subject: [PATCH] Support Python 3.13 + +--- + .github/workflows/ci.yml | 2 ++ + colorlog/wrappers.py | 17 +++++++++++++---- + setup.py | 2 +- + tox.ini | 2 +- + 4 files changed, 17 insertions(+), 6 deletions(-) + +diff --git a/colorlog/wrappers.py b/colorlog/wrappers.py +index 20e3042..63b201a 100644 +--- a/colorlog/wrappers.py ++++ b/colorlog/wrappers.py +@@ -2,6 +2,7 @@ + + import functools + import logging ++import sys + import typing + from logging import ( + CRITICAL, +@@ -53,8 +54,8 @@ def basicConfig( + ) -> None: + """Call ``logging.basicConfig`` and override the formatter it creates.""" + logging.basicConfig(**kwargs) +- logging._acquireLock() # type: ignore +- try: ++ ++ def _basicConfig(): + handler = logging.root.handlers[0] + handler.setFormatter( + colorlog.formatter.ColoredFormatter( +@@ -67,8 +68,16 @@ def basicConfig( + stream=kwargs.get("stream", None), + ) + ) +- finally: +- logging._releaseLock() # type: ignore ++ ++ if sys.version_info >= (3, 13): ++ with logging._lock: ++ _basicConfig() ++ else: ++ logging._acquireLock() # type: ignore ++ try: ++ _basicConfig() ++ finally: ++ logging._releaseLock() # type: ignore + + + def ensure_configured(func):