From 45ba8fa1937101b73184c5c7fd3f8a8c488d0528 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Sat, 17 Jun 2023 08:17:36 -0600 Subject: [PATCH] Update to 1.5.27 Add patch for Python 3.12 support Use SPDX License --- .gitignore | 1 + python-pyglet-imp.patch | 21 +++++++++++++++++++++ python-pyglet.spec | 19 ++++++++++++++++--- sources | 2 +- 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 python-pyglet-imp.patch diff --git a/.gitignore b/.gitignore index bd8b7e2..0022dd0 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /pyglet-1.5.16.tar.gz /pyglet-1.5.16-repacked.tar.gz /pyglet-1.5.23-repacked.tar.gz +/pyglet-1.5.27-repacked.tar.gz diff --git a/python-pyglet-imp.patch b/python-pyglet-imp.patch new file mode 100644 index 0000000..0ceed8a --- /dev/null +++ b/python-pyglet-imp.patch @@ -0,0 +1,21 @@ +diff -up pyglet-1.5.27/tests/integration/test_toplevel_imports.py.imp pyglet-1.5.27/tests/integration/test_toplevel_imports.py +--- pyglet-1.5.27/tests/integration/test_toplevel_imports.py.imp 2023-06-17 07:55:27.061254060 -0600 ++++ pyglet-1.5.27/tests/integration/test_toplevel_imports.py 2023-06-17 08:01:50.139739485 -0600 +@@ -5,7 +5,7 @@ + This _must_ be the first test run. + ''' + +-import imp ++import importlib + import unittest + + import pyglet +@@ -47,7 +47,7 @@ def add_module_tests(name, bases, dict): + def create_test(components): + def test_module(self): + top = pyglet +- imp.reload(top) ++ importlib.reload(top) + for component in components: + self.assertTrue(hasattr(top, component), + 'Cannot access "%s" in "%s"' % (component, top.__name__)) diff --git a/python-pyglet.spec b/python-pyglet.spec index e617c15..30a02d8 100644 --- a/python-pyglet.spec +++ b/python-pyglet.spec @@ -4,11 +4,11 @@ %bcond_without tests Name: python-%{srcname} -Version: 1.5.23 -Release: 5%{?dist} +Version: 1.5.27 +Release: 1%{?dist} Summary: A cross-platform windowing and multimedia library for Python -License: BSD +License: BSD-3-Clause URL: http://www.pyglet.org/ # The upstream tarball includes some non-free files in the examples and tests, @@ -20,6 +20,9 @@ URL: http://www.pyglet.org/ Source0: %{versionedname}-repacked.tar.gz Source1: pyglet-get-tarball.sh +# Use importlib instead of imp +Patch0: python-pyglet-imp.patch + # Note that unbundling pypng removes "PNGImageDecoder", which is normally # available for advanced use cases. Instead of: # img = image.load(fname, decoder=PNGImageDecoder) # don't use! @@ -41,6 +44,9 @@ BuildRequires: pyproject-rpm-macros %if %{with tests} BuildRequires: /usr/bin/xvfb-run mesa-dri-drivers BuildRequires: python3-pytest +# These two for gdkpixbuf2 tests +BuildRequires: gtk2-devel +BuildRequires: gdk-pixbuf2-devel # libpurple has sound files unbundled in the repacked tarball BuildRequires: libpurple %endif @@ -129,6 +135,7 @@ ln -s %{_datadir}/sounds/purple/*.wav tests/data/media/ # test_find_font_match & test_have_font skipped -- they look for a font named 'arial' # test_freetype_face tests are is skipped -- they depend on non-free font we remove # test_push_handlers_instance has broken mocking: https://github.com/pyglet/pyglet/issues/606 +# GdkPixBufTest.test_load_animation uses dinosaur.gif which we remove %pytest \ -vv \ --non-interactive \ @@ -136,6 +143,7 @@ ln -s %{_datadir}/sounds/purple/*.wav tests/data/media/ --ignore=tests/integration/media \ -m 'not (requires_user_action or requires_user_validation or only_interactive)' \ -k 'not (test_find_font_match or test_have_font or test_freetype_face or test_push_handlers_instance)' \ + --deselect tests/integration/image/test_gdkpixbuf2.py::GdkPixBufTest::test_load_animation \ tests %endif @@ -148,6 +156,11 @@ ln -s %{_datadir}/sounds/purple/*.wav tests/data/media/ %changelog +* Sat Jun 17 2023 Orion Poplawski - 1.5.27-1 +- Update to 1.5.27 +- Add patch for Python 3.12 support +- Use SPDX License + * Fri Jun 16 2023 Python Maint - 1.5.23-5 - Rebuilt for Python 3.12 diff --git a/sources b/sources index 93282d8..102f0ab 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pyglet-1.5.23-repacked.tar.gz) = 3385bcfe93ed3b50e1fd8e3c148fc363a72615ece8a2f4ba136df71e480d4c556e0dbd9183911746cdcbe7245aad49f825f6640866e39bd39c204cca6142b3f6 +SHA512 (pyglet-1.5.27-repacked.tar.gz) = 496b1b94bde77e2ddf095d021b0736969abd7e70b5fd24ec56e655c41724aa69201d75c63ffc2196197af1ff822f76341c98baaf71170d3b98f37f535ee86660