summaryrefslogtreecommitdiff
path: root/app-text/restview
diff options
context:
space:
mode:
Diffstat (limited to 'app-text/restview')
-rw-r--r--app-text/restview/Manifest5
-rw-r--r--app-text/restview/files/restview-3.0.1-test-fixes.patch171
-rw-r--r--app-text/restview/restview-3.0.1.ebuild (renamed from app-text/restview/restview-3.0.0.ebuild)8
3 files changed, 180 insertions, 4 deletions
diff --git a/app-text/restview/Manifest b/app-text/restview/Manifest
index 225ab27239c7..b48d08d4dadc 100644
--- a/app-text/restview/Manifest
+++ b/app-text/restview/Manifest
@@ -1,3 +1,4 @@
-DIST restview-3.0.0.tar.gz 49774 BLAKE2B 21a8a25964b995287ce8c584424eae8db5d6190ebf60a435a9af50a9995083fba61d5ccd1a06b1eb193590bc68219f98298a4773fab565bd711cca1eacd8149b SHA512 55b053f03964eb637245810894e970e16a3d1be4587e44802410afbb5c046921e7f3c07825e4f7889569d2f7a980f0a320835d0c2994bb5df0d66c3ebcffc797
-EBUILD restview-3.0.0.ebuild 574 BLAKE2B 64d16f5ded10739b965fb74eca9b9662e002537beecc2a54476fbf6bf16a3ce8a1f5807777e13498b84aa9cb7fe38f531df460115bbfa8615797313f76e9f274 SHA512 15f1bd6666ee1ed0d27161da5963cd03ced5e4baa4a5facc0d61a928753ffcacbec2b2a65f472d6c71c229843bb276062bace86761d469097a20c747360389f7
+AUX restview-3.0.1-test-fixes.patch 6546 BLAKE2B 6beb109b1ec2814288e79ae424f8eee79dc1a771633eaf18e2173820862835203b502e2e107008d1333341621a4b5e10da91fac41c6dfc23b3318a69e792c1c6 SHA512 c7bf15dc96b973b26a8d8ddf9b65bb202eda0a5a3bc2cf4a726926db2fb473f9895bd8e9f43b06b2b42b30c7f94a9e73a51233c0a7e297993731657916e789f4
+DIST restview-3.0.1.tar.gz 49922 BLAKE2B 1a216442c8b9b1325cdcfea3e1de003333b805e5bae534142dcf136f08163a353629e05a886b127e205616b49411f64d29c96cb1d47a8c070de75a500de76853 SHA512 bf45e962b57b5703bd13edfd485e99ea59c0ea8b5f5a9cbb7b3d1c75939387b57ce5b0d88c5cbaa28b967e920139b03d299c256f48254e63837e60c8c828dea3
+EBUILD restview-3.0.1.ebuild 624 BLAKE2B 631078e42994ca0aba5a877568fa6fbdb2dca7af01861282bff741acf6dac14aca3a958a462cc3117550e384891a792e1cdae79b1e5d16f77a1e06f1ba849eb1 SHA512 c54f8f69aecc40ec1778cc56504eddd7d03e2fbd6fbb3324bc692ed9809ca5ecf495b1813f88508d058124b1c5a80f20f376a4aa2fffd32d2051e31c6626ac95
MISC metadata.xml 295 BLAKE2B f50260f0437974897d227dae55ad1ff3e9b42ba20aa031a36199eca055cde73081655ddfa1456d0accc0dd75a8dfb8d31af7dae1af98acc8126e21198ee70333 SHA512 becbf06fec999f5cc5a0a18494d793c8c68cb31c33396b0a47de4bd2532e39c2d421806011feeaed0807bf5a7a7fdd67561e9db4922738bfcdcb6c74711ae304
diff --git a/app-text/restview/files/restview-3.0.1-test-fixes.patch b/app-text/restview/files/restview-3.0.1-test-fixes.patch
new file mode 100644
index 000000000000..ff856132ed93
--- /dev/null
+++ b/app-text/restview/files/restview-3.0.1-test-fixes.patch
@@ -0,0 +1,171 @@
+From 6a1d6b44ee400431d75ed2326bd0b4f35d4727fa Mon Sep 17 00:00:00 2001
+From: Marius Gedminas <marius@gedmin.as>
+Date: Mon, 21 Aug 2023 13:11:43 +0300
+Subject: [PATCH 1/2] Fix tests
+
+Not sure why they broke (new docutils release on PyPI)? Doctests were a
+bad idea.
+
+Upstream-commit: https://github.com/mgedmin/restview/commit/6a1d6b44ee400431d75ed2326bd0b4f35d4727fa
+
+diff --git a/src/restview/tests.py b/src/restview/tests.py
+index 71aeb77..d129835 100644
+--- a/src/restview/tests.py
++++ b/src/restview/tests.py
+@@ -540,7 +540,7 @@ def doctest_RestViewer_rest_to_html():
+ ... This is an inline literal: ``README.txt``.
+ ... ''', settings={'cloak_email_addresses': True}).strip())
+ ... # doctest: +ELLIPSIS,+REPORT_NDIFF
+- <?xml version="1.0" encoding="utf-8" ?>
++ <?xml version="1.0" encoding="utf-8"...?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+@@ -584,35 +584,11 @@ def doctest_RestViewer_rest_to_html():
+ def doctest_RestViewer_rest_to_html_css_url():
+ """Test for RestViewer.rest_to_html
+
+- XXX: this shows pygments styles inlined *after* the external css, which
+- means it's hard to override them!
+-
+ >>> viewer = RestViewer('.')
+ >>> viewer.stylesheets = 'http://example.com/my.css'
+- >>> print(viewer.rest_to_html(b'''
+- ... Some text
+- ... ''').strip())
+- ... # doctest: +ELLIPSIS,+REPORT_NDIFF
+- <?xml version="1.0" encoding="utf-8" ?>
+- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+- <head>
+- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+- ...
+- <title>...</title>
++ >>> html = viewer.rest_to_html(b'Some text')
++ >>> grep('stylesheet', html)
+ <link rel="stylesheet" href="http://example.com/my.css" type="text/css" />
+- <style type="text/css">
+- ...
+- </style>
+- </head>
+- <body>
+- <div class="document">
+- <BLANKLINE>
+- <BLANKLINE>
+- <p>Some text</p>
+- </div>
+- </body>
+- </html>
+
+ """
+
+@@ -720,32 +696,16 @@ def doctest_RestViewer_rest_to_html_pypi_strict():
+ >>> viewer = RestViewer('.')
+ >>> viewer.stylesheets = None
+ >>> viewer.pypi_strict = True
+- >>> print(viewer.rest_to_html(b'''
++ >>> html = viewer.rest_to_html(b'''
+ ... Hello
+ ... -----
+ ...
+ ... `This is fine <http://www.example.com>`__.
+ ...
+- ... ''').strip().replace("&quot;", '"'))
+- ... # doctest: +ELLIPSIS,+REPORT_NDIFF
+- <?xml version="1.0" encoding="utf-8" ?>
+- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+- <head>
+- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+- ...
++ ... ''')
++ >>> grep('Hello', html)
+ <title>Hello</title>
+- <style type="text/css">
+- ...
+- </head>
+- <body>
+- <div class="document" id="hello">
+ <h1 class="title">Hello</h1>
+- <BLANKLINE>
+- <p><a href="http://www.example.com" rel="nofollow">This is fine</a>.</p>
+- </div>
+- </body>
+- </html>
+
+ """
+
+@@ -1031,6 +991,12 @@ class TestMain(unittest.TestCase):
+ serve_called=True, browser_launched=True)
+
+
++def grep(needle, haystack):
++ for line in haystack.splitlines():
++ if needle in line:
++ print(line)
++
++
+ def test_suite():
+ return unittest.TestSuite([
+ unittest.defaultTestLoader.loadTestsFromName(__name__),
+--
+2.44.2
+
+
+From 2827a754b8706f3286d1aec07a95faf6c8e7ab84 Mon Sep 17 00:00:00 2001
+From: Marius Gedminas <marius@gedmin.as>
+Date: Wed, 31 Aug 2022 13:46:44 +0300
+Subject: [PATCH 2/2] Fix test failures with new docutils
+
+This probably introduces a dependency of docutils >= 0.19 for the test
+suite, but I don't want to make it a requirement for pip install.
+---
+
+This is backported upstream commit [1]. The issue is not related to
+docutils but >=dev-python/readme-renderer-37.0, see [2].
+
+[1] https://github.com/mgedmin/restview/commit/5033eacb1d5552e496a0da46f6a474a38b414f21
+[2] https://github.com/mgedmin/restview/issues/65#issuecomment-1377180524
+
+diff --git a/src/restview/tests.py b/src/restview/tests.py
+index d129835..a7f36d5 100644
+--- a/src/restview/tests.py
++++ b/src/restview/tests.py
+@@ -541,10 +541,9 @@ def doctest_RestViewer_rest_to_html():
+ ... ''', settings={'cloak_email_addresses': True}).strip())
+ ... # doctest: +ELLIPSIS,+REPORT_NDIFF
+ <?xml version="1.0" encoding="utf-8"...?>
+- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
++ <!DOCTYPE html...>
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ ...
+ <title>example</title>
+ <style type="text/css">
+@@ -556,7 +555,7 @@ def doctest_RestViewer_rest_to_html():
+ </style>
+ </head>
+ <body>
+- <div class="document" id="example">
++ <main id="example">
+ <h1 class="title">example</h1>
+ <BLANKLINE>
+ <p>This is a doctest:</p>
+@@ -570,11 +569,9 @@ def doctest_RestViewer_rest_to_html():
+ <p>This is a reference: <a class="reference external" href="http://example.com/README.rst">README.rst</a></p>
+ <p>This is an email: <a class="reference external" href="mailto:marius&#37;&#52;&#48;gedmin&#46;as">marius<span>&#64;</span>gedmin<span>&#46;</span>as</a></p>
+ <p>This is a literal block:</p>
+- <pre class="literal-block">
+- See <a href="CHANGES.rst">CHANGES.rst</a>, mkay?
+- </pre>
++ <pre class="literal-block">See <a href="CHANGES.rst">CHANGES.rst</a>, mkay?</pre>
+ <p>This is an inline literal: <tt class="docutils literal"><a href="README.txt">README.txt</a></tt>.</p>
+- </div>
++ </main>
+ </body>
+ </html>
+
+--
+2.44.2
+
diff --git a/app-text/restview/restview-3.0.0.ebuild b/app-text/restview/restview-3.0.1.ebuild
index b26aed69c63b..116c10e73c04 100644
--- a/app-text/restview/restview-3.0.0.ebuild
+++ b/app-text/restview/restview-3.0.1.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_COMPAT=( python3_{10..13} )
inherit distutils-r1 pypi
@@ -26,4 +26,8 @@ RDEPEND="
DOCS=( README.rst CHANGES.rst )
+PATCHES=(
+ "${FILESDIR}/${P}-test-fixes.patch"
+)
+
distutils_enable_tests pytest