diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2024-06-30 20:34:53 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2024-06-30 20:34:53 +0000 |
| commit | 18f52fea684ac9ef56acdc2063c179401eaf7a40 (patch) | |
| tree | c627f50dfe66fbf3453b2bf4dd36f624e31fdb47 /dev-python/coloredlogs | |
| parent | 0958420ce00af4f18ffa7eede862d5deddbd2122 (diff) | |
| download | baldeagleos-repo-18f52fea684ac9ef56acdc2063c179401eaf7a40.tar.gz baldeagleos-repo-18f52fea684ac9ef56acdc2063c179401eaf7a40.tar.xz baldeagleos-repo-18f52fea684ac9ef56acdc2063c179401eaf7a40.zip | |
Adding metadata
Diffstat (limited to 'dev-python/coloredlogs')
| -rw-r--r-- | dev-python/coloredlogs/coloredlogs-15.0.1-r2.ebuild | 47 | ||||
| -rw-r--r-- | dev-python/coloredlogs/files/coloredlogs-15.0.1-py3.13.patch | 43 |
2 files changed, 90 insertions, 0 deletions
diff --git a/dev-python/coloredlogs/coloredlogs-15.0.1-r2.ebuild b/dev-python/coloredlogs/coloredlogs-15.0.1-r2.ebuild new file mode 100644 index 000000000000..c3833390c9a3 --- /dev/null +++ b/dev-python/coloredlogs/coloredlogs-15.0.1-r2.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8,9,10,11,12} pypy3 ) +DISTUTILS_USE_PEP517=setuptools +inherit distutils-r1 pypi + +DESCRIPTION="Colored stream handler for the logging module" +HOMEPAGE=" + https://pypi.org/project/coloredlogs/ + https://github.com/xolox/python-coloredlogs + https://coloredlogs.readthedocs.io/en/latest/ +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux" + +RDEPEND=" + >=dev-python/humanfriendly-9.1[${PYTHON_USEDEP}]" +BDEPEND=" + test? ( + dev-python/capturer[${PYTHON_USEDEP}] + dev-python/coverage[${PYTHON_USEDEP}] + dev-python/mock[${PYTHON_USEDEP}] + dev-python/verboselogs[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}/${PN}-14.0-fix-install-prefix.patch" + "${FILESDIR}/${PN}-15.0.1-py3.13.patch" +) + +distutils_enable_sphinx docs +distutils_enable_tests pytest + +EPYTEST_DESELECT=( + # test_auto_install fails because the pth file isn't being loaded + coloredlogs/tests.py::ColoredLogsTestCase::test_auto_install +) + +python_test() { + epytest coloredlogs/tests.py +} diff --git a/dev-python/coloredlogs/files/coloredlogs-15.0.1-py3.13.patch b/dev-python/coloredlogs/files/coloredlogs-15.0.1-py3.13.patch new file mode 100644 index 000000000000..649683b4944e --- /dev/null +++ b/dev-python/coloredlogs/files/coloredlogs-15.0.1-py3.13.patch @@ -0,0 +1,43 @@ +From 9d4f4020897fcf48d381de8e099dc29b53fc9531 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" <code@musicinmybrain.net> +Date: Wed, 12 Jun 2024 14:00:28 -0400 +Subject: [PATCH] Replace pipes.quote with shlex.quote on Python 3 + +The shlex.quote() API is available from Python 3.3 on; pipes.quote() was +never documented, and is removed in Python 3.13. + +Fixes #119. + +Upstream-PR: https://github.com/xolox/python-coloredlogs/pull/120 +Upstream-Issue: https://github.com/xolox/python-coloredlogs/issues/119 + +diff --git a/coloredlogs/converter/__init__.py b/coloredlogs/converter/__init__.py +index a424469..96817a0 100644 +--- a/coloredlogs/converter/__init__.py ++++ b/coloredlogs/converter/__init__.py +@@ -9,11 +9,15 @@ + # Standard library modules. + import codecs + import os +-import pipes + import re + import subprocess + import tempfile + ++try: ++ from shlex import quote # Python 3 ++except ImportError: ++ from pipes import quote # Python 2 (removed in 3.13) ++ + # External dependencies. + from humanfriendly.terminal import ( + ANSI_CSI, +@@ -75,7 +79,7 @@ def capture(command, encoding='UTF-8'): + # + # [1] http://man7.org/linux/man-pages/man1/script.1.html + # [2] https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/script.1.html +- command_line = ['script', '-qc', ' '.join(map(pipes.quote, command)), '/dev/null'] ++ command_line = ['script', '-qc', ' '.join(map(quote, command)), '/dev/null'] + script = subprocess.Popen(command_line, stdout=subprocess.PIPE, stderr=dev_null) + stdout, stderr = script.communicate() + if script.returncode == 0: |
