Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-PySDL2 for openSUSE:Factory 
checked in at 2026-01-21 14:19:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-PySDL2 (Old)
 and      /work/SRC/openSUSE:Factory/.python-PySDL2.new.1928 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-PySDL2"

Wed Jan 21 14:19:53 2026 rev:17 rq:1328491 version:0.9.17

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-PySDL2/python-PySDL2.changes      
2025-05-07 19:18:27.008167561 +0200
+++ /work/SRC/openSUSE:Factory/.python-PySDL2.new.1928/python-PySDL2.changes    
2026-01-21 14:19:57.309370999 +0100
@@ -1,0 +2,7 @@
+Wed Jan 21 11:12:54 UTC 2026 - Markéta Machová <[email protected]>
+
+- Add upstream PRs fixing test failures:
+  * surface_test.patch
+  * video_test.patch
+
+-------------------------------------------------------------------

New:
----
  surface_test.patch
  video_test.patch

----------(New B)----------
  New:- Add upstream PRs fixing test failures:
  * surface_test.patch
  * video_test.patch
  New:  * surface_test.patch
  * video_test.patch
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-PySDL2.spec ++++++
--- /var/tmp/diff_new_pack.Xbc7ZH/_old  2026-01-21 14:19:58.477419736 +0100
+++ /var/tmp/diff_new_pack.Xbc7ZH/_new  2026-01-21 14:19:58.481419903 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-PySDL2
 #
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,10 @@
 License:        SUSE-Public-Domain
 URL:            https://github.com/py-sdl/py-sdl2
 Source:         
https://files.pythonhosted.org/packages/source/p/%{lname}/%{lname}-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM https://github.com/py-sdl/py-sdl2/pull/290 surface_test: 
Expect intended behaviour if SDL2 is new enough
+Patch0:         surface_test.patch
+# PATCH-FIX-UPSTREAM https://github.com/py-sdl/py-sdl2/pull/291 video_test: 
Skip SDL_SetWindowMouseRect with sdl2-compat dummy driver
+Patch1:         video_test.patch
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module wheel}

++++++ surface_test.patch ++++++
>From a9163d3c134f22add5d672d11d2e2e1ae07e58f1 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Fri, 19 Dec 2025 17:58:01 +0000
Subject: [PATCH] surface_test: Expect intended behaviour if SDL2 is new enough

In older versions of "classic" SDL2, including the 2.32.x series,
intersecting an empty rectangle with another rectangle would have an
empty result (w=0, h=0) with an uninitialized position (x, y arbitrary).
However, SDL upstream considers this to be a bug, and it caused
observable visual issues in some older games when used in conjunction
with sdl12-compat.

This test previously asserted that the clip rectangle would not be equal
to the requested clip rectangle, but that was only true because of
this bug: the uninitialized x and y coordinates were very unlikely to be
equal to the requested rectangle. With the bug fix in sdl2-compat,
the coordinates come out as equal to those that were requested.

If SDL2 is sufficiently new, assert that the comparison result is true
(which is the correct result according to SDL upstream), and if not,
make no assertion (in case the bug fix is backported).

Resolves: https://github.com/py-sdl/py-sdl2/issues/289
Signed-off-by: Simon McVittie <[email protected]>
---
 sdl2/test/surface_test.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/sdl2/test/surface_test.py b/sdl2/test/surface_test.py
index e8740e8..f241846 100644
--- a/sdl2/test/surface_test.py
+++ b/sdl2/test/surface_test.py
@@ -467,13 +467,20 @@ def test_SDL_FreeSurface(self):
             sdl2.SDL_FreeSurface(sf)
 
     def test_SDL_GetSetClipRect(self):
+        # A bug in intersecting empty rectangles was fixed in SDL2 2.33.x
+        # and in sdl2-compat (which reports its version as >= 2.32.50)
+        if sdl2.dll.version_tuple >= (2, 32, 50):
+            true_if_fixed = True
+        else:
+            true_if_fixed = None
+
         rectlist = ((rect.SDL_Rect(0, 0, 0, 0), SDL_FALSE, True),
-                    (rect.SDL_Rect(2, 2, 0, 0), SDL_FALSE, False),
+                    (rect.SDL_Rect(2, 2, 0, 0), SDL_FALSE, true_if_fixed),
                     (rect.SDL_Rect(2, 2, 5, 1), SDL_TRUE, True),
                     (rect.SDL_Rect(6, 5, 10, 3), SDL_TRUE, False),
                     (rect.SDL_Rect(0, 0, 10, 10), SDL_TRUE, True),
-                    (rect.SDL_Rect(0, 0, -10, 10), SDL_FALSE, False),
-                    (rect.SDL_Rect(0, 0, -10, -10), SDL_FALSE, False),
+                    (rect.SDL_Rect(0, 0, -10, 10), SDL_FALSE, true_if_fixed),
+                    (rect.SDL_Rect(0, 0, -10, -10), SDL_FALSE, true_if_fixed),
                     (rect.SDL_Rect(-10, -10, 10, 10), SDL_FALSE, False),
                     (rect.SDL_Rect(10, -10, 10, 10), SDL_FALSE, False),
                     (rect.SDL_Rect(10, 10, 10, 10), SDL_TRUE, False)
@@ -490,7 +497,8 @@ def test_SDL_GetSetClipRect(self):
             sdl2.SDL_GetClipRect(sf, byref(clip))
             err = "Could not set clip rect %s" % r
             assert retval == clipsetval, "retval: " + err
-            assert (clip == r) == cmpval, "clip: " + err
+            if cmpval is not None:
+                assert (clip == r) == cmpval, "clip: " + err
         sdl2.SDL_FreeSurface(sf)
 
     def test_SDL_GetSetSurfaceAlphaMod(self):

++++++ video_test.patch ++++++
>From 96ba83b67daac9d45efb5e5d7d4c904aee8446ac Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Fri, 19 Dec 2025 18:07:02 +0000
Subject: [PATCH] video_test: Skip SDL_SetWindowMouseRect with sdl2-compat
 dummy driver

This driver doesn't implement mouse confinement.

Signed-off-by: Simon McVittie <[email protected]>
---
 sdl2/test/video_test.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sdl2/test/video_test.py b/sdl2/test/video_test.py
index 0b8801f..a216906 100644
--- a/sdl2/test/video_test.py
+++ b/sdl2/test/video_test.py
@@ -730,6 +730,7 @@ def test_SDL_GetGrabbedWindow(window):
     # NOTE: Should implement this once the above tests are fixed
     pass
 
[email protected](DRIVER_DUMMY, reason="Not implemented by dummy driver")
 @pytest.mark.skipif(sdl2.dll.version < 2018, reason="not available")
 def test_SDL_GetSetWindowMouseRect(with_sdl):
     flags = sdl2.SDL_WINDOW_BORDERLESS

Reply via email to