diff mbox series

[bug#49123,20/24] gnu: Add python-plyer.

Message ID 85604f193efced6daaa138b573c8603f74a951f9.camel@disroot.org
State New
Headers show
Series None | expand

Commit Message

slg July 4, 2021, 4:45 p.m. UTC
On Mon, 2021-06-21 at 17:53 +0200, Maxime Devos wrote:
> 
> You can try to work-around the cycle
> by defining two python-plyer packages, like this
> (fill in the ...):
> 
> (define-public python-plyer
>   (package
>     (name ...)
>     (version ...)
>     (build-system ...)
>     ;; do not add (arguments ...) here!
>     ;; (This comment should not go into the revised patch)
>     (native-inputs
>       ;; Add a comment on why this is necessary
>       `(("python-plyer" ,python-plyer-for-tests)))
>     (home-page ...)
>     (synopsis ...)
>     (description ...)))
> 
> (define python-plyer-for-tests
>   (package/hidden
>     (inherit python-plyer)
>     (native-inputs '())))
> 
> That way, first a python-plyer without tests will be built,
> and then the real python-plyer will be built with tests.

I tried the attached patch, but it still fails with same errors when
trying to run tests. At this point I don't know if python-plyer-for-
tests is being built before or not.

Sincerely,

slg

Comments

M July 6, 2021, 10:28 a.m. UTC | #1
Hi,

I'll test this patch series (checking licenses, reproducibility, linter
output, looking at the source code for anything ‘fishy’ ...) more
extensively, but that will take some time to complete.

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5b13394824..694fde25e4 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -26128,14 +26128,26 @@  is a Python port from filetype Go package.")
         (base32
          "156z58gzb3afzilhdbsm323sn0sky1n59kgaxmpg73a3phbqpqwd"))))
     (build-system python-build-system)
-    (arguments
-     `(#:tests? #f)) ;; Circular dependency on itself
+    (native-inputs
+     ;; Needed because plyer cannot find itself when doing tests
+     `(("python-plyer" ,python-plyer-for-tests)
+       ("which" ,which)
+       ("xbacklight" ,xbacklight)))
     (home-page "https://plyer.readthedocs.io/en/latest/")
     (synopsis "API for common features found on various platforms")
     (description "Plyer is a platform-independent api to use features
 commonly found on various platforms, notably mobile ones, in Python.")
     (license license:x11)))
 
+;; Used for testing on python-plyer
+(define python-plyer-for-tests
+  (hidden-package
+   (package
+     (inherit python-plyer)
+     (arguments
+      `(#:tests? #f))
+     (native-inputs '()))))
+
 (define-public python-baron
   (package
     (name "python-baron")