Bug 2350302

Summary: Heads-up: python-readme-renderer fails to build with python-pygments 2.19.1 on Fedora 43
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-readme-rendererAssignee: Fabian Affolter <mail>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: epel-packagers-sig, mail, michel, romain.geissler
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-readme-renderer-44.0-3.fc43 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-03-31 15:00:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2322407, 2339432, 2335657    

Description Karolina Surma 2025-03-06 11:28:09 UTC
python-readme-renderer fails to build with python-pygments 2.19.1 in Fedora 43.
I intend to update python-pygments in Fedora Rawhide in ~1 week.

There may be an upstream solution to the issue (not tested), see:
https://github.com/pypa/readme_renderer/commit/04d5cfe76850192364eff344be7fe27730af8484 

The failure:

_____________________ test_rst_fixtures[test_rst_008.rst] ______________________

rst_filename = PosixPath('/builddir/build/BUILD/python-readme-renderer-44.0-build/readme_renderer-44.0/tests/fixtures/test_rst_008.rst')
html_filename = PosixPath('/builddir/build/BUILD/python-readme-renderer-44.0-build/readme_renderer-44.0/tests/fixtures/test_rst_008.html')

    @pytest.mark.parametrize(
        ("rst_filename", "html_filename"),
        [
            (pytest.param(fn, fn.with_suffix(".html"), id=fn.name))
            for fn in Path(__file__).parent.glob("fixtures/test_*.rst")
        ],
    )
    def test_rst_fixtures(rst_filename, html_filename):
        # Get our Markup
        with open(rst_filename, encoding='utf-8') as f:
            rst_markup = f.read()
    
        # Get our expected
        with open(html_filename, encoding="utf-8") as f:
            expected = f.read()
    
        out = render(rst_markup)
    
        if "<" in expected:
>           assert out == expected
E           assert '<p>Here is s...code></pre>\n' == '<p>Here is s...code></pre>\n'
E             
E               <p>Here is some Python code for a <span class="docutils literal">Dog</span>:</p>
E             - <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">
E             ?                                        -
E             + <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">
E             ?                                             ++++++++++++++++++++++++
E             - </span>    <span class="k">def<...
E             
E             ...Full output truncated (19 lines hidden), use '-vv' to show

tests/test_rst.py:28: AssertionError

The testing takes place in COPR:
https://copr.fedorainfracloud.org/coprs/ksurma/pygments-2.19.1-f43/package/python-readme-renderer

Comment 1 Romain Geissler 2025-03-30 13:59:34 UTC
Hi,

I have just pushed a commit in this old pull request to fix this issue: https://src.fedoraproject.org/rpms/python-readme-renderer/pull-request/5 (backport of upstream commit https://github.com/pypa/readme_renderer/pull/325)

Comment 2 Romain Geissler 2025-03-31 07:49:28 UTC
This fix specifically was now submitted without any other change in rawhide in https://src.fedoraproject.org/rpms/python-readme-renderer/pull-request/6

Comment 3 Fedora Update System 2025-03-31 14:57:25 UTC
FEDORA-2025-251b99d09e (python-readme-renderer-44.0-3.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-251b99d09e

Comment 4 Fedora Update System 2025-03-31 15:00:58 UTC
FEDORA-2025-251b99d09e (python-readme-renderer-44.0-3.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.