From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 3LeMLsfp0GEE+gAAgWs5BA (envelope-from ) for ; Sun, 02 Jan 2022 00:54:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gMh8Jsfp0GEkgwAAG6o9tA (envelope-from ) for ; Sun, 02 Jan 2022 00:54:47 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 29E0726DAD for ; Sun, 2 Jan 2022 00:54:47 +0100 (CET) Received: from localhost ([::1]:43956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3oD0-00074g-Bo for larch@yhetil.org; Sat, 01 Jan 2022 18:54:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3oBO-0005WV-Bx for guix-patches@gnu.org; Sat, 01 Jan 2022 18:53:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48074) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n3oBO-0008BC-3A for guix-patches@gnu.org; Sat, 01 Jan 2022 18:53:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n3oBO-00038o-2V for guix-patches@gnu.org; Sat, 01 Jan 2022 18:53:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#50505] [PATCH v3 08/12] gnu: Add python-moderngl-window. Resent-From: Daniel =?UTF-8?Q?Mei=C3=9Fner?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Jan 2022 23:53:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50505 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50505@debbugs.gnu.org Cc: Daniel =?UTF-8?Q?Mei=C3=9Fner?= , Xinglu Chen , Liliana Marie Prikler Received: via spool by 50505-submit@debbugs.gnu.org id=B50505.164108116011955 (code B ref 50505); Sat, 01 Jan 2022 23:53:06 +0000 Received: (at 50505) by debbugs.gnu.org; 1 Jan 2022 23:52:40 +0000 Received: from localhost ([127.0.0.1]:59606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3oAy-00036f-Am for submit@debbugs.gnu.org; Sat, 01 Jan 2022 18:52:40 -0500 Received: from out2.mail.ruhr-uni-bochum.de ([134.147.42.229]:54649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3oAm-000350-K1 for 50505@debbugs.gnu.org; Sat, 01 Jan 2022 18:52:34 -0500 Received: from mx2.mail.ruhr-uni-bochum.de (localhost [127.0.0.1]) by out2.mail.ruhr-uni-bochum.de (Postfix mo-ext) with ESMTP id 4JRJhl13tNz8S8x; Sun, 2 Jan 2022 00:52:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ruhr-uni-bochum.de; s=mail-2017; t=1641081143; bh=BghhmYt/4rB2N6ToNeLT/nNSgajdtRSWmZw921a5T+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CulM7ZG3zXGKBzdkbg5kj/XNHxCda3vIE2sHjvkC7nUfHSIvPXsswH/EI2vkazMPw irQeHjyANXmQHww6E6z7QBat4xlBs1/RYKTEUu67gVYZldNJK0dI2hlXnAQ8Ptg87P pICH2Sw0LHpSG5cZXHES4yCtkpql2XfO6wgUV2Eo= Received: from out2.mail.ruhr-uni-bochum.de (localhost [127.0.0.1]) by mx2.mail.ruhr-uni-bochum.de (Postfix idis) with ESMTP id 4JRJhl0Kdhz8S6j; Sun, 2 Jan 2022 00:52:23 +0100 (CET) X-RUB-Notes: Internal origin=IPv6:2a05:3e00:c:1001::8693:2aec X-Envelope-Sender: Received: from mail2.mail.ruhr-uni-bochum.de (mail2.mail.ruhr-uni-bochum.de [IPv6:2a05:3e00:c:1001::8693:2aec]) by out2.mail.ruhr-uni-bochum.de (Postfix mi-int) with ESMTP id 4JRJhk6DGCz8S55; Sun, 2 Jan 2022 00:52:22 +0100 (CET) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.104.1 at mx2.mail.ruhr-uni-bochum.de Received: from think.local (dslb-002-204-223-044.002.204.pools.vodafone-ip.de [2.204.223.44]) by mail2.mail.ruhr-uni-bochum.de (Postfix) with ESMTPSA id 4JRJhk4G7VzDgyZ; Sun, 2 Jan 2022 00:52:22 +0100 (CET) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.104.1 at mail2.mail.ruhr-uni-bochum.de Date: Sun, 2 Jan 2022 00:51:51 +0100 Message-Id: <20220101235155.5754-9-daniel.meissner-i4k@ruhr-uni-bochum.de> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220101235155.5754-1-daniel.meissner-i4k@ruhr-uni-bochum.de> References: <20220101235155.5754-1-daniel.meissner-i4k@ruhr-uni-bochum.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Daniel =?UTF-8?Q?Mei=C3=9Fner?= X-ACL-Warn: , =?utf-8?q?Daniel_Mei=C3=9Fner_via_Guix-patches?= From: =?utf-8?q?Daniel_Mei=C3=9Fner_via_Guix-patches?= via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641081287; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=SvnXmGM6LGT5hon4i0Q6Tq73jXc3Ha5bShl/6D7Ah4k=; b=NHIVo+P2D0Rw04zXxzCH9Y8CqufivK4jopdIE84+W+twJNx8ZhBXGnE0p/OrkFhwbRyS8+ U4oFQuc3iZcj8tI1umWehkiULVOHvirwOxQW/4MgYmTRYhspLFpL5oMl1Lc/lg+1Z9W9tj ojky25zVG9GmU8zgnmSNzp9xwovLpGBOONhP4uIb08i8/NovK0GSKv+8g+5LZCPtWjk8FK xtUamtYV388AIYlDB01G5iqxUvE0CQOQpFVnRbPr/Ej5SVUvY5OReunfuqcgS9rfDaF2gH r1qryx5U298nTlQLGpFE/z9Cthh4GNkz+Tf/eiJ3Kay+HMdjRYdC4LSrgLuGuA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641081287; a=rsa-sha256; cv=none; b=sNVvUrzlil/Ow+n38/9Lwn3j1WEHbmBPl3731nizj6h5kstugnp0jMHdQBICmSx9OJjbSN CU9Skpr5l1o2bUZa7Rn6Rs5l9QwgH1uS/7ILLa8kXwgFZE9AHJ8ZxUvhuNXGDThTltvreX Z6EOTHtNVF1FQ1CoZPk2BtKpgL79L3j0NXtwZgO7vzKuJHWKvBjrZswvHstOj3Nv5KooX6 L7+/XmAK96kCtAWY0rp/jiDiosLRiGAYmwZt2WsAUpe/leDHB1La5x601xTGDl9YhX4GWd 2ndYuWQd5NqEt1B08qV8k9OmVoeMFanXAXH6nvGnpP6EsjlkkGpz+AR50O/FTA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ruhr-uni-bochum.de header.s=mail-2017 header.b=CulM7ZG3; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.78 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ruhr-uni-bochum.de header.s=mail-2017 header.b=CulM7ZG3; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 29E0726DAD X-Spam-Score: -1.78 X-Migadu-Scanner: scn1.migadu.com X-TUID: Bh76OmLg4fWx * 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 =3D \ %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. Theref= ore +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): + =0D + # --- Loaders : Scene ---=0D + =0D +- def test_loaders_wavefront(self):=0D +- self.validate('loaders/wavefront.rst', 'moderngl_window.loaders.s= cene.wavefront', 'Loader')=0D +-=0D + def test_loaders_gltf(self):=0D + self.validate('loaders/gltf2.rst', 'moderngl_window.loaders.scene= .gltf2', 'Loader')=0D + =0D +- def test_loaders_stl(self):=0D +- self.validate('loaders/wavefront.rst', 'moderngl_window.loaders.s= cene.stl', 'Loader')=0D +-=0D + # --- Loaders : Program ---=0D + =0D +- def test_loader_single(self):=0D +- self.validate('loaders/single.rst', 'moderngl_window.loaders.prog= ram.single', 'Loader')=0D +-=0D + def test_loader_separate(self):=0D + self.validate('loaders/separate.rst', 'moderngl_window.loaders.pr= ogram.separate', 'Loader')=0D + =0D +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 =3D (16, 16) + aspect_ratio =3D 1.0 +=20 +- def test_wavefront(self): +- """Load wavefront file""" +- scene =3D resources.scenes.load(SceneDescription(path=3D'scenes/c= rate/crate.obj')) +- self.assertIsInstance(scene, Scene) +- +- def test_wavefont_not_found(self): +- """Ensure ImproperlyConfigured is raised when wavefront is not fo= und""" +- with self.assertRaises(ImproperlyConfigured): +- resources.scenes.load(SceneDescription(path=3D'scenes/doesnot= exist.obj')) +- + def test_gltf(self): + """Load standard gltf""" + scene =3D resources.scenes.load(SceneDescription(path=3D'scenes/B= oxTextured/glTF/BoxTextured.gltf')) +@@ -45,7 +35,3 @@ class SceneLoadersTestCase(HeadlessTestCase): + """Attempt to load nonexisting gltf""" + with self.assertRaises(ImproperlyConfigured): + resources.scenes.load(SceneDescription(path=3D'scenes/doesnot= exist.gltf')) +- +- def test_stl(self): +- scene =3D resources.scenes.load(SceneDescription(path=3D'scenes/u= plink.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=3D'cube', + )) + self.assertIsInstance(texture, moderngl.TextureCube) +- +- def test_texture_mimpamps(self): +- """Load texture with mipmapping and anisotropy""" +- desc =3D TextureDescription( +- path=3D'textures/crate.png', +- mipmap_levels=3D(0, 2), +- anisotropy=3D4.0, +- ) +- texture =3D resources.textures.load(desc) +- self.assertEqual(texture.anisotropy, 4.0) +- self.assertEqual(desc.mipmap, True) +- +- # Texture Array +- desc =3D TextureDescription( +- path=3D'textures/array.png', +- kind=3D"array", +- layers=3D10, +- mipmap_levels=3D(0, 5), +- anisotropy=3D8.0, +- ) +- texture =3D 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 =3D (Path(__file__).parent / "fixtures/resources/textures/cr= ate.png").resolve() +- with resources.temporary_dirs([]): +- desc =3D TextureDescription( +- path=3Dpath, +- mipmap_levels=3D(0, 2), +- anisotropy=3D4.0, +- ) +- texture =3D 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 =3D "Hello" +=20 +- def test_load_texture_2d(self): +- """Load texture with shortcut method""" +- texture =3D self.config.load_texture_2d( +- "textures/crate.png", +- flip=3DTrue, +- mipmap_levels=3D(0, 2), +- anisotropy=3D4.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 =3D self.config.load_texture_array( +- 'textures/array.png', +- layers=3D10, +- flip=3DTrue, +- mipmap=3DFalse, +- mipmap_levels=3D(0, 2), +- anisotropy=3D4.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 =3D self.config.load_program(path=3D'programs/white.glsl') +--=20 +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))) =20 +(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, pyga= me, +PySide2, GLFW, SDL2, PyQt5 or tkinter. Events are unified into a single e= vent +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") --=20 2.34.0