summaryrefslogtreecommitdiff
path: root/dev-python/coloredlogs
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/coloredlogs')
-rw-r--r--dev-python/coloredlogs/Manifest4
-rw-r--r--dev-python/coloredlogs/coloredlogs-10.0.ebuild38
-rw-r--r--dev-python/coloredlogs/files/coloredlogs-10.0-skip-cli-test.patch17
-rw-r--r--dev-python/coloredlogs/files/coloredlogs-10.0-skip-sandbox-violation-tests.patch101
4 files changed, 160 insertions, 0 deletions
diff --git a/dev-python/coloredlogs/Manifest b/dev-python/coloredlogs/Manifest
index 92f924ef335b..0d4d3675cf42 100644
--- a/dev-python/coloredlogs/Manifest
+++ b/dev-python/coloredlogs/Manifest
@@ -1,4 +1,8 @@
+AUX coloredlogs-10.0-skip-cli-test.patch 697 BLAKE2B 677e4ea1a1c8d04390e0a815226b80d06940f713f678ceb716545d98290881dc6324890aef67c5ea12c833d441536a4eeaa989ed8d23a9590e88643874e0da16 SHA512 24233e3d217f074d47165477395a3ca10a47747124f6ce88ad8a190e04fa7136203ac30bb9e82d49eb6adb0d066f7cdeb1c884b39e9c1b7304531f2eb9296e11
+AUX coloredlogs-10.0-skip-sandbox-violation-tests.patch 5312 BLAKE2B bb7ac55706ca89a16d7727d796e586a665730d25f1cb69aa833b24082e42f0f5aed3a5d4f627e2015bb189ea3422ab1bcc2982933a7a123990adf821a7a2fdc2 SHA512 071ac2255ce9e6e4e379065ce377e86c3ebc9e910951d647cd19e15431983cb966eba7e1bb2a2431ecb91aa09f3802a5e365683a2e545e0e5fb2d58432748bfc
AUX coloredlogs-2.0-skip-cli-test.patch 842 BLAKE2B b6e17539f22349bcd20ba4ec64f03dd2e8e291e7f8e892765cc675d88b338d64f5df12b28b1909d0554eb42bfc70cc564f603d026f05e2ca4fe0952b6021af91 SHA512 98e5e8d207de67abf22d0de5729cf6926802329e1a32977dc95155490cf32c6b94b69f8e78a410a718bae073e4d6d618c515dcd7318b057671bb91fcf84c4424
+DIST coloredlogs-10.0.tar.gz 273273 BLAKE2B 775b12718d780da396d74c7f960cdbbd4858c793bf3eefb53d29e9f6b415f682110ae2c7ac631be230578946a2fab8d75e0c3aa487ccd952bb05443f0a85700c SHA512 f4a51fd8fa92ea4e2ef0b58305dcc4bbe12851e722fc85cfd4f48a9388002efced52bcf027f6dc4c525b095f3f953970e73928fdce3245ab4f9d13ae36b9d498
DIST coloredlogs-6.1.tar.gz 28057 BLAKE2B bbb5946db3e6cbfae0b9947d2aa29769858833e35213a44a5be4ceb434021ee8c583ff00c980b9ab4fc533f6fec80e151895097b6a87c44257ef0fd5c7ab0bab SHA512 834cf993e7ffd3328644d334912fcf5a5156a441c6184643b38e5f356d46d7b5c48e02ee1e1b432265052c7a5ab1071ba456e575217a4a762f8387131059c405
+EBUILD coloredlogs-10.0.ebuild 968 BLAKE2B e13edd601efe9c4d301706fd74a703476181f2d90f66225cb3dbc84de425f36f1a845ea9401a02e821a96ebd803ea3680e00af011faacbb8496b237ac99bfebf SHA512 cfbcbf80a0c0534e97cd30b99ba728d5c3e05847f2a8588fc8c2f4177bedfb54b1808922d32a600654ba2b9151f1c12ae64c5c5d5e9d08edd660f2e57399d442
EBUILD coloredlogs-6.1.ebuild 1224 BLAKE2B dd2629e708f1014b04c6bf5e7850aea32c3fe2311f9f5ed1585a5a2e7ca3e030d58cab595b53ef20b95c66b71917f9e799da159a3a6930288de3e75530007cde SHA512 9c69905531fad4d9370df1c6a98757cb6033ae42f2d20574b5f4b0a02df1740d0a3b87be6d22abcc29652f9be6ae9ab9664e5b535c7ea7b7aa9e1dd32c3f02ca
MISC metadata.xml 390 BLAKE2B 6f1ce9de711c22d533fd07fb56b62c6f30c78aea141f78b4946fd9400b6daaff70eec5334aad41b92ffc28829d9edb3f6ef1e2515ab5a18c7e139265043f8a98 SHA512 4df2d5312905b2be06239d81f2274ae4e6517f48d62ec54d5d755bb08cccaaece3531b391f45097590f039db10b8bcf6ff265a28506a0f8096f121fda85e498c
diff --git a/dev-python/coloredlogs/coloredlogs-10.0.ebuild b/dev-python/coloredlogs/coloredlogs-10.0.ebuild
new file mode 100644
index 000000000000..6c4a97d80c70
--- /dev/null
+++ b/dev-python/coloredlogs/coloredlogs-10.0.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+DISTUTILS_USE_SETUPTOOLS=rdepend
+
+inherit distutils-r1
+
+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/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="dev-python/humanfriendly[${PYTHON_USEDEP}]"
+
+DEPEND="test? (
+ dev-python/capturer[${PYTHON_USEDEP}]
+ dev-python/coverage[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/verboselogs[${PYTHON_USEDEP}] )"
+
+PATCHES="${FILESDIR}/${P}-skip-sandbox-violation-tests.patch"
+
+distutils_enable_sphinx docs
+distutils_enable_tests pytest
+
+python_test() {
+ pytest -vv ${PN}/tests.py || die "Tests fail with ${EPYTHON}"
+}
diff --git a/dev-python/coloredlogs/files/coloredlogs-10.0-skip-cli-test.patch b/dev-python/coloredlogs/files/coloredlogs-10.0-skip-cli-test.patch
new file mode 100644
index 000000000000..ba03612f7aeb
--- /dev/null
+++ b/dev-python/coloredlogs/files/coloredlogs-10.0-skip-cli-test.patch
@@ -0,0 +1,17 @@
+diff --git a/coloredlogs/tests.py b/coloredlogs/tests.py
+index 38f2d97..8d1ae36 100644
+--- a/coloredlogs/tests.py
++++ b/coloredlogs/tests.py
+@@ -503,12 +503,6 @@ class ColoredLogsTestCase(TestCase):
+ for name in 'debug', 'info', 'warning', 'error', 'critical':
+ assert name.upper() in output
+
+- def test_cli_conversion(self):
+- """Test the command line HTML conversion."""
+- output = main('coloredlogs', '--convert', 'coloredlogs', '--demo', capture=True)
+- # Make sure the output is encoded as HTML.
+- assert '<span' in output
+-
+ def test_empty_conversion(self):
+ """
+ Test that conversion of empty output produces no HTML.
diff --git a/dev-python/coloredlogs/files/coloredlogs-10.0-skip-sandbox-violation-tests.patch b/dev-python/coloredlogs/files/coloredlogs-10.0-skip-sandbox-violation-tests.patch
new file mode 100644
index 000000000000..dad047afd8d9
--- /dev/null
+++ b/dev-python/coloredlogs/files/coloredlogs-10.0-skip-sandbox-violation-tests.patch
@@ -0,0 +1,101 @@
+diff --git a/coloredlogs/tests.py b/coloredlogs/tests.py
+index 38f2d97..c4353f1 100644
+--- a/coloredlogs/tests.py
++++ b/coloredlogs/tests.py
+@@ -184,48 +184,6 @@ class ColoredLogsTestCase(TestCase):
+ # Make sure colored logging is disabled.
+ assert not isinstance(handler.formatter, ColoredFormatter)
+
+- def test_system_logging(self):
+- """Make sure the :class:`coloredlogs.syslog.SystemLogging` context manager works."""
+- system_log_file = self.find_system_log()
+- expected_message = random_string(50)
+- with SystemLogging(programname='coloredlogs-test-suite') as syslog:
+- if not syslog:
+- return self.skipTest("couldn't connect to syslog daemon")
+- # When I tried out the system logging support on macOS 10.13.1 on
+- # 2018-01-05 I found that while WARNING and ERROR messages show up
+- # in the system log DEBUG and INFO messages don't. This explains
+- # the importance of the level of the log message below.
+- logging.error("%s", expected_message)
+- # Retry the following assertion (for up to 60 seconds) to give the
+- # logging daemon time to write our log message to disk. This
+- # appears to be needed on MacOS workers on Travis CI, see:
+- # https://travis-ci.org/xolox/python-coloredlogs/jobs/325245853
+- retry(lambda: check_contents(system_log_file, expected_message, True))
+-
+- def test_syslog_shortcut_simple(self):
+- """Make sure that ``coloredlogs.install(syslog=True)`` works."""
+- system_log_file = self.find_system_log()
+- expected_message = random_string(50)
+- with cleanup_handlers():
+- # See test_system_logging() for the importance of this log level.
+- coloredlogs.install(syslog=True)
+- logging.error("%s", expected_message)
+- # See the comments in test_system_logging() on why this is retried.
+- retry(lambda: check_contents(system_log_file, expected_message, True))
+-
+- def test_syslog_shortcut_enhanced(self):
+- """Make sure that ``coloredlogs.install(syslog='warning')`` works."""
+- system_log_file = self.find_system_log()
+- the_expected_message = random_string(50)
+- not_an_expected_message = random_string(50)
+- with cleanup_handlers():
+- # See test_system_logging() for the importance of these log levels.
+- coloredlogs.install(syslog='error')
+- logging.warning("%s", not_an_expected_message)
+- logging.error("%s", the_expected_message)
+- # See the comments in test_system_logging() on why this is retried.
+- retry(lambda: check_contents(system_log_file, the_expected_message, True))
+- retry(lambda: check_contents(system_log_file, not_an_expected_message, False))
+
+ def test_name_normalization(self):
+ """Make sure :class:`~coloredlogs.NameNormalizer` works as intended."""
+@@ -369,34 +327,6 @@ class ColoredLogsTestCase(TestCase):
+ logging.info("This should be timestamped according to #45.")
+ assert re.match(r'^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+\d{4}\s', stream.getvalue())
+
+- def test_plain_text_output_format(self):
+- """Inspect the plain text output of coloredlogs."""
+- logger = VerboseLogger(random_string(25))
+- stream = StringIO()
+- install(level=logging.NOTSET, logger=logger, stream=stream)
+- # Test that filtering on severity works.
+- logger.setLevel(logging.INFO)
+- logger.debug("No one should see this message.")
+- assert len(stream.getvalue().strip()) == 0
+- # Test that the default output format looks okay in plain text.
+- logger.setLevel(logging.NOTSET)
+- for method, severity in ((logger.debug, 'DEBUG'),
+- (logger.info, 'INFO'),
+- (logger.verbose, 'VERBOSE'),
+- (logger.warning, 'WARNING'),
+- (logger.error, 'ERROR'),
+- (logger.critical, 'CRITICAL')):
+- # Prepare the text.
+- text = "This is a message with severity %r." % severity.lower()
+- # Log the message with the given severity.
+- method(text)
+- # Get the line of output generated by the handler.
+- output = stream.getvalue()
+- lines = output.splitlines()
+- last_line = lines[-1]
+- assert text in last_line
+- assert severity in last_line
+- assert PLAIN_TEXT_PATTERN.match(last_line)
+
+ def test_html_conversion(self):
+ """Check the conversion from ANSI escape sequences to HTML."""
+@@ -503,12 +433,6 @@ class ColoredLogsTestCase(TestCase):
+ for name in 'debug', 'info', 'warning', 'error', 'critical':
+ assert name.upper() in output
+
+- def test_cli_conversion(self):
+- """Test the command line HTML conversion."""
+- output = main('coloredlogs', '--convert', 'coloredlogs', '--demo', capture=True)
+- # Make sure the output is encoded as HTML.
+- assert '<span' in output
+-
+ def test_empty_conversion(self):
+ """
+ Test that conversion of empty output produces no HTML.