forked from pool/python-PySDL2
		
	Accepting request 1098896 from home:munix9:branches:devel:languages:python
- Update to 0.9.16:
  * Updated to wrap new functions and constants in SDL 2.28.0.
  * Added a new method to sdl2.ext.Renderer, Renderer.rcopy(), for
    drawing textures to the renderer with relative alignment.
  * Added a new module, sdl2.ext.input for processing common SDL
    input events in a Pythonic manner.
  * Added a new function sdl2.ext.quit_requested() for checking
    whether an SDL event queue contains any sdl2.SDL_QUIT events.
- Update to 0.9.15:
  * Updated to wrap new functions and constants in SDL 2.26.0.
  * Added a new module sdl2.ext.mouse for showing/hiding/moving/
    retrieving the mouse cursor and querying the current state of
    the mouse buttons.
  * Added indexing/unpacking support to the sdl2.ext.Point and
    sdl2.ext.Rect classes and their float equivalents.
  * Updated sdl2.ext.SpriteFactory.from_image() to allow passing
    PIL.Image.Image objects directly.
  * Improved sdl2.ext.Texture performance.
  * Fixed a bug preventing SDL Points and Rects from being used
    as srcrect or dstrect for sdl2.ext.Renderer.copy().
  * Added a binding for SDL_ResetHint, which was added in SDL
    2.24.0 but got missed in PR #246.
- Adjust fix-tests.patch
- Remove fix-version_test.patch (fixed upstream)
- Remove python-PySDL2.rpmlintrc (obsolete)
OBS-URL: https://build.opensuse.org/request/show/1098896
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PySDL2?expand=0&rev=27
			
			
This commit is contained in:
		| @@ -1,3 +0,0 @@ | ||||
| version https://git-lfs.github.com/spec/v1 | ||||
| oid sha256:24091f8d9e437646591c7f76d5baeee3d3aa6cd8ae492a51c7026e53389f187a | ||||
| size 761137 | ||||
							
								
								
									
										3
									
								
								PySDL2-0.9.16.tar.gz
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								PySDL2-0.9.16.tar.gz
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| version https://git-lfs.github.com/spec/v1 | ||||
| oid sha256:1027406badbecdd30fe56e800a5a76ad7d7271a3aec0b7acf780ee26a00f2d40 | ||||
| size 773537 | ||||
							
								
								
									
										120
									
								
								fix-tests.patch
									
									
									
									
									
								
							
							
						
						
									
										120
									
								
								fix-tests.patch
									
									
									
									
									
								
							| @@ -1,105 +1,17 @@ | ||||
| Index: PySDL2-0.9.14/sdl2/test/conftest.py | ||||
| =================================================================== | ||||
| --- PySDL2-0.9.14.orig/sdl2/test/conftest.py | ||||
| +++ PySDL2-0.9.14/sdl2/test/conftest.py | ||||
| @@ -13,7 +13,8 @@ SKIP_ANNOYING = os.getenv("PYSDL2_ALL_TE | ||||
|  def with_sdl(): | ||||
|      sdl2.SDL_ClearError() | ||||
|      ret = sdl2.SDL_Init(sdl2.SDL_INIT_VIDEO | sdl2.SDL_INIT_TIMER) | ||||
| -    assert sdl2.SDL_GetError() == b"" | ||||
| --- a/sdl2/test/hidapi_test.py | ||||
| +++ b/sdl2/test/hidapi_test.py | ||||
| @@ -38,10 +38,12 @@ def test_SDL_hid_device_change_count(hid | ||||
|   | ||||
|  def test_SDL_hid_enumerate(hidapi_setup): | ||||
|      devices = sdl2.SDL_hid_enumerate(0, 0) | ||||
| -    assert SDL_GetError() == b"" | ||||
| +    # Ignore errors like Unable to open /dev/input/... | ||||
| +    # assert sdl2.SDL_GetError() == b"" | ||||
|      assert ret == 0 | ||||
|      yield | ||||
|      sdl2.SDL_Quit() | ||||
| Index: PySDL2-0.9.14/sdl2/test/audio_test.py | ||||
| =================================================================== | ||||
| --- PySDL2-0.9.14.orig/sdl2/test/audio_test.py | ||||
| +++ PySDL2-0.9.14/sdl2/test/audio_test.py | ||||
| @@ -23,7 +23,8 @@ def with_sdl_audio(): | ||||
|      sdl2.SDL_Quit() | ||||
|      sdl2.SDL_ClearError() | ||||
|      ret = sdl2.SDL_Init(sdl2.SDL_INIT_VIDEO | sdl2.SDL_INIT_AUDIO) | ||||
| -    assert sdl2.SDL_GetError() == b"" | ||||
| +    # Ignore errors like Unable to open /dev/input/... | ||||
| +    # assert sdl2.SDL_GetError() == b"" | ||||
|      assert ret == 0 | ||||
|      yield | ||||
|      sdl2.SDL_Quit() | ||||
| Index: PySDL2-0.9.14/sdl2/test/hints_test.py | ||||
| =================================================================== | ||||
| --- PySDL2-0.9.14.orig/sdl2/test/hints_test.py | ||||
| +++ PySDL2-0.9.14/sdl2/test/hints_test.py | ||||
| @@ -9,7 +9,8 @@ from sdl2.stdinc import SDL_TRUE, SDL_FA | ||||
|  def with_sdl(): | ||||
|      sdl2.SDL_ClearError() | ||||
|      ret = sdl2.SDL_Init(sdl2.SDL_INIT_VIDEO) | ||||
| -    assert sdl2.SDL_GetError() == b"" | ||||
| +    # Ignore errors like Unable to open /dev/input/... | ||||
| +    # assert sdl2.SDL_GetError() == b"" | ||||
|      assert ret == 0 | ||||
|      yield | ||||
|      sdl2.SDL_Quit() | ||||
| Index: PySDL2-0.9.14/sdl2/test/sdlmixer_test.py | ||||
| =================================================================== | ||||
| --- PySDL2-0.9.14.orig/sdl2/test/sdlmixer_test.py | ||||
| +++ PySDL2-0.9.14/sdl2/test/sdlmixer_test.py | ||||
| @@ -32,7 +32,8 @@ def with_sdl_mixer(): | ||||
|      # Initialize SDL2 with video and audio subsystems | ||||
|      sdl2.SDL_ClearError() | ||||
|      ret = sdl2.SDL_Init(sdl2.SDL_INIT_VIDEO | sdl2.SDL_INIT_AUDIO) | ||||
| -    assert sdl2.SDL_GetError() == b"" | ||||
| +    # Ignore errors like Unable to open /dev/input/... | ||||
| +    # assert sdl2.SDL_GetError() == b"" | ||||
|      assert ret == 0 | ||||
|      # Initialize SDL_mixer and open an audio device | ||||
|      flags = ( | ||||
| Index: PySDL2-0.9.14/sdl2/test/touch_test.py | ||||
| =================================================================== | ||||
| --- PySDL2-0.9.14.orig/sdl2/test/touch_test.py | ||||
| +++ PySDL2-0.9.14/sdl2/test/touch_test.py | ||||
| @@ -18,7 +18,8 @@ def with_sdl(): | ||||
|      sdl2.SDL_SetHint(sdl2.SDL_HINT_MOUSE_TOUCH_EVENTS, b"1") | ||||
|      sdl2.SDL_ClearError() | ||||
|      ret = sdl2.SDL_Init(sdl2.SDL_INIT_VIDEO) | ||||
| -    assert sdl2.SDL_GetError() == b"" | ||||
| +    # Ignore errors like Unable to open /dev/input/... | ||||
| +    # assert sdl2.SDL_GetError() == b"" | ||||
|      assert ret == 0 | ||||
|      yield | ||||
|      sdl2.SDL_Quit() | ||||
| @@ -86,4 +87,4 @@ def test_SDL_GetTouchFinger(): | ||||
|              assert finger.contents.id >= 0 | ||||
|              assert 0 <= finger.contents.x <= 1 | ||||
|              assert 0 <= finger.contents.y <= 1 | ||||
| -                 | ||||
| \ No newline at end of file | ||||
| +                 | ||||
| Index: PySDL2-0.9.14/sdl2/test/sdl_test.py | ||||
| =================================================================== | ||||
| --- PySDL2-0.9.14.orig/sdl2/test/sdl_test.py | ||||
| +++ PySDL2-0.9.14/sdl2/test/sdl_test.py | ||||
| @@ -40,7 +40,8 @@ def test_SDL_Init(): | ||||
|  def test_SDL_InitSubSystem(): | ||||
|      sdl2.SDL_ClearError() | ||||
|      ret = sdl2.SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) | ||||
| -    assert sdl2.SDL_GetError() == b"" | ||||
| +    # Ignore errors like Unable to open /dev/input/... | ||||
| +    # assert sdl2.SDL_GetError() == b"" | ||||
|      assert ret == 0 | ||||
|      # Test initializing an additional subsystem | ||||
|      assert sdl2.SDL_WasInit(0) & SDL_INIT_TIMER != SDL_INIT_TIMER | ||||
| Index: PySDL2-0.9.14/sdl2/test/video_test.py | ||||
| =================================================================== | ||||
| --- PySDL2-0.9.14.orig/sdl2/test/video_test.py | ||||
| +++ PySDL2-0.9.14/sdl2/test/video_test.py | ||||
| @@ -194,7 +194,8 @@ def test_SDL_VideoInitQuit(): | ||||
|      # Test with default driver | ||||
|      assert sdl2.SDL_WasInit(0) & sdl2.SDL_INIT_VIDEO != sdl2.SDL_INIT_VIDEO | ||||
|      ret = sdl2.SDL_VideoInit(None) | ||||
| -    assert sdl2.SDL_GetError() == b"" | ||||
| +    # Ignore errors like Unable to open /dev/input/... | ||||
| +    # assert sdl2.SDL_GetError() == b"" | ||||
|      assert ret == 0 | ||||
|      assert sdl2.SDL_GetCurrentVideoDriver() # If initialized, should be string | ||||
|      sdl2.SDL_VideoQuit() | ||||
| +    #assert SDL_GetError() == b"" | ||||
|      if devices != None: | ||||
|          sdl2.SDL_hid_free_enumeration(devices) | ||||
| -        assert SDL_GetError() == b"" | ||||
| +        # Ignore errors like Unable to open /dev/input/... | ||||
| +        #assert SDL_GetError() == b"" | ||||
|   | ||||
|   | ||||
|  @pytest.mark.skip("not implemented") | ||||
|   | ||||
| @@ -1,37 +0,0 @@ | ||||
| From ffa8853517cc72afefc8205db675fdf44d519159 Mon Sep 17 00:00:00 2001 | ||||
| From: Simon McVittie <smcv@collabora.com> | ||||
| Date: Wed, 2 Nov 2022 23:21:54 +0000 | ||||
| Subject: [PATCH] version_test: Don't assert that SDL_GetRevision() starts with | ||||
|  http (#249) | ||||
|  | ||||
| The default format is going to change in 2.25.x, and in git main it | ||||
| currently starts with "SDL-". | ||||
|  | ||||
| SDL specifically documents the result of this function as "not intended | ||||
| to be reliable in any way", so it seems wrong to have pysdl2's tests fail | ||||
| whenever the format changes. To address that, turn unexpected formats | ||||
| into an xfail, so that they're flagged as something to investigate but | ||||
| do not make the unit tests fail when used as a QA gate. | ||||
|  | ||||
| Closes: https://github.com/py-sdl/py-sdl2/issues/248 | ||||
| Signed-off-by: Simon McVittie <smcv@collabora.com> | ||||
|  | ||||
| Signed-off-by: Simon McVittie <smcv@collabora.com> | ||||
| --- | ||||
|  sdl2/test/version_test.py | 3 ++- | ||||
|  1 file changed, 2 insertions(+), 1 deletion(-) | ||||
|  | ||||
| diff --git a/sdl2/test/version_test.py b/sdl2/test/version_test.py | ||||
| index 8a327e1..4c4f54c 100644 | ||||
| --- a/sdl2/test/version_test.py | ||||
| +++ b/sdl2/test/version_test.py | ||||
| @@ -57,7 +57,8 @@ def test_SDL_GetRevision(): | ||||
|      # If revision not empty string (e.g. Conda), test the prefix | ||||
|      if len(rev): | ||||
|          if dll.version_tuple >= (2, 0, 16): | ||||
| -            assert rev[0:4] == b"http" | ||||
| +            if rev[0:4] not in (b"http", b"SDL-"): | ||||
| +                pytest.xfail("no API guarantee about the format of this string") | ||||
|          else: | ||||
|              assert rev[0:3] == b"hg-" | ||||
|   | ||||
| @@ -1,3 +1,34 @@ | ||||
| ------------------------------------------------------------------- | ||||
| Sun Jul 16 06:08:53 UTC 2023 - munix9@googlemail.com | ||||
|  | ||||
| - Update to 0.9.16: | ||||
|   * Updated to wrap new functions and constants in SDL 2.28.0. | ||||
|   * Added a new method to sdl2.ext.Renderer, Renderer.rcopy(), for | ||||
|     drawing textures to the renderer with relative alignment. | ||||
|   * Added a new module, sdl2.ext.input for processing common SDL | ||||
|     input events in a Pythonic manner. | ||||
|   * Added a new function sdl2.ext.quit_requested() for checking | ||||
|     whether an SDL event queue contains any sdl2.SDL_QUIT events. | ||||
|  | ||||
| - Update to 0.9.15: | ||||
|   * Updated to wrap new functions and constants in SDL 2.26.0. | ||||
|   * Added a new module sdl2.ext.mouse for showing/hiding/moving/ | ||||
|     retrieving the mouse cursor and querying the current state of | ||||
|     the mouse buttons. | ||||
|   * Added indexing/unpacking support to the sdl2.ext.Point and | ||||
|     sdl2.ext.Rect classes and their float equivalents. | ||||
|   * Updated sdl2.ext.SpriteFactory.from_image() to allow passing | ||||
|     PIL.Image.Image objects directly. | ||||
|   * Improved sdl2.ext.Texture performance. | ||||
|   * Fixed a bug preventing SDL Points and Rects from being used | ||||
|     as srcrect or dstrect for sdl2.ext.Renderer.copy(). | ||||
|   * Added a binding for SDL_ResetHint, which was added in SDL | ||||
|     2.24.0 but got missed in PR #246. | ||||
|  | ||||
| - Adjust fix-tests.patch | ||||
| - Remove fix-version_test.patch (fixed upstream) | ||||
| - Remove python-PySDL2.rpmlintrc (obsolete) | ||||
|  | ||||
| ------------------------------------------------------------------- | ||||
| Sat Nov 26 14:51:13 UTC 2022 - munix9@googlemail.com | ||||
|  | ||||
|   | ||||
| @@ -1 +0,0 @@ | ||||
| addFilter("E: python-tests-in-package.*/usr/lib/.*/site-packages/sdl2/test") | ||||
| @@ -1,7 +1,7 @@ | ||||
| # | ||||
| # spec file for package python-PySDL2 | ||||
| # | ||||
| # Copyright (c) 2022 SUSE LLC | ||||
| # Copyright (c) 2023 SUSE LLC | ||||
| # | ||||
| # All modifications and additions to the file contributed by third parties | ||||
| # remain the property of their copyright owners, unless otherwise agreed | ||||
| @@ -18,17 +18,14 @@ | ||||
|  | ||||
| %define         X_display         ":98" | ||||
| Name:           python-PySDL2 | ||||
| Version:        0.9.14 | ||||
| Version:        0.9.16 | ||||
| Release:        0 | ||||
| Summary:        Python ctypes wrapper around SDL2 | ||||
| License:        SUSE-Public-Domain | ||||
| URL:            https://github.com/py-sdl/py-sdl2 | ||||
| Source:         https://files.pythonhosted.org/packages/source/P/PySDL2/PySDL2-%{version}.tar.gz | ||||
| Source99:       python-PySDL2.rpmlintrc | ||||
| # PATCH-FIX-OPENSUSE fix-tests.patch to make test work in chroot env without access to /dev/input | ||||
| Patch0:         fix-tests.patch | ||||
| # PATCH-FIX-UPSTREAM fix-version_test.patch gh#py-sdl/py-sdl2#248 | ||||
| Patch1:         fix-version_test.patch | ||||
| BuildRequires:  %{python_module pip} | ||||
| BuildRequires:  %{python_module setuptools} | ||||
| BuildRequires:  %{python_module wheel} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user