diff --git a/PySDL2-0.9.7.tar.gz b/PySDL2-0.9.7.tar.gz deleted file mode 100644 index 8c21d9e..0000000 --- a/PySDL2-0.9.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4fcc8aa1108e4917cb56794575ee08c2a3d9c2c52620474e3ecc8538dadf209 -size 1079253 diff --git a/PySDL2-0.9.8.tar.gz b/PySDL2-0.9.8.tar.gz new file mode 100644 index 0000000..b7b9a8f --- /dev/null +++ b/PySDL2-0.9.8.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4dfa3168e4e4e9301a2cd5904bdcea15e2bf62a1c9abb5d3f92d9122ea22c26e +size 742279 diff --git a/PySDL2-pr193-skipnumpy.patch b/PySDL2-pr193-skipnumpy.patch new file mode 100644 index 0000000..e6db39a --- /dev/null +++ b/PySDL2-pr193-skipnumpy.patch @@ -0,0 +1,70 @@ +From ebe6ca1b97a080c229ee80cfdd82d35663851f27 Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Sun, 29 Aug 2021 13:17:22 +0200 +Subject: [PATCH] Skip tests when numpy is not available + +--- + sdl2/test/sdl2ext_draw_test.py | 7 +++++++ + sdl2/test/sdl2ext_font_test.py | 4 ++-- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/sdl2/test/sdl2ext_draw_test.py b/sdl2/test/sdl2ext_draw_test.py +index 63ff360..ac11bc8 100644 +--- a/sdl2/test/sdl2ext_draw_test.py ++++ b/sdl2/test/sdl2ext_draw_test.py +@@ -6,6 +6,11 @@ + from sdl2.ext.compat import ExperimentalWarning + from sdl2 import ext as sdl2ext + ++try: ++ import numpy ++ _HASNUMPY = True ++except: ++ _HASNUMPY = False + + class TestSDL2ExtDraw(object): + __tags__ = ["sdl", "sdl2ext"] +@@ -21,6 +26,7 @@ def setup_class(cls): + def teardown_class(cls): + sdl2ext.quit() + ++ @pytest.mark.skipif(not _HASNUMPY, reason="pixels3d requires numpy module") + def test_fill(self): + # Initialize colour and surface/view + WHITE = (255, 255, 255) +@@ -63,6 +69,7 @@ def test_fill(self): + with pytest.raises(ValueError): + sdl2ext.fill(sf.contents, WHITE, (1, 2, 3)) + ++ @pytest.mark.skipif(not _HASNUMPY, reason="pixels3d requires numpy module") + def test_line(self): + # Initialize colour and surface/view + WHITE = (255, 255, 255) +diff --git a/sdl2/test/sdl2ext_font_test.py b/sdl2/test/sdl2ext_font_test.py +index 8ad8000..a9acde5 100644 +--- a/sdl2/test/sdl2ext_font_test.py ++++ b/sdl2/test/sdl2ext_font_test.py +@@ -1,6 +1,5 @@ + # -*- coding: utf-8 -*- + import pytest +-import numpy as np + from sdl2 import ext as sdl2ext + from sdl2.ext.compat import byteify, ExperimentalWarning + from sdl2.ext.pixelaccess import pixels2d +@@ -46,7 +45,7 @@ def test_BitmapFont(self): + # Try SDL_Surface surface + font = sdl2ext.BitmapFont(sf.contents, (32, 32), FONTMAP) + assert font.size == (32, 32) +- ++ + # Try SDL_Surface pointer surface + font = sdl2ext.BitmapFont(sf, (32, 32), FONTMAP) + assert font.size == (32, 32) +@@ -72,6 +71,7 @@ def test_BitmapFont_render(self): + font.render("this_should_fail") + + def test_BitmapFont_render_on(self): ++ np = pytest.importorskip("numpy", reason="numpy module is not available") + # Initialize font, surface, and BitmapFont for tests + fontpath = byteify(RESOURCES.get_path("font.bmp"), "utf-8") + sf = surface.SDL_LoadBMP(fontpath) diff --git a/python-PySDL2.changes b/python-PySDL2.changes index 27b1d34..1f20528 100644 --- a/python-PySDL2.changes +++ b/python-PySDL2.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Sun Aug 29 10:31:04 UTC 2021 - Ben Greiner + +- Update to version 0.9.8 + * This release fixes a number of bugs, updates the bindings to + support new functions in SDL2 2.0.14, adds a wrapper for the + SDL2 MessageBox API, and more. + * Added bindings for new functions and constants introduced in + SDL2 2.0.12 and 2.0.14 + * Added full support for SDL2 binaries in non-system locations + (e.g., with pysdl2-dll) when using PySDL2 with Python installed + from the Microsoft Store on Windows. + * Improved handling of SDL2 binaries that are too old to be used + with PySDL2. + * Added a new sdl2.ext API for displaying SDL2 MessageBox alerts + and dialog boxes. +- Add PySDL2-pr193-skipnumpy.patch (gh#marcusva/py-sdl2#193) for + missing NumPy in python36 + ------------------------------------------------------------------- Mon Feb 8 22:45:09 UTC 2021 - Ben Greiner diff --git a/python-PySDL2.spec b/python-PySDL2.spec index 46accb9..082a2f5 100644 --- a/python-PySDL2.spec +++ b/python-PySDL2.spec @@ -19,12 +19,14 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define X_display ":98" Name: python-PySDL2 -Version: 0.9.7 +Version: 0.9.8 Release: 0 Summary: Python SDL2 bindings License: SUSE-Public-Domain URL: https://github.com/marcusva/py-sdl2 Source: https://files.pythonhosted.org/packages/source/P/PySDL2/PySDL2-%{version}.tar.gz +# PATCH-FIX-UPSTREAM PySDL2-pr193-skipnumpy.patch -- gh#marcusva/py-sdl2#193 +Patch0: https://github.com/marcusva/py-sdl2/pull/193.patch#/PySDL2-pr193-skipnumpy.patch BuildRequires: %{python_module setuptools} BuildRequires: SDL2 >= 2.0.5 BuildRequires: SDL2_gfx >= 1.0.3 @@ -37,6 +39,7 @@ BuildRequires: python-rpm-macros BuildRequires: %{python_module opengl} BuildRequires: %{python_module pytest} BuildRequires: xorg-x11-server +BuildRequires: %{python_module numpy if (%python-base without python36-base)} # /SECTION Requires: SDL2 >= 2.0.5 Requires: SDL2_gfx >= 1.0.3 @@ -52,7 +55,7 @@ discontinued PySDL project. In contrast to PySDL, it has no licensing restrictions, nor does it rely on C code, but uses ctypes instead. %prep -%setup -q -n PySDL2-%{version} +%autosetup -p1 -n PySDL2-%{version} sed -i 's/\r$//' AUTHORS.txt COPYING.txt README.md %build @@ -73,13 +76,20 @@ trap "kill $! || true" EXIT sleep 10 pushd sdl2/test +# these segfault when not tested separately +testextra="SpriteFactory or SDL2EXTSprite or test_SDL_GL" # we do not have audio devices in build environment donttest+=" or test_Mix_OpenAudio or test_SDL_GetNumAudioDevices or TestSDLMixer" # we get border size 0 in build "desktop" environment donttest+=" or test_SDL_GetWindowsBordersSize" # flaky segfaults donttest+=" or (TestSDL2ExtWindow and (test_Window_position or test_Window_size))" -%pytest -k "not (${donttest:4})" +# test suite assumes SDL devel version from mercurial (hg) checkout +donttest+=" or test_SDL_GetRevision" +# python2 env on Leap different, pytest arg missing +python2_donttest="or test_SDL_GetBasePath or test_BitmapFont_render_on" +%pytest -rfEs -k "not (${testextra} ${donttest} ${$python_donttest})" +%pytest -rfEs -k "${testextra}" popd %files %{python_files}