forked from pool/python-PySDL2
Accepting request 963269 from home:bnavigator:branches:devel:languages:python
- Update to version 0.9.11 * Added bindings for new functions and constants introduced in SDL2 2.0.20 * Added bindings and documentation for new functions and constants introduced in SDL2_ttf 2.0.18 - Changelog for Release 0.9.10 * Added bindings for new functions and constants introduced in SDL2 2.0.18 * Added experimental support for SDL 2.0.3 and 2.0.4 for older platforms (tested on an iMac G4 running 10.4.11) * Major improvements to the ext.pixelaccess module * Major rewrite of the ext.image module * New object-oriented method of rendering with sdl2.ext.Renderers using the new sdl2.ext.Texture class * Major expansion and rewrite of the sdl2.ext.Renderer class * New powerful sdl2.ext.FontTTF class for font rendering * Redocumented most of the sdl2.ext modules for better clarity and maintainability * Added automatic detection of Homebrew SDL2 binaries on Apple Silicon Macs as a fallback Deprecated a number of sdl2.ext modules and functions - Changelog for Release 0.9.9 * Added bindings for new functions and constants introduced in SDL2 2.0.16 * Reverted the fix for issue #139 which inadvertently caused Window.show() to force the window to use SDL2's software rendering, breaking the Renderer class and compatibility with PyOpenGL. - Drop PySDL2-pr193-skipnumpy.patch - Clean out test suite OBS-URL: https://build.opensuse.org/request/show/963269 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PySDL2?expand=0&rev=14
This commit is contained in:
3
PySDL2-0.9.11.tar.gz
Normal file
3
PySDL2-0.9.11.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:93e51057d39fd583b80001d42b21d5a3f71e30d489d85924d944b2c7350e2da6
|
||||
size 736026
|
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4dfa3168e4e4e9301a2cd5904bdcea15e2bf62a1c9abb5d3f92d9122ea22c26e
|
||||
size 742279
|
@@ -1,70 +0,0 @@
|
||||
From ebe6ca1b97a080c229ee80cfdd82d35663851f27 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Greiner <code@bnavigator.de>
|
||||
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)
|
@@ -1,3 +1,37 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 20 09:55:17 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
- Update to version 0.9.11
|
||||
* Added bindings for new functions and constants introduced in
|
||||
SDL2 2.0.20
|
||||
* Added bindings and documentation for new functions and
|
||||
constants introduced in SDL2_ttf 2.0.18
|
||||
- Changelog for Release 0.9.10
|
||||
* Added bindings for new functions and constants introduced in
|
||||
SDL2 2.0.18
|
||||
* Added experimental support for SDL 2.0.3 and 2.0.4 for older
|
||||
platforms (tested on an iMac G4 running 10.4.11)
|
||||
* Major improvements to the ext.pixelaccess module
|
||||
* Major rewrite of the ext.image module
|
||||
* New object-oriented method of rendering with sdl2.ext.Renderers
|
||||
using the new sdl2.ext.Texture class
|
||||
* Major expansion and rewrite of the sdl2.ext.Renderer class
|
||||
* New powerful sdl2.ext.FontTTF class for font rendering
|
||||
* Redocumented most of the sdl2.ext modules for better clarity
|
||||
and maintainability
|
||||
* Added automatic detection of Homebrew SDL2 binaries on Apple
|
||||
Silicon Macs as a fallback Deprecated a number of sdl2.ext
|
||||
modules and functions
|
||||
- Changelog for Release 0.9.9
|
||||
* Added bindings for new functions and constants introduced in
|
||||
SDL2 2.0.16
|
||||
* Reverted the fix for issue #139 which inadvertently caused
|
||||
Window.show() to force the window to use SDL2's software
|
||||
rendering, breaking the Renderer class and compatibility with
|
||||
PyOpenGL.
|
||||
- Drop PySDL2-pr193-skipnumpy.patch
|
||||
- Clean out test suite
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Aug 29 10:31:04 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-PySDL2
|
||||
#
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -19,14 +19,12 @@
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%define X_display ":98"
|
||||
Name: python-PySDL2
|
||||
Version: 0.9.8
|
||||
Version: 0.9.11
|
||||
Release: 0
|
||||
Summary: Python SDL2 bindings
|
||||
Summary: Python ctypes wrapper around SDL2
|
||||
License: SUSE-Public-Domain
|
||||
URL: https://github.com/marcusva/py-sdl2
|
||||
URL: https://github.com/py-sdl/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
|
||||
@@ -36,10 +34,10 @@ BuildRequires: SDL2_ttf >= 2.0.14
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module opengl}
|
||||
BuildRequires: %{python_module numpy}
|
||||
BuildRequires: %{python_module Pillow}
|
||||
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
|
||||
@@ -50,9 +48,10 @@ BuildArch: noarch
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
PySDL2 is a wrapper around the SDL2 library and as such similar to the
|
||||
discontinued PySDL project. In contrast to PySDL, it has no licensing
|
||||
restrictions, nor does it rely on C code, but uses ctypes instead.
|
||||
PySDL2 is a pure Python wrapper around the SDL2, SDL2_mixer, SDL2_image,
|
||||
SDL2_ttf, and SDL2_gfx libraries. Instead of relying on C code, it uses
|
||||
the built-in ctypes module to interface with SDL2, and provides simple
|
||||
Python classes and wrappers for common SDL2 functionality.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n PySDL2-%{version}
|
||||
@@ -75,22 +74,27 @@ Xvfb %{X_display} >& Xvfb.log &
|
||||
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))"
|
||||
# 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
|
||||
export SDL_VIDEODRIVER=dummy
|
||||
export SDL_AUDIODRIVER=dummy
|
||||
export SDL_RENDER_DRIVER=software
|
||||
export PYTHONFAULTHANDLER=1
|
||||
|
||||
donttest="pytest_k_dummyprefix"
|
||||
# color mismatches, test shell variable because this is a noarch package
|
||||
if [ "$RPM_ARCH" = "ppc64" -o "$RPM_ARCH" = "ppc64le" -o "$RPM_ARCH" = "s390x" ]; then
|
||||
donttest="$donttest or sdl2ext"
|
||||
fi
|
||||
# Does not recognize big endian byteorder
|
||||
if [ $(python3 -c "import sys; print(sys.byteorder)") = "big" ]; then
|
||||
donttest="$donttest or PixelFormatEnum"
|
||||
fi
|
||||
%if 0%{suse_version} < 1550
|
||||
# Segfault with SDL on Leap
|
||||
donttest="$donttest or test_SDL_GetPowerInfo"
|
||||
# python2 env different, pytest arg missing
|
||||
python2_donttest=" or test_SDL_GetBasePath or test_render_on"
|
||||
%endif
|
||||
%pytest -rfEs -k "not ($donttest ${$python_donttest})"
|
||||
|
||||
%files %{python_files}
|
||||
%license COPYING.txt
|
||||
|
Reference in New Issue
Block a user