#5 Fix failing test with Pygments 2.11
Merged 2 years ago by kevin. Opened 2 years ago by ksurma.
rpms/ ksurma/python-diff-cover pygments  into  rawhide

file added
+28
@@ -0,0 +1,28 @@ 

+ From cdda8945e6a0a08eccce7d7ed91a4defa4d920d4 Mon Sep 17 00:00:00 2001

+ From: Ast-x64 <Ast-x64@protonmail.com>

+ Date: Wed, 26 Jan 2022 12:41:03 +0800

+ Subject: [PATCH] Fix test_style_defs

+ 

+ The pygments module made a change to default snippet styles in 2.11.0,

+     which breaks the test_style_defs unit here using predefined styles

+     from old pygments.

+ See https://github.com/pygments/pygments/pull/1940 for more information.

+ ---

+  tests/fixtures/snippet.css | 4 ++--

+  1 file changed, 2 insertions(+), 2 deletions(-)

+ 

+ diff --git a/tests/fixtures/snippet.css b/tests/fixtures/snippet.css

+ index 6d430a01..228d0d77 100644

+ --- a/tests/fixtures/snippet.css

+ +++ b/tests/fixtures/snippet.css

+ @@ -1,8 +1,8 @@

+  .hll { background-color: #ffcccc }

+ -.c { color: #408080; font-style: italic } /* Comment */

+ +.c { color: #3D7B7B; font-style: italic } /* Comment */

+  .k { color: #008000; font-weight: bold } /* Keyword */

+  .o { color: #666666 } /* Operator */

+  .m { color: #666666 } /* Literal.Number */

+  .s { color: #BA2121 } /* Literal.String */

+ -.na { color: #7D9029 } /* Name.Attribute */

+ +.na { color: #687822 } /* Name.Attribute */

+  .nb { color: #008000 } /* Name.Builtin */

file modified
+9 -2
@@ -10,7 +10,7 @@ 

  

  Name:           python-diff-cover

  Version:        6.4.4

- Release:        2%{?dist}

+ Release:        3%{?dist}

  BuildArch:      noarch

  

  License:        ASL 2.0
@@ -18,6 +18,10 @@ 

  URL:            https://github.com/Bachmann1234/diff-cover/

  Source0:        %{url}/archive/v%{version}/diff-cover-%{version}.tar.gz

  

+ # Fix for failing Pygments test

+ # Backported from: https://github.com/Bachmann1234/diff_cover/pull/271

+ Patch:          271.patch

+ 

  BuildRequires: git

  BuildRequires: help2man

  BuildRequires: python3-devel
@@ -57,7 +61,7 @@ 

  

  

  %prep

- %autosetup -n diff_cover-%{version}

+ %autosetup -n diff_cover-%{version} -p1

  

  %generate_buildrequires

  %pyproject_buildrequires
@@ -98,6 +102,9 @@ 

  %{_bindir}/diff-quality

  

  %changelog

+ * Mon Feb 07 2022 Karolina Surma <ksurma@redhat.com> - 6.4.2-3

+ - Fix failing Pygments test. Fixes rhbz#2042301

+ 

  * Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 6.4.4-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

  

As Pygments 2.11.2 is heading to Rawhide, I'd like to ensure python-diff-cover builds on top of them. I backported a commit from an open upstream PR to fix the test output and verified in the testing Copr repository this indeed fixes the issue. The build will probably fail with the current Pygments version though. I'll let you know once Pygments update is delivered to Rawhide, to merge and build this PR.

Sounds reasonable. Indeed it currently fails to build.

Pygments has landed in Rawhide, let's check what the Ci thinks of that.

I checked how this looks upstream, but no changes - it's still an open PR.
CI is green, so I gather this is ready to go.

@kevin, can you merge this PR and the one against F36? Do you need anything else from my side to make it happen?

Can do, thanks for the reminder.

Pull-Request has been merged by kevin

2 years ago
Metadata