- Add pygments.patch to fix test failure with Pygments 2.19

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-readme_renderer?expand=0&rev=35
This commit is contained in:
Steve Kowalik 2025-01-21 03:48:54 +00:00 committed by Git OBS Bridge
commit 6bed2955da
7 changed files with 398 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

95
pygments.patch Normal file
View File

@ -0,0 +1,95 @@
From 04d5cfe76850192364eff344be7fe27730af8484 Mon Sep 17 00:00:00 2001
From: shenxianpeng <xianpeng.shen@gmail.com>
Date: Sat, 18 Jan 2025 06:30:04 -0500
Subject: [PATCH] update test outputs to fix test fail (#325)
---
tests/fixtures/test_CommonMark_008.html | 6 +++---
tests/fixtures/test_GFM_doublequotes.html | 2 +-
tests/fixtures/test_GFM_highlight.html | 2 +-
tests/fixtures/test_GFM_highlight_default_py.html | 2 +-
tests/fixtures/test_GFM_malicious_pre.html | 2 +-
tests/fixtures/test_rst_008.html | 6 +++---
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/tests/fixtures/test_CommonMark_008.html b/tests/fixtures/test_CommonMark_008.html
index eef144d..5072058 100644
--- a/tests/fixtures/test_CommonMark_008.html
+++ b/tests/fixtures/test_CommonMark_008.html
@@ -1,9 +1,9 @@
<p>Here is some Python code for a <code>Dog</code>:</p>
-<pre lang="python3"><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>
+<pre lang="python3"><span class="k">class</span><span class="w"> </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="w"> </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>
- <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="k">def</span><span class="w"> </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 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>
diff --git a/tests/fixtures/test_GFM_doublequotes.html b/tests/fixtures/test_GFM_doublequotes.html
index f75a4cf..b26adba 100644
--- a/tests/fixtures/test_GFM_doublequotes.html
+++ b/tests/fixtures/test_GFM_doublequotes.html
@@ -1,7 +1,7 @@
<p>This is normal text.</p>
<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>
+<pre lang="python3"><span class="k">def</span><span class="w"> </span><span class="nf">this_is_python</span><span class="p">():</span>
<span class="w"> </span><span class="sd">"""This is a docstring."""</span>
<span class="k">pass</span>
</pre>
diff --git a/tests/fixtures/test_GFM_highlight.html b/tests/fixtures/test_GFM_highlight.html
index c2cf7bb..1eae5fd 100644
--- a/tests/fixtures/test_GFM_highlight.html
+++ b/tests/fixtures/test_GFM_highlight.html
@@ -1,7 +1,7 @@
<p>This is normal text.</p>
<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>
+<pre lang="python3"><span class="k">def</span><span class="w"> </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>
diff --git a/tests/fixtures/test_GFM_highlight_default_py.html b/tests/fixtures/test_GFM_highlight_default_py.html
index d85d6ce..d1a136f 100644
--- a/tests/fixtures/test_GFM_highlight_default_py.html
+++ b/tests/fixtures/test_GFM_highlight_default_py.html
@@ -1,4 +1,4 @@
-<pre lang="python3"><span class="k">async</span> <span class="k">def</span> <span class="nf">this_is_python</span><span class="p">():</span>
+<pre lang="python3"><span class="k">async</span> <span class="k">def</span><span class="w"> </span><span class="nf">this_is_python</span><span class="p">():</span>
<span class="k">pass</span>
<span class="nb">print</span><span class="p">(</span><span class="k">await</span> <span class="n">this_is_python</span><span class="p">())</span>
diff --git a/tests/fixtures/test_GFM_malicious_pre.html b/tests/fixtures/test_GFM_malicious_pre.html
index dc7b6e6..2e586ec 100644
--- a/tests/fixtures/test_GFM_malicious_pre.html
+++ b/tests/fixtures/test_GFM_malicious_pre.html
@@ -1,5 +1,5 @@
<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>
+<pre lang="python3"><span class="k">def</span><span class="w"> </span><span class="nf">this_is_python</span><span class="p">():</span>
<span class="w"> </span><span class="sd">"""This is a docstring."""</span>
<span class="k">pass</span>
<span class="o">&lt;</span><span class="n">script</span> <span class="nb">type</span><span class="o">=</span><span class="s2">"text/javascript"</span><span class="o">&gt;</span><span class="n">alert</span><span class="p">(</span><span class="s1">'I am evil.'</span><span class="p">);</span><span class="o">&lt;/</span><span class="n">script</span><span class="o">&gt;</span>
diff --git a/tests/fixtures/test_rst_008.html b/tests/fixtures/test_rst_008.html
index 6762f3a..bbb44a8 100644
--- a/tests/fixtures/test_rst_008.html
+++ b/tests/fixtures/test_rst_008.html
@@ -1,9 +1,9 @@
<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="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">
+<pre><code><span class="k">class</span><span class="w"> </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="w"> </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> <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="k">def</span><span class="w"> </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><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>

View File

@ -0,0 +1,203 @@
-------------------------------------------------------------------
Mon Jan 20 15:29:01 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Add pygments.patch to fix test failure with Pygments 2.19
-------------------------------------------------------------------
Thu Nov 7 13:28:54 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Update to 44.0:
* Drop support for Python 3.8 (#315)
* Require docutils 0.21.2 and higher (#315)
* Remove HTML5 <s> tag from the list of allowed HTML tags (#315)
* Test all supported CPython and PyPy versions in CI (#315)
* Resolve Node 16 deprecation warnings in CI (#309)
* Lint specific directories (#312)
* Build a wheel once for all tox test environments (#308)
* Lazy open output files, and always close them (#314)
* Gitpod: Migrate to the Even Better TOML extension (#306)
* check-manifest: Remove a now-default .gitpod.yml exclusion (#307)
-------------------------------------------------------------------
Sat Mar 16 12:54:36 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 43.0:
* Allow HTML5 picture tag through cleaner
* Test against Python 3.12
-------------------------------------------------------------------
Wed Dec 27 16:45:17 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 42.0:
* Migrate from ``bleach`` to ``nh3`` (#295)
* Migrate from ``setup.py`` to ``pyproject.toml``
-------------------------------------------------------------------
Thu Sep 7 11:38:42 UTC 2023 - Dirk Müller <dmueller@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)
-------------------------------------------------------------------
Fri Apr 21 12:32:44 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:44:24 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Wed Jan 4 16:24:09 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Add fix-tests-pygments-2.14.0.patch to adapt tests to the new version of
pygments gh#pypa/readme_renderer#272
-------------------------------------------------------------------
Wed Nov 9 18:51:01 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to 37.3 (2022-10-31)
* Allow HTML5 figure tag through cleaner (#265)
- Update to 37.2 (2022-09-24)
* Allow HTML5 s tag through cleaner (#261)
- Update to 37.1 (2022-09-03)
* Allow HTML5 nav tag through cleaner (#259)
- Update to 37.0 (2022-08-21)
* Remove command line example from docs (#197)
* Multiple pyproject.toml fixes (#251)
* Confirm handling multiple inline strong (#252)
* Convert RST output to HTML5 (#253)
* Add Typing to classifiers (#254)
* Development tweaks - coverage reporting, actions updates (#255)
* Add test confirming behavior with unknown lexers (#256)
-Update to 36.0 (2022-08-06)
* Enable gitpod development (#238)
* Allow rst admonitions to render (#242)
* Add badges to README (#243)
* Update codebase for modern Python (#244)
* Fix table cell spans (#245)
* Allow math directive in rst (#246)
* Preserve lang attribute in pre (#247)
-------------------------------------------------------------------
Fri Jul 15 10:07:35 UTC 2022 - Jacob Michalskie <hel@lcp.world>
- Update to 35.0:
* works with newer versions of cmarkgfm
-------------------------------------------------------------------
Wed Feb 9 10:39:46 UTC 2022 - Matej Cepl <mcepl@suse.com>
- We require cmarkgfm == 0.7.0 (gh#pypa/readme_renderer#221) and
still we have to stkip test_md_fixtures.
-------------------------------------------------------------------
Sun Jan 16 12:48:21 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 32.0:
* Allow start attribute in ordered lists (#216)
* No limit rendering RST one column field names (#219)
* Render disabled checkboxes from Markdown (#217)
* support cmarkgfm>=0.6.0 (#209)
- drop remove-mock.patch, remove-six.patch: upstream
-------------------------------------------------------------------
Mon Mar 22 10:45:29 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Update to 29.0
* Support cmarkgfm>=0.5.0 (#180)
* Drop support for Python 2 and 3.5 (#188)
- Release 28.0
* Support Python 3.9 (#176)
- Release 27.0
* Add support for align attribute rendering Markdown headers
(#173)
- Add remove-mock.patch and remove-six.patch to reduce outdated
dependecies -- gh#pypa/readme_renderer#192
--------------------------------------------------------------------
Mon Aug 3 11:54:02 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Update to 26.0
* Fix regression with image width/height attributes
-------------------------------------------------------------------
Tue Mar 24 16:03:10 UTC 2020 - Antonio Larrosa <alarrosa@suse.com>
- Do not build the python2 package since Pygments, which is required
only builds a python3 package.
-------------------------------------------------------------------
Sun Mar 15 07:07:09 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 25.0:
* Fix testsuite to work with new pygments
- Remove merged patch pygments25.patch
-------------------------------------------------------------------
Sat Mar 14 09:44:32 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Add patch to fix test fixtures with new pygments:
* pygments25.patch
-------------------------------------------------------------------
Sun Mar 3 09:43:05 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Remove bcond_with test preventing the tests from running
- Remove unnecessary dependency on flake8
- Increase dependency on bleach to fix test failure
- Add cmarkgfm >= 0.2.0 from upstream
-------------------------------------------------------------------
Sun Dec 30 11:27:34 UTC 2018 - Thomas Bechtold <tbechtold@suse.com>
- update to 24.0:
* Remove dependency on ``future``. (#134)
* Breaking change: Move the cmarkgfm dependency into an extra (#130). Users
that want to render Markdown will need to install readme_render[md] instead.
* Unify handling of SVG and other images in RST. (#113)
* Support width and alignment of images in RST (#114)
* Allow <caption>. (#105)
* Add specific tests for the raw directive. (#103)
* Include docinfo when rendering rst. (#99)
* Make Python 3 the default lexer for highlighting Python code in Markdown (#97)
* Allow align attribute on <p> tags (#98)
* Reformat docutils messages into more human-friendly output. (#92)
* Fix incorrect escaping of html entities in pre tags when using markdown. (#89)
* Allow width, height, alt, and align attributes on img tags. (#91)
* Fix check to not report success when there is invalid RST. (#90)
* Allow details and summary tags. (#77)
* Add .pytest_cache to .gitignore. (#85)
* Warn about Markdown content type when checking RST. (#83)
* Update pep8 tox env to use py3.6. (#84)
* Add Pygments-based syntax highlighting for Markdown. (#82)
* Update docs about check to talk about Markdown. (#80)
* Change Github-flavored Markdown identifier from ``gfm`` to ``GFM``.
* Add support for GitHub-flavored Markdown. (#67)
* Switch to cmarkgfm completely for rendering Markdown. (#68)
* Warn about missing long description. (#69)
* Make Github-Flavored Markdown the default variant (#73)
* All renderers now accept arbitrary ``kwargs`` for future-proofing.
* Gracefully handle new exceptions from bleach.
* Fix an issue cleaning plaintext values.
* Fix an issue attempting to clean data that had ``<a>`` tags without a href.
- Use %license macro
-------------------------------------------------------------------
Mon Aug 14 01:35:57 UTC 2017 - toddrme2178@gmail.com
- Initial version

View File

@ -0,0 +1,70 @@
#
# spec file for package python-readme_renderer
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-readme_renderer
Version: 44.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 https://github.com/pypa/readme_renderer/pull/325 fix: update test outputs to fix tests fail
Patch: pygments.patch
BuildRequires: %{python_module Pygments >= 2.5.1}
BuildRequires: %{python_module cmarkgfm >= 0.7.0}
BuildRequires: %{python_module docutils >= 0.13.1}
BuildRequires: %{python_module nh3 >= 0.2.14}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Pygments >= 2.5.1
Requires: python-docutils >= 0.13.1
Requires: python-nh3 >= 0.2.14
Recommends: python-cmarkgfm >= 0.7.0
BuildArch: noarch
%python_subpackages
%description
Readme Renderer is a library that will safely render arbitrary ``README`` files
into HTML. It is designed to be used in Warehouse to render the
long_description for packages.
%prep
%autosetup -p1 -n readme_renderer-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export LANG=en_US.UTF-8
%pytest
%files %{python_files}
%license LICENSE
%doc CHANGES.rst README.rst
%{python_sitelib}/readme_renderer
%{python_sitelib}/readme_renderer-%{version}.dist-info
%changelog

BIN
readme_renderer-43.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8712034eabbfa6805cacf1402b4eeb2a73028f72d1166d6f5cb7f9c047c5d1e1
size 32056