Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-readme_renderer for openSUSE:Factory checked in at 2023-09-08 21:15:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-readme_renderer (Old) and /work/SRC/openSUSE:Factory/.python-readme_renderer.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-readme_renderer" Fri Sep 8 21:15:07 2023 rev:12 rq:1109530 version:41.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-readme_renderer/python-readme_renderer.changes 2023-04-22 21:59:43.044949914 +0200 +++ /work/SRC/openSUSE:Factory/.python-readme_renderer.new.1766/python-readme_renderer.changes 2023-09-08 21:15:29.302357664 +0200 @@ -1,0 +2,15 @@ +Thu Sep 7 11:38:42 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 41.0: + * Allow HTML5 `figcaption` tag through cleaner (#291) + * Test `README.rst` from this project (#288) + * Add CLI option to render package README. (#271) + * Adapt tests to pygments 2.14.0 (#272) + * Update release process to use Trusted Publishing (#276) + * Replace usage of deprecated `pkg_resources` with + `importlib.metadata` (#281) + * Drop support for Python 3.7 (#282), Test against Python 3.11 + (#280) +- drop fix-tests-pygments-2.14.0.patch (upstream) + +------------------------------------------------------------------- Old: ---- fix-tests-pygments-2.14.0.patch readme_renderer-37.3.tar.gz New: ---- readme_renderer-41.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-readme_renderer.spec ++++++ --- /var/tmp/diff_new_pack.BMUca9/_old 2023-09-08 21:15:30.418397551 +0200 +++ /var/tmp/diff_new_pack.BMUca9/_new 2023-09-08 21:15:30.422397694 +0200 @@ -16,17 +16,14 @@ # -%define skip_python2 1 %{?sle15_python_module_pythons} Name: python-readme_renderer -Version: 37.3 +Version: 41.0 Release: 0 Summary: A library for rendering "readme" descriptions License: Apache-2.0 URL: https://github.com/pypa/readme_renderer Source: https://files.pythonhosted.org/packages/source/r/readme_renderer/readme_renderer-%{version}.tar.gz -# PATCH-FIX-UPSTREAM fix-tests-pygments-2.14.0.patch gh#pypa/readme_renderer#272 -Patch0: fix-tests-pygments-2.14.0.patch BuildRequires: %{python_module Pygments >= 2.5.1} BuildRequires: %{python_module bleach >= 2.1.0} BuildRequires: %{python_module cmarkgfm >= 0.7.0} ++++++ readme_renderer-37.3.tar.gz -> readme_renderer-41.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/CHANGES.rst new/readme_renderer-41.0/CHANGES.rst --- old/readme_renderer-37.3/CHANGES.rst 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/CHANGES.rst 2023-08-18 23:46:36.000000000 +0200 @@ -1,6 +1,21 @@ Changes ======= +41.0 (2023-08-18) +----------------- + +* Allow HTML5 `figcaption` tag through cleaner (#291) +* Test `README.rst` from this project (#288) + +40.0 (2023-06-16) +----------------- + +* Add CLI option to render package README. (#271) +* Adapt tests to pygments 2.14.0 (#272) +* Update release process to use Trusted Publishing (#276) +* Replace usage of deprecated `pkg_resources` with `importlib.metadata` (#281) +* Drop support for Python 3.7 (#282), Test against Python 3.11 (#280) + 37.3 (2022-10-31) ----------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/PKG-INFO new/readme_renderer-41.0/PKG-INFO --- old/readme_renderer-37.3/PKG-INFO 2022-10-31 21:54:53.200729600 +0100 +++ new/readme_renderer-41.0/PKG-INFO 2023-08-18 23:46:47.131835000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: readme_renderer -Version: 37.3 +Version: 41.0 Summary: readme_renderer is a library for rendering "readme" descriptions for Warehouse Home-page: https://github.com/pypa/readme_renderer Author: The Python Packaging Authority @@ -17,14 +17,14 @@ Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Typing :: Typed -Requires-Python: >=3.7 +Requires-Python: >=3.8 Provides-Extra: md License-File: LICENSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/readme_renderer/__about__.py new/readme_renderer-41.0/readme_renderer/__about__.py --- old/readme_renderer-37.3/readme_renderer/__about__.py 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/readme_renderer/__about__.py 2023-08-18 23:46:36.000000000 +0200 @@ -29,7 +29,7 @@ ) __uri__ = "https://github.com/pypa/readme_renderer" -__version__ = "37.3" +__version__ = "41.0" __author__ = "The Python Packaging Authority" __email__ = "ad...@mail.pypi.org" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/readme_renderer/__main__.py new/readme_renderer-41.0/readme_renderer/__main__.py --- old/readme_renderer-37.3/readme_renderer/__main__.py 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/readme_renderer/__main__.py 2023-08-18 23:46:36.000000000 +0200 @@ -1,19 +1,62 @@ import argparse -from readme_renderer.rst import render +from readme_renderer.markdown import render as render_md +from readme_renderer.rst import render as render_rst +from readme_renderer.txt import render as render_txt +import pathlib +from importlib.metadata import metadata import sys +from typing import Optional, List -if __name__ == '__main__': +def main(cli_args: Optional[List[str]] = None) -> None: parser = argparse.ArgumentParser( - description="Renders a .rst README to HTML", + description="Renders a .md, .rst, or .txt README to HTML", ) - parser.add_argument('input', help="Input README file", - type=argparse.FileType('r')) + parser.add_argument("-p", "--package", help="Get README from package metadata", + action="store_true") + parser.add_argument("-f", "--format", choices=["md", "rst", "txt"], + help="README format (inferred from input file name or package)") + parser.add_argument('input', help="Input README file or package name") parser.add_argument('-o', '--output', help="Output file (default: stdout)", type=argparse.FileType('w'), default='-') - args = parser.parse_args() + args = parser.parse_args(cli_args) + + content_format = args.format + if args.package: + message = metadata(args.input) + source = message.get_payload() # type: ignore[attr-defined] # noqa: E501 https://peps.python.org/pep-0566/ + + # Infer the format of the description from package metadata. + if not content_format: + content_type = message.get("Description-Content-Type", "text/x-rst") # type: ignore[attr-defined] # noqa: E501 https://github.com/python/typeshed/issues/10021 + if content_type == "text/x-rst": + content_format = "rst" + elif content_type == "text/markdown": + content_format = "md" + elif content_type == "text/plain": + content_format = "txt" + else: + raise ValueError(f"invalid content type {content_type} for package " + "`long_description`") + else: + filename = pathlib.Path(args.input) + content_format = content_format or filename.suffix.lstrip(".") + with filename.open() as fp: + source = fp.read() - rendered = render(args.input.read(), stream=sys.stderr) + if content_format == "md": + rendered = render_md(source, stream=sys.stderr) + elif content_format == "rst": + rendered = render_rst(source, stream=sys.stderr) + elif content_format == "txt": + rendered = render_txt(source, stream=sys.stderr) + else: + raise ValueError(f"invalid README format: {content_format} (expected `md`, " + "`rst`, or `txt`)") if rendered is None: sys.exit(1) print(rendered, file=args.output) + + +if __name__ == '__main__': + main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/readme_renderer/clean.py new/readme_renderer-41.0/readme_renderer/clean.py --- old/readme_renderer-37.3/readme_renderer/clean.py 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/readme_renderer/clean.py 2023-08-18 23:46:36.000000000 +0200 @@ -31,6 +31,7 @@ "dl", "dt", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "img", "p", "pre", "span", "sub", "summary", "sup", "table", "tbody", "td", "th", "thead", "tr", "tt", "kbd", "var", "input", "section", "aside", "nav", "s", "figure", + "figcaption", ] ALLOWED_ATTRIBUTES = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/readme_renderer.egg-info/PKG-INFO new/readme_renderer-41.0/readme_renderer.egg-info/PKG-INFO --- old/readme_renderer-37.3/readme_renderer.egg-info/PKG-INFO 2022-10-31 21:54:53.000000000 +0100 +++ new/readme_renderer-41.0/readme_renderer.egg-info/PKG-INFO 2023-08-18 23:46:47.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: readme-renderer -Version: 37.3 +Version: 41.0 Summary: readme_renderer is a library for rendering "readme" descriptions for Warehouse Home-page: https://github.com/pypa/readme_renderer Author: The Python Packaging Authority @@ -17,14 +17,14 @@ Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Typing :: Typed -Requires-Python: >=3.7 +Requires-Python: >=3.8 Provides-Extra: md License-File: LICENSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/readme_renderer.egg-info/SOURCES.txt new/readme_renderer-41.0/readme_renderer.egg-info/SOURCES.txt --- old/readme_renderer-37.3/readme_renderer.egg-info/SOURCES.txt 2022-10-31 21:54:53.000000000 +0100 +++ new/readme_renderer-41.0/readme_renderer.egg-info/SOURCES.txt 2023-08-18 23:46:47.000000000 +0200 @@ -21,6 +21,7 @@ readme_renderer.egg-info/top_level.txt tests/__init__.py tests/test_clean.py +tests/test_cli.py tests/test_markdown.py tests/test_noextra.py tests/test_rst.py @@ -129,12 +130,16 @@ tests/fixtures/test_rst_bibtex.rst tests/fixtures/test_rst_caption.html tests/fixtures/test_rst_caption.rst +tests/fixtures/test_rst_citations.html +tests/fixtures/test_rst_citations.rst tests/fixtures/test_rst_contents.html tests/fixtures/test_rst_contents.rst tests/fixtures/test_rst_docinfo.html tests/fixtures/test_rst_docinfo.rst tests/fixtures/test_rst_figure.html tests/fixtures/test_rst_figure.rst +tests/fixtures/test_rst_footnotes.html +tests/fixtures/test_rst_footnotes.rst tests/fixtures/test_rst_linkify.html tests/fixtures/test_rst_linkify.rst tests/fixtures/test_rst_math.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/setup.py new/readme_renderer-41.0/setup.py --- old/readme_renderer-37.3/setup.py 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/setup.py 2023-08-18 23:46:36.000000000 +0200 @@ -47,10 +47,10 @@ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Typing :: Typed", @@ -59,5 +59,5 @@ include_package_data=True, extras_require={"md": "cmarkgfm>=0.8.0"}, packages=setuptools.find_packages(exclude=["tests", "tests.*"]), - python_requires=">=3.7", + python_requires=">=3.8", ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_CommonMark_008.html new/readme_renderer-41.0/tests/fixtures/test_CommonMark_008.html --- old/readme_renderer-37.3/tests/fixtures/test_CommonMark_008.html 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_CommonMark_008.html 2023-08-18 23:46:36.000000000 +0200 @@ -9,8 +9,8 @@ <span class="n">dog</span> <span class="o">=</span> <span class="n">Dog</span><span class="p">(</span><span class="s1">'Fido'</span><span class="p">)</span> </pre> <p>and then here is some bash:</p> -<pre lang="bash"><span class="k">if</span> <span class="o">[</span> <span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span> <span class="o">=</span> <span class="s2">"--help"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span> - <span class="nb">echo</span> <span class="s2">"OK"</span> +<pre lang="bash"><span class="k">if</span><span class="w"> </span><span class="o">[</span><span class="w"> </span><span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"--help"</span><span class="w"> </span><span class="o">]</span><span class="p">;</span><span class="w"> </span><span class="k">then</span> +<span class="w"> </span><span class="nb">echo</span><span class="w"> </span><span class="s2">"OK"</span> <span class="k">fi</span> </pre> <p>or click <a href="http://www.surveymonkey.com" rel="nofollow">SurveyMonkey</a></p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_GFM_doublequotes.html new/readme_renderer-41.0/tests/fixtures/test_GFM_doublequotes.html --- old/readme_renderer-37.3/tests/fixtures/test_GFM_doublequotes.html 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_GFM_doublequotes.html 2023-08-18 23:46:36.000000000 +0200 @@ -2,10 +2,10 @@ <pre><code>This is code text. </code></pre> <pre lang="python3"><span class="k">def</span> <span class="nf">this_is_python</span><span class="p">():</span> - <span class="sd">"""This is a docstring."""</span> +<span class="w"> </span><span class="sd">"""This is a docstring."""</span> <span class="k">pass</span> </pre> -<pre lang="go"><span class="kd">func</span><span class="w"> </span><span class="nx">ThisIsGo</span><span class="p">(){</span><span class="w"></span> -<span class="w"> </span><span class="k">return</span><span class="w"></span> -<span class="p">}</span><span class="w"></span> +<pre lang="go"><span class="kd">func</span><span class="w"> </span><span class="nx">ThisIsGo</span><span class="p">(){</span> +<span class="w"> </span><span class="k">return</span> +<span class="p">}</span> </pre> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_GFM_highlight.html new/readme_renderer-41.0/tests/fixtures/test_GFM_highlight.html --- old/readme_renderer-37.3/tests/fixtures/test_GFM_highlight.html 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_GFM_highlight.html 2023-08-18 23:46:36.000000000 +0200 @@ -4,9 +4,9 @@ <pre lang="python3"><span class="k">def</span> <span class="nf">this_is_python</span><span class="p">():</span> <span class="k">pass</span> </pre> -<pre lang="go"><span class="kd">func</span><span class="w"> </span><span class="nx">ThisIsGo</span><span class="p">(){</span><span class="w"></span> -<span class="w"> </span><span class="k">return</span><span class="w"></span> -<span class="p">}</span><span class="w"></span> +<pre lang="go"><span class="kd">func</span><span class="w"> </span><span class="nx">ThisIsGo</span><span class="p">(){</span> +<span class="w"> </span><span class="k">return</span> +<span class="p">}</span> </pre> <pre lang="abc">An unknown code fence block </pre> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_GFM_malicious_pre.html new/readme_renderer-41.0/tests/fixtures/test_GFM_malicious_pre.html --- old/readme_renderer-37.3/tests/fixtures/test_GFM_malicious_pre.html 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_GFM_malicious_pre.html 2023-08-18 23:46:36.000000000 +0200 @@ -1,6 +1,6 @@ <p>This is normal text.</p> <pre lang="python3"><span class="k">def</span> <span class="nf">this_is_python</span><span class="p">():</span> - <span class="sd">"""This is a docstring."""</span> +<span class="w"> </span><span class="sd">"""This is a docstring."""</span> <span class="k">pass</span> <span class="o"><</span><span class="n">script</span> <span class="nb">type</span><span class="o">=</span><span class="s2">"text/javascript"</span><span class="o">></span><span class="n">alert</span><span class="p">(</span><span class="s1">'I am evil.'</span><span class="p">);</span><span class="o"></</span><span class="n">script</span><span class="o">></span> </pre> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_rst_008.html new/readme_renderer-41.0/tests/fixtures/test_rst_008.html --- old/readme_renderer-37.3/tests/fixtures/test_rst_008.html 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_rst_008.html 2023-08-18 23:46:36.000000000 +0200 @@ -1,15 +1,15 @@ <p>Here is some Python code for a <span class="docutils literal">Dog</span>:</p> -<pre><code><span class="k">class</span> <span class="nc">Dog</span><span class="p">(</span><span class="n">Animal</span><span class="p">):</span> - <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span> - <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span> +<pre><code><span class="k">class</span> <span class="nc">Dog</span><span class="p">(</span><span class="n">Animal</span><span class="p">):</span><span class="w"> +</span> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span><span class="w"> +</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span><span class="w"> - <span class="k">def</span> <span class="nf">make_sound</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> - <span class="nb">print</span><span class="p">(</span><span class="s1">'Ruff!'</span><span class="p">)</span> +</span> <span class="k">def</span> <span class="nf">make_sound</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span><span class="w"> +</span> <span class="nb">print</span><span class="p">(</span><span class="s1">'Ruff!'</span><span class="p">)</span><span class="w"> -<span class="n">dog</span> <span class="o">=</span> <span class="n">Dog</span><span class="p">(</span><span class="s1">'Fido'</span><span class="p">)</span></code></pre> +</span><span class="n">dog</span> <span class="o">=</span> <span class="n">Dog</span><span class="p">(</span><span class="s1">'Fido'</span><span class="p">)</span></code></pre> <p>and then here is some bash:</p> -<pre><code><span class="k">if</span> <span class="o">[</span> <span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span> <span class="o">=</span> <span class="s2">"--help"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span> - <span class="nb">echo</span> <span class="s2">"OK"</span> -<span class="k">fi</span></code></pre> +<pre><code><span class="k">if</span><span class="w"> </span><span class="o">[</span><span class="w"> </span><span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"--help"</span><span class="w"> </span><span class="o">]</span><span class="p">;</span><span class="w"> </span><span class="k">then</span><span class="w"> + </span><span class="nb">echo</span><span class="w"> </span><span class="s2">"OK"</span><span class="w"> +</span><span class="k">fi</span></code></pre> <p>or click <a href="http://www.surveymonkey.com" rel="nofollow">SurveyMonkey</a></p> <pre><code>An unknown code fence block</code></pre> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_rst_citations.html new/readme_renderer-41.0/tests/fixtures/test_rst_citations.html --- old/readme_renderer-37.3/tests/fixtures/test_rst_citations.html 1970-01-01 01:00:00.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_rst_citations.html 2023-08-18 23:46:36.000000000 +0200 @@ -0,0 +1,22 @@ +<p>Citation references, like <a href="#cit2002" id="citation-reference-1" rel="nofollow">[CIT2002]</a>. +Note that citations may get +rearranged, e.g., to the bottom of +the âpageâ.</p> +<div class="citation-list"> +<div class="citation" id="cit2002"> +<span class="label"><span class="fn-bracket">[</span><a href="#citation-reference-1" rel="nofollow">CIT2002</a><span class="fn-bracket">]</span></span> +<p>A citation +(as often used in journals).</p> +</div> +</div> +<p>Citation labels contain alphanumerics, +underlines, hyphens and fullstops. +Case is not significant.</p> +<p>Given a citation like <a href="#this" id="citation-reference-2" rel="nofollow">[this]</a>, one +can also refer to it like <a href="#this" rel="nofollow">this</a>.</p> +<div class="citation-list"> +<div class="citation" id="this"> +<span class="label"><span class="fn-bracket">[</span><a href="#citation-reference-2" rel="nofollow">this</a><span class="fn-bracket">]</span></span> +<p>here.</p> +</div> +</div> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_rst_citations.rst new/readme_renderer-41.0/tests/fixtures/test_rst_citations.rst --- old/readme_renderer-37.3/tests/fixtures/test_rst_citations.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_rst_citations.rst 2023-08-18 23:46:36.000000000 +0200 @@ -0,0 +1,18 @@ +.. Citations https://docutils.sourceforge.io/docs/user/rst/quickref.html#citations + +Citation references, like [CIT2002]_. +Note that citations may get +rearranged, e.g., to the bottom of +the "page". + +.. [CIT2002] A citation + (as often used in journals). + +Citation labels contain alphanumerics, +underlines, hyphens and fullstops. +Case is not significant. + +Given a citation like [this]_, one +can also refer to it like this_. + +.. [this] here. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_rst_figure.html new/readme_renderer-41.0/tests/fixtures/test_rst_figure.html --- old/readme_renderer-37.3/tests/fixtures/test_rst_figure.html 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_rst_figure.html 2023-08-18 23:46:36.000000000 +0200 @@ -1,3 +1,6 @@ <figure class="align-center"> <img alt="https://raw.githubusercontent.com/schlatterbeck/plot-antenna/master/test/12-el-azimuth.png" src="https://raw.githubusercontent.com/schlatterbeck/plot-antenna/master/test/12-el-azimuth.png"> +<figcaption> +<p>This is the caption for the figure</p> +</figcaption> </figure> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_rst_figure.rst new/readme_renderer-41.0/tests/fixtures/test_rst_figure.rst --- old/readme_renderer-37.3/tests/fixtures/test_rst_figure.rst 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_rst_figure.rst 2023-08-18 23:46:36.000000000 +0200 @@ -1,2 +1,4 @@ .. figure:: https://raw.githubusercontent.com/schlatterbeck/plot-antenna/master/test/12-el-azimuth.png :align: center + + This is the caption for the figure \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_rst_footnotes.html new/readme_renderer-41.0/tests/fixtures/test_rst_footnotes.html --- old/readme_renderer-37.3/tests/fixtures/test_rst_footnotes.html 1970-01-01 01:00:00.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_rst_footnotes.html 2023-08-18 23:46:36.000000000 +0200 @@ -0,0 +1,48 @@ +<p>Footnote references, like <a href="#footnote-1" id="footnote-reference-1" rel="nofollow"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a>. +Note that footnotes may get +rearranged, e.g., to the bottom of +the âpageâ.</p> +<aside class="footnote-list brackets"> +<aside class="footnote brackets" id="footnote-1"> +<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-1" rel="nofollow">5</a><span class="fn-bracket">]</span></span> +<p>A numerical footnote. Note +thereâs no colon after the <span class="docutils literal">]</span>.</p> +</aside> +</aside> +<p>Autonumbered footnotes are +possible, like using <a href="#footnote-2" id="footnote-reference-2" rel="nofollow"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> and <a href="#footnote-3" id="footnote-reference-3" rel="nofollow"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>.</p> +<aside class="footnote-list brackets"> +<aside class="footnote brackets" id="footnote-2"> +<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-2" rel="nofollow">1</a><span class="fn-bracket">]</span></span> +<p>This is the first one.</p> +</aside> +<aside class="footnote brackets" id="footnote-3"> +<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-3" rel="nofollow">2</a><span class="fn-bracket">]</span></span> +<p>This is the second one.</p> +</aside> +</aside> +<p>They may be assigned âautonumber +labelsâ - for instance, +<a href="#fourth" id="footnote-reference-4" rel="nofollow"><span class="fn-bracket">[</span>4<span class="fn-bracket">]</span></a> and <a href="#third" id="footnote-reference-5" rel="nofollow"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a>.</p> +<aside class="footnote-list brackets"> +<aside class="footnote brackets" id="third"> +<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-5" rel="nofollow">3</a><span class="fn-bracket">]</span></span> +<p>a.k.a. <a href="#third" rel="nofollow">third</a></p> +</aside> +<aside class="footnote brackets" id="fourth"> +<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-4" rel="nofollow">4</a><span class="fn-bracket">]</span></span> +<p>a.k.a. <a href="#fourth" rel="nofollow">fourth</a></p> +</aside> +</aside> +<p>Auto-symbol footnotes are also +possible, like this: <a href="#footnote-4" id="footnote-reference-6" rel="nofollow"><span class="fn-bracket">[</span>*<span class="fn-bracket">]</span></a> and <a href="#footnote-5" id="footnote-reference-7" rel="nofollow"><span class="fn-bracket">[</span>â <span class="fn-bracket">]</span></a>.</p> +<aside class="footnote-list brackets"> +<aside class="footnote brackets" id="footnote-4"> +<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-6" rel="nofollow">*</a><span class="fn-bracket">]</span></span> +<p>This is the first one.</p> +</aside> +<aside class="footnote brackets" id="footnote-5"> +<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-7" rel="nofollow">â </a><span class="fn-bracket">]</span></span> +<p>This is the second one.</p> +</aside> +</aside> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/fixtures/test_rst_footnotes.rst new/readme_renderer-41.0/tests/fixtures/test_rst_footnotes.rst --- old/readme_renderer-37.3/tests/fixtures/test_rst_footnotes.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/readme_renderer-41.0/tests/fixtures/test_rst_footnotes.rst 2023-08-18 23:46:36.000000000 +0200 @@ -0,0 +1,29 @@ +.. Footnotes https://docutils.sourceforge.io/docs/user/rst/quickref.html#footnotes + +Footnote references, like [5]_. +Note that footnotes may get +rearranged, e.g., to the bottom of +the "page". + +.. [5] A numerical footnote. Note + there's no colon after the ``]``. + +Autonumbered footnotes are +possible, like using [#]_ and [#]_. + +.. [#] This is the first one. +.. [#] This is the second one. + +They may be assigned 'autonumber +labels' - for instance, +[#fourth]_ and [#third]_. + +.. [#third] a.k.a. third_ + +.. [#fourth] a.k.a. fourth_ + +Auto-symbol footnotes are also +possible, like this: [*]_ and [*]_. + +.. [*] This is the first one. +.. [*] This is the second one. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/test_cli.py new/readme_renderer-41.0/tests/test_cli.py --- old/readme_renderer-37.3/tests/test_cli.py 1970-01-01 01:00:00.000000000 +0100 +++ new/readme_renderer-41.0/tests/test_cli.py 2023-08-18 23:46:36.000000000 +0200 @@ -0,0 +1,69 @@ +import pathlib +import pytest +from readme_renderer.__main__ import main +import tempfile +from unittest import mock + + +@pytest.fixture(params=["test_CommonMark_001.md", "test_rst_003.rst", + "test_GFM_001.md", "test_txt_001.txt"]) +def input_file(request): + path = pathlib.Path("tests/fixtures", request.param) + # Skip markdown tests if the cmarkgfm optional dependency is not installed. + if path.suffix == ".md": + pytest.importorskip("cmarkgfm") + return path + + +@pytest.mark.parametrize("output_file", [False, True]) +def test_cli_input_file(input_file, output_file): + with mock.patch("builtins.print") as print_: + if output_file: + with tempfile.TemporaryDirectory() as tmpdir: + output = pathlib.Path(tmpdir) / "output.html" + main(["-o", str(output), str(input_file)]) + with output.open() as fp: + result = fp.read() + else: + main([str(input_file)]) + + print_.assert_called_once() + (result,), kwargs = print_.call_args + + with input_file.with_suffix(".html").open() as fp: + expected = fp.read() + assert result.strip() == expected.strip() + + if output_file: + assert kwargs["file"].name == str(output) + + +def test_cli_invalid_format(): + with mock.patch("pathlib.Path.open"), \ + pytest.raises(ValueError, match="invalid README format: invalid"): + main(["no-file.invalid"]) + + +def test_cli_explicit_format(input_file): + fmt = input_file.suffix.lstrip(".") + with input_file.open() as fp, \ + mock.patch("pathlib.Path.open", return_value=fp), \ + mock.patch("builtins.print") as print_: + main(["-f", fmt, "no-file.invalid"]) + print_.assert_called_once() + (result,), _ = print_.call_args + + with input_file.with_suffix(".html").open() as fp: + assert result.strip() == fp.read().strip() + + +@pytest.mark.parametrize("package, contains", [ + ("readme_renderer", "Readme Renderer is a library that will safely render"), + ("docutils", "Docutils is a modular system for processing documentation"), +]) +def test_cli_package(package, contains): + with mock.patch("builtins.print") as print_: + main(["-p", package]) + print_.assert_called_once() + (result,), _ = print_.call_args + assert contains in result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tests/test_rst.py new/readme_renderer-41.0/tests/test_rst.py --- old/readme_renderer-37.3/tests/test_rst.py 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/tests/test_rst.py 2023-08-18 23:46:36.000000000 +0200 @@ -80,3 +80,10 @@ assert len(warnings.getvalue().splitlines()) == 1 assert "No content rendered from RST source." not in warnings.getvalue() + + +def test_own_readme(): + """Render the project's README.rst from root.""" + readme = Path(__file__).parent.parent / "README.rst" + rendered = render(readme.read_text(encoding="utf-8")) + assert rendered is not None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/readme_renderer-37.3/tox.ini new/readme_renderer-41.0/tox.ini --- old/readme_renderer-37.3/tox.ini 2022-10-31 21:54:28.000000000 +0100 +++ new/readme_renderer-41.0/tox.ini 2023-08-18 23:46:36.000000000 +0200 @@ -1,5 +1,5 @@ [tox] -envlist = py37,py38,py39,py310,pep8,packaging,noextra,mypy +envlist = py38,py39,py310,py311,pep8,packaging,noextra,mypy isolated_build = True [testenv]