diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-12 19:09:37 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-12 19:09:37 -0500 |
| commit | b590c8d7572b727d565cc0b8ff660d43569845de (patch) | |
| tree | 06f7a4102ea4e845df8b66660f252920d52952f9 /dev-python/logutils | |
| parent | 24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff) | |
| download | baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip | |
Diffstat (limited to 'dev-python/logutils')
| -rw-r--r-- | dev-python/logutils/Manifest | 1 | ||||
| -rw-r--r-- | dev-python/logutils/files/logutils-0.3.5-py313.patch | 90 | ||||
| -rw-r--r-- | dev-python/logutils/logutils-0.3.5-r1.ebuild | 45 | ||||
| -rw-r--r-- | dev-python/logutils/metadata.xml | 10 |
4 files changed, 146 insertions, 0 deletions
diff --git a/dev-python/logutils/Manifest b/dev-python/logutils/Manifest new file mode 100644 index 000000000000..cffb318a49c5 --- /dev/null +++ b/dev-python/logutils/Manifest @@ -0,0 +1 @@ +DIST logutils-0.3.5.tar.gz 27703 BLAKE2B ceeabbc64603da949e771531fd1a7cff6bc760ffa98fcb952eddc5da39d019e202949dc596398ea68397c573cb9c2bace77f8e5462030e68d2f5768444a23b45 SHA512 0194bf4f01e7a29d4211495dc5fead9d4bd5bc1b791d25ff38ad28960a229a9bcdbaa7e6d3b5a4105eef6c9aa159459d6529c2615df113e7ec1ae93aac5cce6c diff --git a/dev-python/logutils/files/logutils-0.3.5-py313.patch b/dev-python/logutils/files/logutils-0.3.5-py313.patch new file mode 100644 index 000000000000..e6b804f2e042 --- /dev/null +++ b/dev-python/logutils/files/logutils-0.3.5-py313.patch @@ -0,0 +1,90 @@ +From f33a518fc04bcb4f875b2c741c7bbee8db9e01d8 Mon Sep 17 00:00:00 2001 +From: Arne Keller <arne.keller@posteo.de> +Date: Sat, 11 Jan 2025 11:27:21 +0100 +Subject: [PATCH] Fix Python 3.13 compatibility + +--- + logutils/dictconfig.py | 9 +++++++-- + tests/test_dictconfig.py | 14 ++++++++++---- + 2 files changed, 17 insertions(+), 6 deletions(-) + +diff --git a/logutils/dictconfig.py b/logutils/dictconfig.py +index c774552..2e33031 100644 +--- a/logutils/dictconfig.py ++++ b/logutils/dictconfig.py +@@ -290,7 +290,12 @@ class DictConfigurator(BaseConfigurator): + raise ValueError("Unsupported version: %s" % config['version']) + incremental = config.pop('incremental', False) + EMPTY_DICT = {} +- logging._acquireLock() ++ # Python 3.13+ renamed these functions ++ try: ++ acquire, release = logging._prepareFork, logging._afterFork ++ except AttributeError: ++ acquire, release = logging._acquireLock, logging._releaseLock ++ acquire() + try: + if incremental: + handlers = config.get('handlers', EMPTY_DICT) +@@ -431,7 +436,7 @@ class DictConfigurator(BaseConfigurator): + raise ValueError('Unable to configure root ' + 'logger: %s' % e) + finally: +- logging._releaseLock() ++ release() + + def configure_formatter(self, config): + """Configure a formatter from a dictionary.""" +diff --git a/tests/test_dictconfig.py b/tests/test_dictconfig.py +index 3aee984..e56d267 100644 +--- a/tests/test_dictconfig.py ++++ b/tests/test_dictconfig.py +@@ -30,6 +30,12 @@ def handlerFunc(): + class CustomHandler(logging.StreamHandler): + pass + ++# Python 3.13+ renamed these functions ++try: ++ acquire, release = logging._prepareFork, logging._afterFork ++except AttributeError: ++ acquire, release = logging._acquireLock, logging._releaseLock ++ + class ConfigDictTest(unittest.TestCase): + + """Reading logging config from a dictionary.""" +@@ -39,7 +45,7 @@ class ConfigDictTest(unittest.TestCase): + self.adapter = LoggerAdapter(l, {}) + + logger_dict = logging.getLogger().manager.loggerDict +- logging._acquireLock() ++ acquire() + try: + self.saved_handlers = logging._handlers.copy() + self.saved_handler_list = logging._handlerList[:] +@@ -50,7 +56,7 @@ class ConfigDictTest(unittest.TestCase): + self.saved_level_to_name = logging._levelToName.copy() + self.saved_name_to_level = logging._nameToLevel.copy() + finally: +- logging._releaseLock() ++ release() + + self.root_logger = logging.getLogger("") + self.original_logging_level = self.root_logger.getEffectiveLevel() +@@ -58,7 +64,7 @@ class ConfigDictTest(unittest.TestCase): + + def tearDown(self): + self.root_logger.setLevel(self.original_logging_level) +- logging._acquireLock() ++ acquire() + try: + if hasattr(logging, '_levelNames'): + logging._levelNames.clear() +@@ -75,7 +81,7 @@ class ConfigDictTest(unittest.TestCase): + loggerDict.clear() + loggerDict.update(self.saved_loggers) + finally: +- logging._releaseLock() ++ release() + + message_num = 0 + diff --git a/dev-python/logutils/logutils-0.3.5-r1.ebuild b/dev-python/logutils/logutils-0.3.5-r1.ebuild new file mode 100644 index 000000000000..9f058c36eb43 --- /dev/null +++ b/dev-python/logutils/logutils-0.3.5-r1.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{13..14} ) + +inherit distutils-r1 pypi + +DESCRIPTION="The logutils package provides a set of handlers for the Python standard" +HOMEPAGE=" + https://bitbucket.org/vinay.sajip/logutils/ + https://pypi.org/project/logutils/ +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64 arm64 ppc64 ~riscv x86" +IUSE="test" +RESTRICT="!test? ( test )" + +BDEPEND=" + test? ( + dev-db/redis + dev-python/redis[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests unittest + +PATCHES=( + # https://bitbucket.org/vinay.sajip/logutils/pull-requests/5 + "${FILESDIR}/${P}-py313.patch" +) + +src_prepare() { + distutils-r1_src_prepare + + sed -i -e 's:assertEquals:assertEqual:' tests/*.py || die +} + +python_test() { + eunittest -s tests +} diff --git a/dev-python/logutils/metadata.xml b/dev-python/logutils/metadata.xml new file mode 100644 index 000000000000..6588aa0440ae --- /dev/null +++ b/dev-python/logutils/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>prometheanfire@gentoo.org</email> + <name>Matthew Thode</name> + </maintainer> + <stabilize-allarches /> + <origin>baldeagleos-repo</origin> +</pkgmetadata> |
