GNU bug report logs - #72935
[PATCH] gnu: python-mpv: Update to 1.0.7.

Previous Next

Package: guix-patches;

Reported by: Ian Eure <ian <at> retrospec.tv>

Date: Sun, 1 Sep 2024 15:49:02 UTC

Severity: normal

Tags: patch

Done: Tobias Geerinckx-Rice <me <at> tobias.gr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72935 in the body.
You can then email your comments to 72935 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#72935; Package guix-patches. (Sun, 01 Sep 2024 15:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ian Eure <ian <at> retrospec.tv>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 01 Sep 2024 15:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ian Eure <ian <at> retrospec.tv>
To: guix-patches <at> gnu.org
Cc: Ian Eure <ian <at> retrospec.tv>
Subject: [PATCH] gnu: python-mpv: Update to 1.0.7.
Date: Sun,  1 Sep 2024 08:46:47 -0700
* gnu/packages/python-xyz.scm (python-mpv): Update to 1.0.7.  The recent
core-updates merge broke the previous version of this package, so I updated to
the most recent upstream while fixing the build.  Upstream switched to
pyproject, so use that build-system and add packages the tests need.  Upstream
added an environment variable to skip the test the previous package patched
out, so use that rather than changing the source.

Change-Id: Ia0e6c3341292fe6a40f63b484d70c6a68b6f7eb4
---
 gnu/packages/python-xyz.scm | 72 +++++++++++++++++--------------------
 1 file changed, 33 insertions(+), 39 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a7688050e1..10908f185f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -37071,7 +37071,7 @@ (define-public python-bsdiff4
 (define-public python-mpv
   (package
     (name "python-mpv")
-    (version "1.0.1")
+    (version "1.0.7")
     (source
      (origin
        ;; python-mpv from pypi does not include the tests directory.
@@ -37081,43 +37081,37 @@ (define-public python-mpv
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32
-         "10w6j3n62ap45sf6q487kz8z6g58sha37i14fa2hhng794z7a8jh"))
-       (modules '((guix build utils)))
-       (snippet
-        #~(begin
-            ;; One of the tests never completes, so neutering it using
-            ;; early return allows other test to run without issue.
-            (substitute* "tests/test_mpv.py"
-              ;; Note the typo in "prooperty" - this was fixed later in
-              ;; upstream but has no effect on whether the tests hangs or not.
-              (("test_wait_for_prooperty_event_overflow.*" line)
-               ;; The long whitespace between \n and return is to match the
-               ;; identation level, which is significant in python.
-               (string-append line "\n        return\n")))))))
-    (build-system python-build-system)
+        (base32 "102fajzrcgxapsanh0phlqmk9q2v95bvix6mrkg8rypv717idins"))
+       (modules '((guix build utils)))))
+    (build-system pyproject-build-system)
     (arguments
-     (list #:phases
-           #~(modify-phases %standard-phases
-               (add-before 'build 'patch-reference-to-mpv
-                 (lambda* (#:key inputs #:allow-other-keys)
-                   ;; Without an absolute path it is not able find and
-                   ;; load the libmpv library.
-                   (substitute* "mpv.py"
-                     (("sofile = .*")
-                      (string-append "sofile = \""
-                                     (search-input-file inputs "/lib/libmpv.so")
-                                     "\"\n")))))
-               (add-before 'check 'prepare-for-tests
-                 (lambda _
-                   ;; Fontconfig throws errors when it has no cache dir to use.
-                   (setenv "XDG_CACHE_HOME" (getcwd))
-                   ;; Some tests fail without a writable and readable HOME.
-                   (setenv "HOME" (getcwd)))))))
-    (native-inputs
-     (list python-xvfbwrapper)) ; needed for tests only
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'build 'patch-reference-to-mpv
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       ;; Without an absolute path it is not able find and
+                       ;; load the libmpv library.
+                       (substitute* "mpv.py"
+                         (("sofile = .*")
+                          (string-append "sofile = \""
+                                         (search-input-file inputs
+                                                            "/lib/libmpv.so")
+                                         "\"\n")))))
+                   (add-before 'check 'prepare-for-tests
+                     (lambda _
+                       ;; Fontconfig throws errors when it has no cache dir to use.
+                       (setenv "XDG_CACHE_HOME"
+                               (getcwd))
+                       ;; Some tests fail without a writable and readable HOME.
+                       (setenv "HOME"
+                               (getcwd))
+                       (setenv "PY_MPV_SKIP_TESTS"
+                               "test_wait_for_property_event_overflow"))))))
+    (native-inputs (list
+                    ;; needed for tests
+                    python-pyvirtualdisplay python-xvfbwrapper python-pytest))
     (inputs (list mpv))
-    (propagated-inputs (list python-pillow)) ; for raw screenshots
+    (propagated-inputs (list python-pillow)) ;for raw screenshots
     (home-page "https://github.com/jaseg/python-mpv")
     (synopsis "Python interface to the mpv media player")
     (description
@@ -37125,9 +37119,9 @@ (define-public python-mpv
 It gives you more or less full control of all features of the player, just
 as the lua interface does.")
     ;; From the project's README:
-    ;;  python-mpv inherits the underlying libmpv's license, which can be either
-    ;;  GPLv2 or later (default) or LGPLv2.1 or later.  For details, see the mpv
-    ;;  copyright page.
+    ;; python-mpv inherits the underlying libmpv's license, which can be either
+    ;; GPLv2 or later (default) or LGPLv2.1 or later.  For details, see the mpv
+    ;; copyright page.
     (license license:gpl2+)))
 
 (define-public python-biblib
-- 
2.45.2





Reply sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
You have taken responsibility. (Sun, 01 Sep 2024 17:07:02 GMT) Full text and rfc822 format available.

Notification sent to Ian Eure <ian <at> retrospec.tv>:
bug acknowledged by developer. (Sun, 01 Sep 2024 17:07:02 GMT) Full text and rfc822 format available.

Message #10 received at 72935-done <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Ian Eure <ian <at> retrospec.tv>
Cc: 72935-done <at> debbugs.gnu.org
Subject: Re: [bug#72935] [PATCH] gnu: python-mpv: Update to 1.0.7.
Date: Sun, 01 Sep 2024 19:05:35 +0200
[Message part 1 (text/plain, inline)]
Hi Ian,

Ian Eure 写道:
> * gnu/packages/python-xyz.scm (python-mpv): Update to 1.0.7. 
> The recent
> core-updates merge broke the previous version of this package, 
> so I updated to
> the most recent upstream while fixing the build.  Upstream 
> switched to
> pyproject, so use that build-system and add packages the tests 
> need.  Upstream
> added an environment variable to skip the test the previous 
> package patched
> out, so use that rather than changing the source.

Thanks!  I rewrote this to follow our more formal change log 
standards:

   gnu: python-mpv: Update to 1.0.7.
   
   This fixes the build after the core-updates merge.
   
   * gnu/packages/python-xyz.scm (python-mpv): Update to 1.0.7.
   [source]: Remove snippet obsoleted by PY_MPV_SKIP_TESTS.
   [build-system]: Switch to pyproject.
   [arguments]: Set newly-available PY_MPV_SKIP_TESTS variable.
   [native-inputs]: Add python-pytest and 
   python-pyvirtualdisplay.

> +       (modules '((guix build utils)))))

Origin [modules] are only ever used for snippets, so with the 
snippet gone this served no purpose.  Removed.

>      (arguments
> -     (list #:phases
> -           #~(modify-phases %standard-phases
> +     (list
> +      #:phases #~(modify-phases %standard-phases

After our chat on IRC, I reverted this dubious ‘guix style’ 
indentation change.  This makes your diff a breeze to read and 
shortens some lines that had grown over 80 characters.

As things stand, I don't recommend running ‘guix style’ on 
existing code.  Maybe one day.

> +    (native-inputs (list
> +                    ;; needed for tests
> +                    python-pyvirtualdisplay python-xvfbwrapper 
> python-pytest))

I added the newlines that we both preferred.

Line comments (;;) are full sentences, so

 ;; Needed for tests.

Pushed, minus some other ‘guix style’ noise, as 
a977900d76b7585c401222a3ce8bbb82e5f6da45.

Kind regards,

T G-R
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 30 Sep 2024 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.