From patchwork Wed Sep 15 15:25:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_Mei=C3=9Fner?= X-Patchwork-Id: 32863 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1461E27BBE3; Wed, 15 Sep 2021 16:29:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 746F127BBE1 for ; Wed, 15 Sep 2021 16:29:23 +0100 (BST) Received: from localhost ([::1]:50264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQWqg-0006e3-Ik for patchwork@mira.cbaines.net; Wed, 15 Sep 2021 11:29:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQWqN-0006c2-LG for guix-patches@gnu.org; Wed, 15 Sep 2021 11:29:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQWqN-0001ye-E1 for guix-patches@gnu.org; Wed, 15 Sep 2021 11:29:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mQWqN-0001Te-At for guix-patches@gnu.org; Wed, 15 Sep 2021 11:29:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50505] [PATCH v2 09/13] 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: Wed, 15 Sep 2021 15:29:03 +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?= Received: via spool by 50505-submit@debbugs.gnu.org id=B50505.16317197005605 (code B ref 50505); Wed, 15 Sep 2021 15:29:03 +0000 Received: (at 50505) by debbugs.gnu.org; 15 Sep 2021 15:28:20 +0000 Received: from localhost ([127.0.0.1]:52968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQWpf-0001SG-SX for submit@debbugs.gnu.org; Wed, 15 Sep 2021 11:28:20 -0400 Received: from out1.mail.ruhr-uni-bochum.de ([134.147.53.149]:19232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQWp9-0001Nq-BF for 50505@debbugs.gnu.org; Wed, 15 Sep 2021 11:28:01 -0400 Received: from mx1.mail.ruhr-uni-bochum.de (localhost [127.0.0.1]) by out1.mail.ruhr-uni-bochum.de (Postfix mo-ext) with ESMTP id 4H8kcF6X6Rz8S25 for <50505@debbugs.gnu.org>; Wed, 15 Sep 2021 17:27:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ruhr-uni-bochum.de; s=mail-2017; t=1631719661; bh=qui5MEj++IQr1vgnL811kqwmZIAxkvWNZPb+L8fj6x0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FBi8ry0003sV/3el06cwxllEp8Qt57HaF+jRQiWn0/UtKAMAW2WZtlka3vwvY1jIx 75jaDUvTfpumEbhA/n7QzPqtiHssDRZSdUC6Ij1ZXttMsI3UJpIAKu/TXddSdpk6QM 1rJ2ljERkY4/Vume3ny/MaurXUeb0uNxHuv8XNgE= Received: from out1.mail.ruhr-uni-bochum.de (localhost [127.0.0.1]) by mx1.mail.ruhr-uni-bochum.de (Postfix idis) with ESMTP id 4H8kcF5ykbz8SBb; Wed, 15 Sep 2021 17:27:41 +0200 (CEST) X-Envelope-Sender: X-RUB-Notes: Internal origin=IPv6:2a05:3e00:c:1001::8693:2aec Received: from mail2.mail.ruhr-uni-bochum.de (mail2.mail.ruhr-uni-bochum.de [IPv6:2a05:3e00:c:1001::8693:2aec]) by out1.mail.ruhr-uni-bochum.de (Postfix mi-int) with ESMTP id 4H8kcF4j0wz8S8t; Wed, 15 Sep 2021 17:27:41 +0200 (CEST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.1 at mx1.mail.ruhr-uni-bochum.de Received: from xii-04.mg07.ruhr-uni-bochum.de (pm26.mg07.ruhr-uni-bochum.de [10.150.49.41]) by mail2.mail.ruhr-uni-bochum.de (Postfix) with ESMTPSA id 4H8kcF39t7zDgyX; Wed, 15 Sep 2021 17:27:41 +0200 (CEST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.0 at mail2.mail.ruhr-uni-bochum.de Date: Wed, 15 Sep 2021 17:25:15 +0200 Message-Id: <20210915152519.25572-10-daniel.meissner-i4k@ruhr-uni-bochum.de> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910112231.6411-1-daniel.meissner-i4k@ruhr-uni-bochum.de> References: <20210910112231.6411-1-daniel.meissner-i4k@ruhr-uni-bochum.de> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Daniel =?utf-8?q?Mei=C3=9Fner?= X-ACL-Warn: , Daniel =?utf-8?q?Mei=C3=9Fner?= via Guix-patches X-Patchwork-Original-From: Daniel =?utf-8?q?Mei=C3=9Fner?= via Guix-patches via From: =?utf-8?q?Daniel_Mei=C3=9Fner?= X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-xyz.scm (python-moderngl-window): New variable. --- gnu/local.mk | 1 + .../python-moderngl-window-skip-tests.patch | 62 +++++++++++++++++++ gnu/packages/python-xyz.scm | 49 +++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 gnu/packages/patches/python-moderngl-window-skip-tests.patch diff --git a/gnu/local.mk b/gnu/local.mk index 175e691a63..d738f97ca8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1648,6 +1648,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-libxml2-utf8.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-testtools.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..cbfefa6c3a --- /dev/null +++ b/gnu/packages/patches/python-moderngl-window-skip-tests.patch @@ -0,0 +1,62 @@ +Skip 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. + +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) +-- +2.33.0 diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 3a984eaa68..0d3efe2700 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -19071,6 +19071,55 @@ Joysticks, OpenGL graphics, loading images and videos, and playing sounds and 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 'prepare-x + (lambda _ + (system "Xvfb :1 &") + (setenv "DISPLAY" ":1"))) + (add-before 'check 'fix-test + (lambda _ + (substitute* '("tests/test_windowconfig.py") + (("terrain_Vs.glsl") "terrain_vs.glsl")))) + (replace 'check + (lambda* (#:key inputs outputs #:allow-other-keys) + (add-installed-pythonpath inputs outputs) + (invoke "pytest" "tests" )))))) + (propagated-inputs + `(("python-pillow" ,python-pillow) + ("python-pyrr" ,python-pyrr) + ("python-numpy" ,python-numpy) + ("python-moderngl" ,python-moderngl) + ("python-pyglet" ,python-pyglet))) + (native-inputs + `(("python-pytest" ,python-pytest) + ("xorg-server" ,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")