From: "Daniel Meißner via Guix-patches via" <guix-patches@gnu.org>
To: 50505@debbugs.gnu.org
Cc: "Daniel Meißner" <daniel.meissner-i4k@ruhr-uni-bochum.de>,
"Xinglu Chen" <public@yoctocell.xyz>,
"Liliana Marie Prikler" <liliana.prikler@gmail.com>
Subject: [bug#50505] [PATCH v3 08/12] gnu: Add python-moderngl-window.
Date: Sun, 2 Jan 2022 00:51:51 +0100 [thread overview]
Message-ID: <20220101235155.5754-9-daniel.meissner-i4k@ruhr-uni-bochum.de> (raw)
In-Reply-To: <20220101235155.5754-1-daniel.meissner-i4k@ruhr-uni-bochum.de>
* gnu/packages/python-xyz.scm (python-moderngl-window): New variable.
---
gnu/local.mk | 1 +
.../python-moderngl-window-skip-tests.patch | 146 ++++++++++++++++++
gnu/packages/python-xyz.scm | 44 ++++++
3 files changed, 191 insertions(+)
create mode 100644 gnu/packages/patches/python-moderngl-window-skip-tests.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 852f9f3246..ff3e80ea68 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1685,6 +1685,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-magic-python-bytecode.patch \
%D%/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch \
%D%/packages/patches/python-memcached-syntax-warnings.patch \
+ %D%/packages/patches/python-moderngl-window-skip-tests.patch \
%D%/packages/patches/python-mox3-python3.6-compat.patch \
%D%/packages/patches/python-typing-inspect-fix.patch \
%D%/packages/patches/python-packaging-test-arch.patch \
diff --git a/gnu/packages/patches/python-moderngl-window-skip-tests.patch b/gnu/packages/patches/python-moderngl-window-skip-tests.patch
new file mode 100644
index 0000000000..aee4b71e2a
--- /dev/null
+++ b/gnu/packages/patches/python-moderngl-window-skip-tests.patch
@@ -0,0 +1,146 @@
+Skip failing tests and tests for optional dependencies
+
+The Python packages pywavefront and trimesh are optional dependencies and not
+yet packaged in Guix but the tests try to load the modules anyway. Therefore
+skip them.
+
+The tests test_texture_mimpamps, test_texture_abspath, test_load_texture_2d
+and test_load_texture_array fail when Guix builds the package. This is not
+the case when running the tests directly from a source tree.
+
+diff --git a/tests/test_docs.py b/tests/test_docs.py
+index e4a38df..99a2aa0 100644
+--- a/tests/test_docs.py
++++ b/tests/test_docs.py
+@@ -133,20 +133,11 @@ class TestCase(unittest.TestCase):
+
+ # --- Loaders : Scene ---
+
+- def test_loaders_wavefront(self):
+- self.validate('loaders/wavefront.rst', 'moderngl_window.loaders.scene.wavefront', 'Loader')
+-
+ def test_loaders_gltf(self):
+ self.validate('loaders/gltf2.rst', 'moderngl_window.loaders.scene.gltf2', 'Loader')
+
+- def test_loaders_stl(self):
+- self.validate('loaders/wavefront.rst', 'moderngl_window.loaders.scene.stl', 'Loader')
+-
+ # --- Loaders : Program ---
+
+- def test_loader_single(self):
+- self.validate('loaders/single.rst', 'moderngl_window.loaders.program.single', 'Loader')
+-
+ def test_loader_separate(self):
+ self.validate('loaders/separate.rst', 'moderngl_window.loaders.program.separate', 'Loader')
+
+diff --git a/tests/test_loaders_scene.py b/tests/test_loaders_scene.py
+index c577315..2eef889 100644
+--- a/tests/test_loaders_scene.py
++++ b/tests/test_loaders_scene.py
+@@ -16,16 +16,6 @@ class SceneLoadersTestCase(HeadlessTestCase):
+ window_size = (16, 16)
+ aspect_ratio = 1.0
+
+- def test_wavefront(self):
+- """Load wavefront file"""
+- scene = resources.scenes.load(SceneDescription(path='scenes/crate/crate.obj'))
+- self.assertIsInstance(scene, Scene)
+-
+- def test_wavefont_not_found(self):
+- """Ensure ImproperlyConfigured is raised when wavefront is not found"""
+- with self.assertRaises(ImproperlyConfigured):
+- resources.scenes.load(SceneDescription(path='scenes/doesnotexist.obj'))
+-
+ def test_gltf(self):
+ """Load standard gltf"""
+ scene = resources.scenes.load(SceneDescription(path='scenes/BoxTextured/glTF/BoxTextured.gltf'))
+@@ -45,7 +35,3 @@ class SceneLoadersTestCase(HeadlessTestCase):
+ """Attempt to load nonexisting gltf"""
+ with self.assertRaises(ImproperlyConfigured):
+ resources.scenes.load(SceneDescription(path='scenes/doesnotexist.gltf'))
+-
+- def test_stl(self):
+- scene = resources.scenes.load(SceneDescription(path='scenes/uplink.stl'))
+- self.assertIsInstance(scene, Scene)
+diff --git a/tests/test_loaders_texture.py b/tests/test_loaders_texture.py
+index fcd4d72..8e13037 100644
+--- a/tests/test_loaders_texture.py
++++ b/tests/test_loaders_texture.py
+@@ -55,39 +55,3 @@ class TextureLoadersTestCase(HeadlessTestCase):
+ kind='cube',
+ ))
+ self.assertIsInstance(texture, moderngl.TextureCube)
+-
+- def test_texture_mimpamps(self):
+- """Load texture with mipmapping and anisotropy"""
+- desc = TextureDescription(
+- path='textures/crate.png',
+- mipmap_levels=(0, 2),
+- anisotropy=4.0,
+- )
+- texture = resources.textures.load(desc)
+- self.assertEqual(texture.anisotropy, 4.0)
+- self.assertEqual(desc.mipmap, True)
+-
+- # Texture Array
+- desc = TextureDescription(
+- path='textures/array.png',
+- kind="array",
+- layers=10,
+- mipmap_levels=(0, 5),
+- anisotropy=8.0,
+- )
+- texture = resources.textures.load(desc)
+- self.assertEqual(texture.anisotropy, 8.0)
+- self.assertEqual(desc.mipmap, True)
+-
+- def test_texture_abspath(self):
+- """Strip search directories and use absolute path"""
+- path = (Path(__file__).parent / "fixtures/resources/textures/crate.png").resolve()
+- with resources.temporary_dirs([]):
+- desc = TextureDescription(
+- path=path,
+- mipmap_levels=(0, 2),
+- anisotropy=4.0,
+- )
+- texture = resources.textures.load(desc)
+- self.assertEqual(texture.anisotropy, 4.0)
+- self.assertEqual(desc.mipmap, True)
+diff --git a/tests/test_windowconfig.py b/tests/test_windowconfig.py
+index 185c36e..2eb6f39 100644
+--- a/tests/test_windowconfig.py
++++ b/tests/test_windowconfig.py
+@@ -94,31 +94,6 @@ class WindowConfigTestCase(WindowConfigTestCase):
+ with self.assertRaises(ValueError):
+ self.window.resize_func = "Hello"
+
+- def test_load_texture_2d(self):
+- """Load texture with shortcut method"""
+- texture = self.config.load_texture_2d(
+- "textures/crate.png",
+- flip=True,
+- mipmap_levels=(0, 2),
+- anisotropy=4.0,
+- )
+- self.assertIsInstance(texture, moderngl.Texture)
+- self.assertEqual(texture.anisotropy, 4.0)
+-
+- def test_load_texture_array(self):
+- """Load texture array with shortcut method"""
+- texture = self.config.load_texture_array(
+- 'textures/array.png',
+- layers=10,
+- flip=True,
+- mipmap=False,
+- mipmap_levels=(0, 2),
+- anisotropy=4.0,
+- )
+- self.assertIsInstance(texture, moderngl.TextureArray)
+- self.assertEqual(texture.anisotropy, 4.0)
+- self.assertEqual(texture.layers, 10)
+-
+ def test_load_program_single(self):
+ """Load a single glsl program"""
+ prog = self.config.load_program(path='programs/white.glsl')
+--
+2.33.0
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0dbc9db830..eee2fc0077 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19710,6 +19710,50 @@ (define-public python-pyglet
music. All of this with a friendly Pythonic API that's simple to learn.")
(license license:bsd-3)))
+(define-public python-moderngl-window
+ (package
+ (name "python-moderngl-window")
+ (version "2.4.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/moderngl/moderngl-window")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (patches
+ (search-patches "python-moderngl-window-skip-tests.patch"))
+ (sha256
+ (base32
+ "1fvhm6ln3q5kl5m5q3gzfmx1kpyn054fhpcrgpqz8809dxi7pzcv"))))
+ (build-system python-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'fix-test
+ (lambda _
+ (substitute* '("tests/test_windowconfig.py")
+ (("terrain_Vs.glsl") "terrain_vs.glsl"))))
+ (replace 'check
+ (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+ (when tests?
+ (system "Xvfb :1 &")
+ (setenv "DISPLAY" ":1")
+ (add-installed-pythonpath inputs outputs)
+ (invoke "pytest" "tests" )))))))
+ (propagated-inputs
+ (list python-pillow python-pyrr python-numpy python-moderngl
+ python-pyglet))
+ (native-inputs
+ (list python-pytest xorg-server-for-tests))
+ (home-page "https://github.com/moderngl/moderngl-window")
+ (synopsis "Cross-platform utility library for ModernGL")
+ (description "This ModernGL utility library simplifies window creation and
+resource loading. You can create a window for ModernGL using pyglet, pygame,
+PySide2, GLFW, SDL2, PyQt5 or tkinter. Events are unified into a single event
+system. Resource loading includes loading of 2D textures/texture arrays,
+shaders and objects/scenes.")
+ (license license:expat)))
+
(define-public python-screeninfo
(package
(name "python-screeninfo")
--
2.34.0
next prev parent reply other threads:[~2022-01-01 23:54 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 11:22 [bug#50505] [PATCH 00/12] gnu: Add python-manim Daniel Meißner via Guix-patches via
2021-09-10 11:24 ` [bug#50505] [PATCH 01/12] gnu: Add python-cloup Daniel Meißner via Guix-patches via
2021-09-10 11:24 ` [bug#50505] [PATCH 02/12] gnu: Add python-cloup-0.7 Daniel Meißner via Guix-patches via
2021-09-10 11:24 ` [bug#50505] [PATCH 03/12] gnu: Add python-glcontext Daniel Meißner via Guix-patches via
2021-09-11 19:42 ` Xinglu Chen
2021-09-10 11:24 ` [bug#50505] [PATCH 04/12] gnu: Add python-moderngl Daniel Meißner via Guix-patches via
2021-09-11 19:46 ` Xinglu Chen
2021-09-10 11:24 ` [bug#50505] [PATCH 05/12] gnu: Add python-pyglet Daniel Meißner via Guix-patches via
2021-09-11 19:49 ` Xinglu Chen
2021-09-10 11:24 ` [bug#50505] [PATCH 06/12] gnu: Add python-multipledispatch Daniel Meißner via Guix-patches via
2021-09-11 19:52 ` Xinglu Chen
2021-09-10 11:24 ` [bug#50505] [PATCH 07/12] gnu: Add python-pyrr Daniel Meißner via Guix-patches via
2021-09-11 19:58 ` Xinglu Chen
2021-09-10 11:24 ` [bug#50505] [PATCH 08/12] gnu: Add python-screeninfo Daniel Meißner via Guix-patches via
2021-09-10 11:24 ` [bug#50505] [PATCH 09/12] gnu: Add python-moderngl-window Daniel Meißner via Guix-patches via
2021-09-10 11:25 ` [bug#50505] [PATCH 10/12] gnu: Add python-manimpango Daniel Meißner via Guix-patches via
2021-09-10 11:25 ` [bug#50505] [PATCH 11/12] gnu: Add python-mapbox-earcut Daniel Meißner via Guix-patches via
2021-09-10 11:25 ` [bug#50505] [PATCH 12/12] gnu: Add python-manim 0.9.0 Daniel Meißner via Guix-patches via
2021-09-11 19:33 ` [bug#50505] [PATCH 01/12] gnu: Add python-cloup Xinglu Chen
2021-09-15 14:54 ` Daniel Meißner via Guix-patches via
2021-09-10 14:40 ` [bug#50505] [PATCH 00/12] gnu: Add python-manim Liliana Marie Prikler
2021-09-13 14:30 ` Daniel Meißner via Guix-patches via
2021-09-13 14:46 ` Liliana Marie Prikler
2021-09-13 14:49 ` Liliana Marie Prikler
2021-09-15 14:32 ` Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 00/13] " Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 01/13] gnu: Add python-cloup Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 02/13] gnu: Add python-cloup-0.7 Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 03/13] gnu: Add python-glcontext Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 04/13] gnu: Add python-moderngl Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 05/13] gnu: Add python-pyglet Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 06/13] gnu: Add python-multipledispatch Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 07/13] gnu: Add python-pyrr Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 08/13] gnu: Add python-screeninfo Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 09/13] gnu: Add python-moderngl-window Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 10/13] gnu: Add python-manimpango Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 11/13] gnu: Add python-mapbox-earcut Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 12/13] gnu: Add python-screeninfo-0.6 Daniel Meißner via Guix-patches via
2021-09-15 15:25 ` [bug#50505] [PATCH v2 13/13] gnu: Add python-manim 0.9.0 Daniel Meißner via Guix-patches via
2022-01-01 23:51 ` [bug#50505] [PATCH v3 00/13] Add python-manim and its missing dependencies Daniel Meißner via Guix-patches via
2022-01-01 23:51 ` [bug#50505] [PATCH v3 01/12] gnu: Add python-cloup Daniel Meißner via Guix-patches via
2022-01-01 23:51 ` [bug#50505] [PATCH v3 02/12] gnu: Add python-cloup-0.7 Daniel Meißner via Guix-patches via
2022-01-01 23:51 ` [bug#50505] [PATCH v3 03/12] gnu: Add python-glcontext Daniel Meißner via Guix-patches via
2022-01-02 0:31 ` Liliana Marie Prikler
2022-01-01 23:51 ` [bug#50505] [PATCH v3 04/12] gnu: Add python-moderngl Daniel Meißner via Guix-patches via
2022-01-02 0:33 ` Liliana Marie Prikler
2022-01-01 23:51 ` [bug#50505] [PATCH v3 05/12] gnu: Add python-pyglet Daniel Meißner via Guix-patches via
2022-01-02 0:36 ` Liliana Marie Prikler
2022-01-01 23:51 ` [bug#50505] [PATCH v3 06/12] gnu: Add python-pyrr Daniel Meißner via Guix-patches via
2022-01-01 23:51 ` [bug#50505] [PATCH v3 07/12] gnu: Add python-screeninfo Daniel Meißner via Guix-patches via
2022-01-01 23:51 ` Daniel Meißner via Guix-patches via [this message]
2022-01-02 0:47 ` [bug#50505] [PATCH v3 08/12] gnu: Add python-moderngl-window Liliana Marie Prikler
2022-01-10 8:40 ` Daniel Meißner via Guix-patches via
2022-01-01 23:51 ` [bug#50505] [PATCH v3 09/12] gnu: Add python-manimpango Daniel Meißner via Guix-patches via
2022-01-01 23:51 ` [bug#50505] [PATCH v3 10/12] gnu: Add python-mapbox-earcut Daniel Meißner via Guix-patches via
2022-01-01 23:51 ` [bug#50505] [PATCH v3 11/12] gnu: Add python-screeninfo-0.6 Daniel Meißner via Guix-patches via
2022-01-01 23:51 ` [bug#50505] [PATCH v3 12/12] gnu: Add python-manim 0.9.0 Daniel Meißner via Guix-patches via
2022-01-02 0:52 ` Liliana Marie Prikler
2024-10-18 20:17 ` [bug#50505] [PATCH 00/12] gnu: Add python-manim Sharlatan Hellseher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220101235155.5754-9-daniel.meissner-i4k@ruhr-uni-bochum.de \
--to=guix-patches@gnu.org \
--cc=50505@debbugs.gnu.org \
--cc=daniel.meissner-i4k@ruhr-uni-bochum.de \
--cc=liliana.prikler@gmail.com \
--cc=public@yoctocell.xyz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).