From 6bf575618cf9022e99cbfcc64036fd9db79a749c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 5 Dec 2023 17:02:59 +0000 Subject: gentoo auto-resync : 05:12:2023 - 17:02:58 --- dev-python/ansible-pygments/Manifest | 4 +- .../ansible-pygments-0.1.1-r1.ebuild | 7 +- ...ents-0.1.1-make_lexer_test_compare_tokens.patch | 324 +++++++++++++++++++++ ...ansible-pygments-0.1.1-tests_pygments2_14.patch | 75 ----- 4 files changed, 329 insertions(+), 81 deletions(-) create mode 100644 dev-python/ansible-pygments/files/ansible-pygments-0.1.1-make_lexer_test_compare_tokens.patch delete mode 100644 dev-python/ansible-pygments/files/ansible-pygments-0.1.1-tests_pygments2_14.patch (limited to 'dev-python/ansible-pygments') diff --git a/dev-python/ansible-pygments/Manifest b/dev-python/ansible-pygments/Manifest index ac9b4d50b6bc..8a95ba3f4878 100644 --- a/dev-python/ansible-pygments/Manifest +++ b/dev-python/ansible-pygments/Manifest @@ -1,4 +1,4 @@ -AUX ansible-pygments-0.1.1-tests_pygments2_14.patch 4663 BLAKE2B f198da4ffccc4acc7d64397e9e654407cff934a8764054154775c5e5208503096270a35fb712daeb2ff0d834b9638ffaab2f3fee3bbe5d902fde48e1de53a3ea SHA512 0ced02d842fac488a37015503bb1fe163bfe842f20717374ca5b87319e5f80bee6da11b0eef7c311cd750c89248ab5a92a44f402cd0b3fcedd86d26ac9d28679 +AUX ansible-pygments-0.1.1-make_lexer_test_compare_tokens.patch 14695 BLAKE2B c7af16a0b1dbcb5c4c2bb7626c3e3ff815ebd16e0ca920d063eeec4b9202bb6ac72881b703ac18c3cd2bcbd2dca900da3755ffa62f609d88d870982fc0b56be4 SHA512 603742386cdebcaccc87c5a53924c8cda4742f4327e07df8719696cde1af9a9b0a33e29016a1a6f626a73c003cde4156013049c2deeb0d1efb2c27a154492f48 DIST ansible-pygments-0.1.1.tar.gz 8446 BLAKE2B ff631dd24c723035db7ab11a6c3fc0c90e8cebd72e6b0fa0d8b2c4bc4250ff5fb1e4180366e4ee084aab90bf24a8c3b2ecfad2c421b9f0cfdbf7675c94f0fcf7 SHA512 1ad2f4568d46d7fc617c6e674bcd9aea48e14307d91c476b51a04f778b452f18cb983d87d4872664d567b984193edee2af7964854fb2f3ae37ab4bce09c387d4 -EBUILD ansible-pygments-0.1.1-r1.ebuild 592 BLAKE2B 983c8afe8dee6d4b7beac1c14ffa1d0e82be44561da4a9d04858e1c934052e61d5659b332546de0679091eb7d21dd9fd7bf53f5f800e0a6f5b7ac277019da760 SHA512 ab6f663193f1634e456df79bc1430e5617d9344890e758f1d72994d618ce4d7e78106dfdcb7ea2d92a43e24c975d1bbbf150b0e70384d6f3e23382b2873359b3 +EBUILD ansible-pygments-0.1.1-r1.ebuild 552 BLAKE2B f6c75289068022b9bc5d388c3781d68b70ab486e20d85a0cb0b461e7c8b70c6654566dd881499cd4c0c65cd71fc33d5debf8d3340214ef6af0fc2913f3783a36 SHA512 f4c7aefd5d8e6daf4b4e4b0f1c79c8de912d2e9d6b45108d4a51658ca42c96a695b06e468661295adde3c9d30b67ef4104b9e76b8c51e19b926c51656658b970 MISC metadata.xml 786 BLAKE2B 5883f03ffc7b0850bc8ecc90c91a15a9498ced9ee196a4f8d2a97a77a41957cb05a40ebf671ddbdf226886b94e9a5e796376094924712544a07559e0858aa5a8 SHA512 c7736962fe565be524294a30630e7cfd2820d1e9ace6f6dbd307ad46a252947ce368057d5ea5d20889a5ccdbb7f3418496affad5f8ed345e0e0808bd4abbe4ed diff --git a/dev-python/ansible-pygments/ansible-pygments-0.1.1-r1.ebuild b/dev-python/ansible-pygments/ansible-pygments-0.1.1-r1.ebuild index acf6231a5358..ccaf7b22ee7a 100644 --- a/dev-python/ansible-pygments/ansible-pygments-0.1.1-r1.ebuild +++ b/dev-python/ansible-pygments/ansible-pygments-0.1.1-r1.ebuild @@ -3,7 +3,7 @@ EAPI=8 -PYTHON_COMPAT=( python3_{9..11} ) +PYTHON_COMPAT=( python3_{10..12} ) DISTUTILS_USE_PEP517="poetry" PYPI_NO_NORMALIZE=1 @@ -16,11 +16,10 @@ LICENSE="MIT" SLOT="0" KEYWORDS="amd64 ~riscv" -# 2.14.0+ needed in order for tests to pass -RDEPEND=">=dev-python/pygments-2.14.0[${PYTHON_USEDEP}]" +RDEPEND="dev-python/pygments[${PYTHON_USEDEP}]" PATCHES=( - "${FILESDIR}"/${PN}-0.1.1-tests_pygments2_14.patch + "${FILESDIR}"/${PN}-0.1.1-make_lexer_test_compare_tokens.patch ) distutils_enable_tests pytest diff --git a/dev-python/ansible-pygments/files/ansible-pygments-0.1.1-make_lexer_test_compare_tokens.patch b/dev-python/ansible-pygments/files/ansible-pygments-0.1.1-make_lexer_test_compare_tokens.patch new file mode 100644 index 000000000000..41ce8a5c2314 --- /dev/null +++ b/dev-python/ansible-pygments/files/ansible-pygments-0.1.1-make_lexer_test_compare_tokens.patch @@ -0,0 +1,324 @@ +Backported upstream patch 179c74e9f1a5dc870dec6d4db6cab60d2dca1ed2 + +--- a/tests/lexer_test.py ++++ b/tests/lexer_test.py +@@ -1,26 +1,24 @@ + # Author: Felix Fontein + # License: BSD-2-Clause + # Copyright: Felix Fontein , 2021 +-"""Tests for Pygments lexers.""" ++"""Tests for Pygments lexers. + +-from pygments import highlight +-# pylint: disable=no-name-in-module +-# Ref: https://github.com/PyCQA/pylint/issues/491 +-from pygments.formatters import HtmlFormatter +- +-from ansible_pygments.lexers import AnsibleOutputLexer ++They rely on token comparison for stability reasons. Relying on ++additional style formatting is known to break with updates to ++the pygments library itself. ++""" + ++from pygments import __version__ as _pygments_version ++from pygments.lexers import get_lexer_by_name as _get_lexer_by_name ++from pygments.token import Token + +-def run_test(data, lexer): +- """Format the data snippet as HTML using a given lexer.""" +- formatter = HtmlFormatter() +- result = highlight(data, lexer, formatter) +- return formatter.get_style_defs('.highlight'), result ++PYGMENTS_VERSION_INFO = tuple(map(int, _pygments_version.split('.'))) ++IS_OLD_PYGMENTS_PRE_2_14 = PYGMENTS_VERSION_INFO <= (2, 14, 0) + + + def test_ansible_output_lexer(): +- """Test that AnsibleOutputLexer produces expected HTML output.""" +- data = R""" ++ """Test that ``AnsibleOutputLexer`` produces expected tokens.""" ++ ansible_play_output_example = R""" + ok: [windows] => { + "account": { + "account_name": "vagrant-domain", +@@ -71,58 +69,226 @@ + + changed: [localhost] + """ +- _, result = run_test(data, AnsibleOutputLexer()) +- print(result) + +- # pylint: disable=line-too-long +- assert result == R"""
ok: [windows] => {
+-    "account": {
+-        "account_name": "vagrant-domain",
+-        "type": "User"
+-    },
+-    "authentication_package": "Kerberos",
+-    "user_flags": []
+-}
+-
+-TASK [paused] ************************************************************************************************************************************
+-Sunday 11 November 2018  20:16:48 +0100 (0:00:00.041)       0:07:59.637 *******
+---- before
+-+++ after
+-@@ -1,5 +1,5 @@
+- {
+--  "exists": false,
+--  "paused": false,
+--  "running": false
+-+  "exists": true,
+-+  "paused": true,
+-+  "running": true
+- }
+-\ No newline at end of file
+-
+-changed: [localhost]
+-
+-TASK [volumes (more volumes)] ********************************************************************************************************************
+-Sunday 11 November 2018  20:19:25 +0100 (0:00:00.607)       0:10:36.974 *******
+---- before
+-+++ after
+-@@ -1,11 +1,11 @@
+- {
+-   "expected_binds": [
+--    "/tmp:/tmp:rw",
+--    "/:/whatever:rw,z"
+-+    "/tmp:/somewhereelse:ro,Z",
+-+    "/tmp:/tmp:rw"
+-   ],
+-   "expected_volumes": {
+--    "/tmp": {},
+--    "/whatever": {}
+-+    "/somewhereelse": {},
+-+    "/tmp": {}
+-   },
+-   "running": true
+- }
+-\ No newline at end of file
+-
+-changed: [localhost]
+-
+-""" ++ expected_resulting_text_tokens = [ ++ (0, Token.Text.Whitespace, '\n'), ++ (1, Token.Keyword, 'ok'), ++ (3, Token.Punctuation, ':'), ++ (4, Token.Text, ' '), ++ (5, Token.Punctuation, '['), ++ (6, Token.Name.Variable, 'windows'), ++ (13, Token.Punctuation, ']'), ++ (14, Token.Text, ' '), ++ (15, Token.Punctuation, '=>'), ++ (17, Token.Text, ' '), ++ (18, Token.Punctuation, '{'), ++ (19, Token.Text, '\n '), ++ (24, Token.Name.Tag, '"account"'), ++ (33, Token.Punctuation, ':'), ++ (34, Token.Text, ' '), ++ (35, Token.Punctuation, '{'), ++ (36, Token.Text, '\n '), ++ (45, Token.Name.Tag, '"account_name"'), ++ (59, Token.Punctuation, ':'), ++ (60, Token.Text, ' '), ++ (61, Token.Literal.String, '"vagrant-domain"'), ++ (77, Token.Punctuation, ','), ++ (78, Token.Text, '\n '), ++ (87, Token.Name.Tag, '"type"'), ++ (93, Token.Punctuation, ':'), ++ (94, Token.Text, ' '), ++ (95, Token.Literal.String, '"User"'), ++ (101, Token.Text, '\n '), ++ (106, Token.Punctuation, '}'), ++ (107, Token.Punctuation, ','), ++ (108, Token.Text, '\n '), ++ (113, Token.Name.Tag, '"authentication_package"'), ++ (137, Token.Punctuation, ':'), ++ (138, Token.Text, ' '), ++ (139, Token.Literal.String, '"Kerberos"'), ++ (149, Token.Punctuation, ','), ++ (150, Token.Text, '\n '), ++ (155, Token.Name.Tag, '"user_flags"'), ++ (167, Token.Punctuation, ':'), ++ (168, Token.Text, ' '), ++ (169, Token.Punctuation, '['), ++ (170, Token.Punctuation, ']'), ++ (171, Token.Text, '\n'), ++ (172, Token.Punctuation, '}'), ++ (173, Token.Text, '\n'), ++ (174, Token.Text.Whitespace, '\n'), ++ (175, Token.Keyword, 'TASK'), ++ (179, Token.Text, ' '), ++ (180, Token.Punctuation, '['), ++ (181, Token.Literal, 'paused'), ++ (187, Token.Punctuation, ']'), ++ (188, Token.Text, ' '), ++ ( ++ 189, ++ Token.Name.Variable, ++ '*' * 132, ++ ), ++ (321, Token.Text, '\n'), ++ *( ++ ( ++ ( ++ 322, ++ Token.Text.Whitespace, ++ 'Sunday 11 November 2018 20:16:48 +0100 (0:00:00.041) ' ++ '0:07:59.637 *******\n', ++ ), ++ ) if IS_OLD_PYGMENTS_PRE_2_14 else ( ++ ( ++ 322, ++ Token.Text, ++ 'Sunday 11 November 2018 20:16:48 +0100 (0:00:00.041) ' ++ '0:07:59.637 *******', ++ ), ++ (401, Token.Text.Whitespace, '\n'), ++ ) ++ ), ++ (402, Token.Generic.Deleted, '--- before'), ++ (412, Token.Text.Whitespace, '\n'), ++ (413, Token.Generic.Inserted, '+++ after'), ++ (422, Token.Text.Whitespace, '\n'), ++ (423, Token.Generic.Subheading, '@@ -1,5 +1,5 @@'), ++ (438, Token.Text.Whitespace, '\n'), ++ (439, Token.Text.Whitespace, ' '), ++ (440, Token.Text, '{'), ++ (441, Token.Text.Whitespace, '\n'), ++ (442, Token.Generic.Deleted, '- "exists": false,'), ++ (461, Token.Text.Whitespace, '\n'), ++ (462, Token.Generic.Deleted, '- "paused": false,'), ++ (481, Token.Text.Whitespace, '\n'), ++ (482, Token.Generic.Deleted, '- "running": false'), ++ (501, Token.Text.Whitespace, '\n'), ++ (502, Token.Generic.Inserted, '+ "exists": true,'), ++ (520, Token.Text.Whitespace, '\n'), ++ (521, Token.Generic.Inserted, '+ "paused": true,'), ++ (539, Token.Text.Whitespace, '\n'), ++ (540, Token.Generic.Inserted, '+ "running": true'), ++ (558, Token.Text.Whitespace, '\n'), ++ (559, Token.Text.Whitespace, ' '), ++ (560, Token.Text, '}'), ++ (561, Token.Text.Whitespace, '\n'), ++ *( ++ ( ++ ( ++ 562, ++ Token.Text.Whitespace, ++ '\\ No newline at end of file\n', ++ ), ++ ) if IS_OLD_PYGMENTS_PRE_2_14 else ( ++ (562, Token.Text, '\\ No newline at end of file'), ++ (589, Token.Text.Whitespace, '\n'), ++ ) ++ ), ++ (590, Token.Text.Whitespace, '\n'), ++ (591, Token.Keyword, 'changed'), ++ (598, Token.Punctuation, ':'), ++ (599, Token.Text, ' '), ++ (600, Token.Punctuation, '['), ++ (601, Token.Name.Variable, 'localhost'), ++ (610, Token.Punctuation, ']'), ++ (611, Token.Text, '\n'), ++ (612, Token.Text.Whitespace, '\n'), ++ (613, Token.Keyword, 'TASK'), ++ (617, Token.Text, ' '), ++ (618, Token.Punctuation, '['), ++ (619, Token.Literal, 'volumes (more volumes)'), ++ (641, Token.Punctuation, ']'), ++ (642, Token.Text, ' '), ++ ( ++ 643, ++ Token.Name.Variable, ++ '*' * 116, ++ ), ++ (759, Token.Text, '\n'), ++ *( ++ ( ++ ( ++ 760, ++ Token.Text.Whitespace, ++ 'Sunday 11 November 2018 20:19:25 +0100 (0:00:00.607) ' ++ '0:10:36.974 *******\n', ++ ), ++ ) if IS_OLD_PYGMENTS_PRE_2_14 else ( ++ ( ++ 760, ++ Token.Text, ++ 'Sunday 11 November 2018 20:19:25 +0100 (0:00:00.607) ' ++ '0:10:36.974 *******', ++ ), ++ (839, Token.Text.Whitespace, '\n'), ++ ) ++ ), ++ (840, Token.Generic.Deleted, '--- before'), ++ (850, Token.Text.Whitespace, '\n'), ++ (851, Token.Generic.Inserted, '+++ after'), ++ (860, Token.Text.Whitespace, '\n'), ++ (861, Token.Generic.Subheading, '@@ -1,11 +1,11 @@'), ++ (878, Token.Text.Whitespace, '\n'), ++ (879, Token.Text.Whitespace, ' '), ++ (880, Token.Text, '{'), ++ (881, Token.Text.Whitespace, '\n'), ++ (882, Token.Text.Whitespace, ' '), ++ (883, Token.Text, ' "expected_binds": ['), ++ (904, Token.Text.Whitespace, '\n'), ++ (905, Token.Generic.Deleted, '- "/tmp:/tmp:rw",'), ++ (925, Token.Text.Whitespace, '\n'), ++ (926, Token.Generic.Deleted, '- "/:/whatever:rw,z"'), ++ (949, Token.Text.Whitespace, '\n'), ++ (950, Token.Generic.Inserted, '+ "/tmp:/somewhereelse:ro,Z",'), ++ (982, Token.Text.Whitespace, '\n'), ++ (983, Token.Generic.Inserted, '+ "/tmp:/tmp:rw"'), ++ (1002, Token.Text.Whitespace, '\n'), ++ (1003, Token.Text.Whitespace, ' '), ++ (1004, Token.Text, ' ],'), ++ (1008, Token.Text.Whitespace, '\n'), ++ (1009, Token.Text.Whitespace, ' '), ++ (1010, Token.Text, ' "expected_volumes": {'), ++ (1033, Token.Text.Whitespace, '\n'), ++ (1034, Token.Generic.Deleted, '- "/tmp": {},'), ++ (1050, Token.Text.Whitespace, '\n'), ++ (1051, Token.Generic.Deleted, '- "/whatever": {}'), ++ (1071, Token.Text.Whitespace, '\n'), ++ (1072, Token.Generic.Inserted, '+ "/somewhereelse": {},'), ++ (1098, Token.Text.Whitespace, '\n'), ++ (1099, Token.Generic.Inserted, '+ "/tmp": {}'), ++ (1114, Token.Text.Whitespace, '\n'), ++ (1115, Token.Text.Whitespace, ' '), ++ (1116, Token.Text, ' },'), ++ (1120, Token.Text.Whitespace, '\n'), ++ (1121, Token.Text.Whitespace, ' '), ++ (1122, Token.Text, ' "running": true'), ++ (1139, Token.Text.Whitespace, '\n'), ++ (1140, Token.Text.Whitespace, ' '), ++ (1141, Token.Text, '}'), ++ (1142, Token.Text.Whitespace, '\n'), ++ *( ++ ( ++ ( ++ 1143, ++ Token.Text.Whitespace, ++ '\\ No newline at end of file\n', ++ ), ++ ) if IS_OLD_PYGMENTS_PRE_2_14 else ( ++ (1143, Token.Text, '\\ No newline at end of file'), ++ (1170, Token.Text.Whitespace, '\n'), ++ ) ++ ), ++ (1171, Token.Text.Whitespace, '\n'), ++ (1172, Token.Keyword, 'changed'), ++ (1179, Token.Punctuation, ':'), ++ (1180, Token.Text, ' '), ++ (1181, Token.Punctuation, '['), ++ (1182, Token.Name.Variable, 'localhost'), ++ (1191, Token.Punctuation, ']'), ++ (1192, Token.Text, '\n'), ++ ] ++ ++ unprocessed_text_tokens = list( ++ _get_lexer_by_name('ansible-output'). ++ get_tokens_unprocessed(ansible_play_output_example), ++ ) ++ assert unprocessed_text_tokens == expected_resulting_text_tokens diff --git a/dev-python/ansible-pygments/files/ansible-pygments-0.1.1-tests_pygments2_14.patch b/dev-python/ansible-pygments/files/ansible-pygments-0.1.1-tests_pygments2_14.patch deleted file mode 100644 index d58a13256ac5..000000000000 --- a/dev-python/ansible-pygments/files/ansible-pygments-0.1.1-tests_pygments2_14.patch +++ /dev/null @@ -1,75 +0,0 @@ -Backported upstream commit 0ddab3516217ac2067b6e980f5b2a6b2ac1be3fa - ---- a/tests/lexer_test.py -+++ b/tests/lexer_test.py -@@ -86,41 +86,41 @@ def test_ansible_output_lexer(): - - TASK [paused] ************************************************************************************************************************************ - Sunday 11 November 2018 20:16:48 +0100 (0:00:00.041) 0:07:59.637 ******* ----- before --+++ after --@@ -1,5 +1,5 @@ -- { --- "exists": false, --- "paused": false, --- "running": false --+ "exists": true, --+ "paused": true, --+ "running": true -- } -+--- before -++++ after -+@@ -1,5 +1,5 @@ -+ { -+- "exists": false, -+- "paused": false, -+- "running": false -++ "exists": true, -++ "paused": true, -++ "running": true -+ } - \ No newline at end of file - - changed: [localhost] - - TASK [volumes (more volumes)] ******************************************************************************************************************** - Sunday 11 November 2018 20:19:25 +0100 (0:00:00.607) 0:10:36.974 ******* ----- before --+++ after --@@ -1,11 +1,11 @@ -- { -- "expected_binds": [ --- "/tmp:/tmp:rw", --- "/:/whatever:rw,z" --+ "/tmp:/somewhereelse:ro,Z", --+ "/tmp:/tmp:rw" -- ], -- "expected_volumes": { --- "/tmp": {}, --- "/whatever": {} --+ "/somewhereelse": {}, --+ "/tmp": {} -- }, -- "running": true -- } -+--- before -++++ after -+@@ -1,11 +1,11 @@ -+ { -+ "expected_binds": [ -+- "/tmp:/tmp:rw", -+- "/:/whatever:rw,z" -++ "/tmp:/somewhereelse:ro,Z", -++ "/tmp:/tmp:rw" -+ ], -+ "expected_volumes": { -+- "/tmp": {}, -+- "/whatever": {} -++ "/somewhereelse": {}, -++ "/tmp": {} -+ }, -+ "running": true -+ } - \ No newline at end of file - - changed: [localhost] -- cgit v1.2.3