summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-03-26 13:51:06 +0100
committerMichał Górny <mgorny@gentoo.org>2024-03-26 13:51:45 +0100
commite7832613369bd45cc3e0d9ec92267b1d7cdf2c09 (patch)
tree1175feaf3aa8c017787dbea660e7bd85a8abbed0
parentmedia-libs/embree: mark as LTO-unsafe (diff)
downloadgentoo-e7832613369bd45cc3e0d9ec92267b1d7cdf2c09.tar.gz
gentoo-e7832613369bd45cc3e0d9ec92267b1d7cdf2c09.tar.bz2
gentoo-e7832613369bd45cc3e0d9ec92267b1d7cdf2c09.zip
dev-python/pymdown-extensions: Fix tests w/ markdown >= 3.6
Closes: https://bugs.gentoo.org/927812 Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--dev-python/pymdown-extensions/files/pymdown-extensions-10.7.1-md36.patch49
-rw-r--r--dev-python/pymdown-extensions/pymdown-extensions-10.7.1.ebuild5
2 files changed, 54 insertions, 0 deletions
diff --git a/dev-python/pymdown-extensions/files/pymdown-extensions-10.7.1-md36.patch b/dev-python/pymdown-extensions/files/pymdown-extensions-10.7.1-md36.patch
new file mode 100644
index 000000000000..5c914923e6cc
--- /dev/null
+++ b/dev-python/pymdown-extensions/files/pymdown-extensions-10.7.1-md36.patch
@@ -0,0 +1,49 @@
+From 509e93de0f4d6052ff017a543aff70eb354dc590 Mon Sep 17 00:00:00 2001
+From: Isaac Muse <faceless.shop@gmail.com>
+Date: Tue, 26 Mar 2024 06:40:11 -0600
+Subject: [PATCH] Fix SmartSymbols Toc test (#2344)
+
+Fixes #2343
+---
+ tests/test_extensions/test_smartsymbols.py | 24 +++++++++++++++++++++-
+ 1 file changed, 23 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test_extensions/test_smartsymbols.py b/tests/test_extensions/test_smartsymbols.py
+index b438fb7d7..1a8688f0c 100644
+--- a/tests/test_extensions/test_smartsymbols.py
++++ b/tests/test_extensions/test_smartsymbols.py
+@@ -1,6 +1,9 @@
+ """Test cases for SmartSymbols."""
+ from .. import util
+ import markdown
++from pymdownx.__meta__ import parse_version
++
++PYMD_3_6 = parse_version(markdown.__version__) >= (3, 6, 0)
+
+
+ class TestSmartSymbols(util.MdCase):
+@@ -139,4 +142,23 @@ def test_toc_tokens(self):
+
+ md = markdown.Markdown(extensions=['toc', 'pymdownx.smartsymbols'])
+ md.convert('# *Foo* =/= `bar`')
+- self.assertEqual(md.toc_tokens, [{'level': 1, 'id': 'foo-bar', 'name': 'Foo &ne; bar', 'children': []}])
++ self.assertEqual(
++ md.toc_tokens,
++ [
++ {
++ 'children': [],
++ 'data-toc-label': '',
++ 'html': '<em>Foo</em> &ne; <code>bar</code>',
++ 'id': 'foo-bar',
++ 'level': 1,
++ 'name': 'Foo &ne; bar'
++ }
++ ] if PYMD_3_6 else [
++ {
++ 'level': 1,
++ 'id': 'foo-bar',
++ 'name': 'Foo &ne; bar',
++ 'children': []
++ }
++ ]
++ )
diff --git a/dev-python/pymdown-extensions/pymdown-extensions-10.7.1.ebuild b/dev-python/pymdown-extensions/pymdown-extensions-10.7.1.ebuild
index 69a0a4e1cc22..b81baf88a509 100644
--- a/dev-python/pymdown-extensions/pymdown-extensions-10.7.1.ebuild
+++ b/dev-python/pymdown-extensions/pymdown-extensions-10.7.1.ebuild
@@ -32,6 +32,11 @@ BDEPEND="
distutils_enable_tests pytest
src_prepare() {
+ local PATCHES=(
+ # https://github.com/facelessuser/pymdown-extensions/issues/2343
+ "${FILESDIR}/${P}-md36.patch"
+ )
+
# broken on pypy3; unfortunately, the parametrization is based
# on indexes and these are pretty random, so we need to remove it
# entirely