Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/coloredlogs/, dev-python/coloredlogs/files/
Date: Thu, 23 Jan 2020 09:53:43
Message-Id: 1579773198.55553ee04ae97b8aabf8c061aff3c44be7cb8313.juippis@gentoo
1 commit: 55553ee04ae97b8aabf8c061aff3c44be7cb8313
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
3 AuthorDate: Wed Jan 15 08:45:23 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 23 09:53:18 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55553ee0
7
8 dev-python/coloredlogs: Version bump 10.0 and add py3_7
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>
12 Closes: https://github.com/gentoo/gentoo/pull/14342
13 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
14
15 dev-python/coloredlogs/Manifest | 1 +
16 dev-python/coloredlogs/coloredlogs-10.0.ebuild | 38 ++++++++
17 .../files/coloredlogs-10.0-skip-cli-test.patch | 17 ++++
18 ...redlogs-10.0-skip-sandbox-violation-tests.patch | 101 +++++++++++++++++++++
19 4 files changed, 157 insertions(+)
20
21 diff --git a/dev-python/coloredlogs/Manifest b/dev-python/coloredlogs/Manifest
22 index ba1aee5cbbc..004a6b8528b 100644
23 --- a/dev-python/coloredlogs/Manifest
24 +++ b/dev-python/coloredlogs/Manifest
25 @@ -1 +1,2 @@
26 +DIST coloredlogs-10.0.tar.gz 273273 BLAKE2B 775b12718d780da396d74c7f960cdbbd4858c793bf3eefb53d29e9f6b415f682110ae2c7ac631be230578946a2fab8d75e0c3aa487ccd952bb05443f0a85700c SHA512 f4a51fd8fa92ea4e2ef0b58305dcc4bbe12851e722fc85cfd4f48a9388002efced52bcf027f6dc4c525b095f3f953970e73928fdce3245ab4f9d13ae36b9d498
27 DIST coloredlogs-6.1.tar.gz 28057 BLAKE2B bbb5946db3e6cbfae0b9947d2aa29769858833e35213a44a5be4ceb434021ee8c583ff00c980b9ab4fc533f6fec80e151895097b6a87c44257ef0fd5c7ab0bab SHA512 834cf993e7ffd3328644d334912fcf5a5156a441c6184643b38e5f356d46d7b5c48e02ee1e1b432265052c7a5ab1071ba456e575217a4a762f8387131059c405
28
29 diff --git a/dev-python/coloredlogs/coloredlogs-10.0.ebuild b/dev-python/coloredlogs/coloredlogs-10.0.ebuild
30 new file mode 100644
31 index 00000000000..6c4a97d80c7
32 --- /dev/null
33 +++ b/dev-python/coloredlogs/coloredlogs-10.0.ebuild
34 @@ -0,0 +1,38 @@
35 +# Copyright 1999-2020 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +PYTHON_COMPAT=( python3_{6,7,8} )
41 +
42 +DISTUTILS_USE_SETUPTOOLS=rdepend
43 +
44 +inherit distutils-r1
45 +
46 +DESCRIPTION="Colored stream handler for the logging module"
47 +HOMEPAGE="
48 + https://pypi.org/project/coloredlogs/
49 + https://github.com/xolox/python-coloredlogs
50 + https://coloredlogs.readthedocs.io/en/latest/"
51 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
52 +
53 +LICENSE="MIT"
54 +SLOT="0"
55 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
56 +
57 +RDEPEND="dev-python/humanfriendly[${PYTHON_USEDEP}]"
58 +
59 +DEPEND="test? (
60 + dev-python/capturer[${PYTHON_USEDEP}]
61 + dev-python/coverage[${PYTHON_USEDEP}]
62 + dev-python/mock[${PYTHON_USEDEP}]
63 + dev-python/verboselogs[${PYTHON_USEDEP}] )"
64 +
65 +PATCHES="${FILESDIR}/${P}-skip-sandbox-violation-tests.patch"
66 +
67 +distutils_enable_sphinx docs
68 +distutils_enable_tests pytest
69 +
70 +python_test() {
71 + pytest -vv ${PN}/tests.py || die "Tests fail with ${EPYTHON}"
72 +}
73
74 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
75 new file mode 100644
76 index 00000000000..ba03612f7ae
77 --- /dev/null
78 +++ b/dev-python/coloredlogs/files/coloredlogs-10.0-skip-cli-test.patch
79 @@ -0,0 +1,17 @@
80 +diff --git a/coloredlogs/tests.py b/coloredlogs/tests.py
81 +index 38f2d97..8d1ae36 100644
82 +--- a/coloredlogs/tests.py
83 ++++ b/coloredlogs/tests.py
84 +@@ -503,12 +503,6 @@ class ColoredLogsTestCase(TestCase):
85 + for name in 'debug', 'info', 'warning', 'error', 'critical':
86 + assert name.upper() in output
87 +
88 +- def test_cli_conversion(self):
89 +- """Test the command line HTML conversion."""
90 +- output = main('coloredlogs', '--convert', 'coloredlogs', '--demo', capture=True)
91 +- # Make sure the output is encoded as HTML.
92 +- assert '<span' in output
93 +-
94 + def test_empty_conversion(self):
95 + """
96 + Test that conversion of empty output produces no HTML.
97
98 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
99 new file mode 100644
100 index 00000000000..dad047afd8d
101 --- /dev/null
102 +++ b/dev-python/coloredlogs/files/coloredlogs-10.0-skip-sandbox-violation-tests.patch
103 @@ -0,0 +1,101 @@
104 +diff --git a/coloredlogs/tests.py b/coloredlogs/tests.py
105 +index 38f2d97..c4353f1 100644
106 +--- a/coloredlogs/tests.py
107 ++++ b/coloredlogs/tests.py
108 +@@ -184,48 +184,6 @@ class ColoredLogsTestCase(TestCase):
109 + # Make sure colored logging is disabled.
110 + assert not isinstance(handler.formatter, ColoredFormatter)
111 +
112 +- def test_system_logging(self):
113 +- """Make sure the :class:`coloredlogs.syslog.SystemLogging` context manager works."""
114 +- system_log_file = self.find_system_log()
115 +- expected_message = random_string(50)
116 +- with SystemLogging(programname='coloredlogs-test-suite') as syslog:
117 +- if not syslog:
118 +- return self.skipTest("couldn't connect to syslog daemon")
119 +- # When I tried out the system logging support on macOS 10.13.1 on
120 +- # 2018-01-05 I found that while WARNING and ERROR messages show up
121 +- # in the system log DEBUG and INFO messages don't. This explains
122 +- # the importance of the level of the log message below.
123 +- logging.error("%s", expected_message)
124 +- # Retry the following assertion (for up to 60 seconds) to give the
125 +- # logging daemon time to write our log message to disk. This
126 +- # appears to be needed on MacOS workers on Travis CI, see:
127 +- # https://travis-ci.org/xolox/python-coloredlogs/jobs/325245853
128 +- retry(lambda: check_contents(system_log_file, expected_message, True))
129 +-
130 +- def test_syslog_shortcut_simple(self):
131 +- """Make sure that ``coloredlogs.install(syslog=True)`` works."""
132 +- system_log_file = self.find_system_log()
133 +- expected_message = random_string(50)
134 +- with cleanup_handlers():
135 +- # See test_system_logging() for the importance of this log level.
136 +- coloredlogs.install(syslog=True)
137 +- logging.error("%s", expected_message)
138 +- # See the comments in test_system_logging() on why this is retried.
139 +- retry(lambda: check_contents(system_log_file, expected_message, True))
140 +-
141 +- def test_syslog_shortcut_enhanced(self):
142 +- """Make sure that ``coloredlogs.install(syslog='warning')`` works."""
143 +- system_log_file = self.find_system_log()
144 +- the_expected_message = random_string(50)
145 +- not_an_expected_message = random_string(50)
146 +- with cleanup_handlers():
147 +- # See test_system_logging() for the importance of these log levels.
148 +- coloredlogs.install(syslog='error')
149 +- logging.warning("%s", not_an_expected_message)
150 +- logging.error("%s", the_expected_message)
151 +- # See the comments in test_system_logging() on why this is retried.
152 +- retry(lambda: check_contents(system_log_file, the_expected_message, True))
153 +- retry(lambda: check_contents(system_log_file, not_an_expected_message, False))
154 +
155 + def test_name_normalization(self):
156 + """Make sure :class:`~coloredlogs.NameNormalizer` works as intended."""
157 +@@ -369,34 +327,6 @@ class ColoredLogsTestCase(TestCase):
158 + logging.info("This should be timestamped according to #45.")
159 + assert re.match(r'^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+\d{4}\s', stream.getvalue())
160 +
161 +- def test_plain_text_output_format(self):
162 +- """Inspect the plain text output of coloredlogs."""
163 +- logger = VerboseLogger(random_string(25))
164 +- stream = StringIO()
165 +- install(level=logging.NOTSET, logger=logger, stream=stream)
166 +- # Test that filtering on severity works.
167 +- logger.setLevel(logging.INFO)
168 +- logger.debug("No one should see this message.")
169 +- assert len(stream.getvalue().strip()) == 0
170 +- # Test that the default output format looks okay in plain text.
171 +- logger.setLevel(logging.NOTSET)
172 +- for method, severity in ((logger.debug, 'DEBUG'),
173 +- (logger.info, 'INFO'),
174 +- (logger.verbose, 'VERBOSE'),
175 +- (logger.warning, 'WARNING'),
176 +- (logger.error, 'ERROR'),
177 +- (logger.critical, 'CRITICAL')):
178 +- # Prepare the text.
179 +- text = "This is a message with severity %r." % severity.lower()
180 +- # Log the message with the given severity.
181 +- method(text)
182 +- # Get the line of output generated by the handler.
183 +- output = stream.getvalue()
184 +- lines = output.splitlines()
185 +- last_line = lines[-1]
186 +- assert text in last_line
187 +- assert severity in last_line
188 +- assert PLAIN_TEXT_PATTERN.match(last_line)
189 +
190 + def test_html_conversion(self):
191 + """Check the conversion from ANSI escape sequences to HTML."""
192 +@@ -503,12 +433,6 @@ class ColoredLogsTestCase(TestCase):
193 + for name in 'debug', 'info', 'warning', 'error', 'critical':
194 + assert name.upper() in output
195 +
196 +- def test_cli_conversion(self):
197 +- """Test the command line HTML conversion."""
198 +- output = main('coloredlogs', '--convert', 'coloredlogs', '--demo', capture=True)
199 +- # Make sure the output is encoded as HTML.
200 +- assert '<span' in output
201 +-
202 + def test_empty_conversion(self):
203 + """
204 + Test that conversion of empty output produces no HTML.