GNU bug report logs - #41455
[PATCH] gnu: Add python-daemux

Previous Next

Package: guix-patches;

Reported by: Edouard Klein <edk <at> beaver-labs.com>

Date: Fri, 22 May 2020 13:11:02 UTC

Severity: normal

Tags: patch

Merged with 41208

Done: Marius Bakke <marius <at> gnu.org>

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 41455 in the body.
You can then email your comments to 41455 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#41455; Package guix-patches. (Fri, 22 May 2020 13:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Edouard Klein <edk <at> beaver-labs.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 22 May 2020 13:11:02 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edk <at> beaver-labs.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add python-daemux
Date: Fri, 22 May 2020 15:10:12 +0200
* /gnu/packages/python-xyz.scm (python-daemux): New variable
---
 gnu/packages/python-xyz.scm | 38 +++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8118c6d867..1b32e7e2a8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20075,3 +20075,41 @@ It builds upon tmux's target and formats to create an object mapping to traverse
     "Questionary helps make the input prompts easy to read and answer for the user
 using multi-select lists, confirmations, free text prompts, completion, etc.")
   (license license:expat)))
+
+(define-public python-daemux
+  (package
+    (name "python-daemux")
+    (version "0.1.0")
+    (source
+     ;; We fetch from the Git repo because there are no tests in the PyPI
+     ;; archive.
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/edouardklein/daemux.git")
+             (commit "58e30331d3cce08655cb5f55e94396568d484f9a")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      (mkdir-p "tmptmux")
+                      (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
+                      (invoke "tmux" "new-session" "-d")
+                      (invoke "make" "test"))))))
+    (propagated-inputs
+     `(("python-libtmux" ,python-libtmux)))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-sphinx" ,python-sphinx)))
+    (home-page "https://github.com/edouardklein/daemux")
+    (synopsis
+     "Start, stop, restart and check daemons via tmux")
+    (description
+     "Daemux lets you run daemons in a tmux pane.  Users can launch long-running
+background tasks, and check these tasks' health by hand, relaunch them, etc. by attaching
+to the corresponding pane in tmux.")
+    (license license:agpl3+)))
-- 
2.26.2




Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Sat, 23 May 2020 18:46:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Edouard Klein <edk <at> beaver-labs.com>, 41455 <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH] gnu: Add python-daemux
Date: Sat, 23 May 2020 20:45:46 +0200
[Message part 1 (text/plain, inline)]
Edouard Klein <edk <at> beaver-labs.com> writes:

> * /gnu/packages/python-xyz.scm (python-daemux): New variable

Thanks!  The package LGTM but already does not apply because other
packages have been appended to python-xyz.scm.  To reduce change of
merge conflicts, I recommend adding packages somewhere "in the middle".

However, I wonder if this and python-libtmux are better suited in
tmux.scm.  WDYT?

In any case can you rebase this patch?  Thanks in advance!
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Mon, 25 May 2020 09:32:01 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edk <at> beaver-labs.com>
To: 41455 <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH] gnu: Add python-daemux
Date: Mon, 25 May 2020 11:31:29 +0200
Hi !

Thank you for reviewing the patches.

Marius Bakke writes:

> Edouard Klein <edk <at> beaver-labs.com> writes:
>
>> * /gnu/packages/python-xyz.scm (python-daemux): New variable
>
> Thanks!  The package LGTM but already does not apply because other
> packages have been appended to python-xyz.scm.  To reduce change of
> merge conflicts, I recommend adding packages somewhere "in the
> middle".

Thanks for the tip :)

>
> However, I wonder if this and python-libtmux are better suited in
> tmux.scm.  WDYT?

I have no strong feelings one way or the other, but I slightly lean
on the side of tmux.scm. I'll send two patches for python-libtmux and
python-daemux from the current master, in tmux.scm.

>
> In any case can you rebase this patch?  Thanks in advance!





Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Mon, 25 May 2020 09:34:01 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edk <at> beaver-labs.com>
To: 41455 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: Add python-libtmux
Date: Mon, 25 May 2020 11:32:47 +0200
* gnu/packages/check.scm (python-pytest-4): New variable.
* gnu/packages/tmux.scm (python-libtmux): New variable.
---
 gnu/packages/check.scm | 49 ++++++++++++++++++++++++++++++++++++++++++
 gnu/packages/tmux.scm  | 48 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 97 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 7d7fd189bc..5d3e44a16d 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2020 Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
 ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
 ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991 <at> gmail.com>
+;;; Copyright © 2020 Edouard Klein <edk <at> beaver-labs.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -66,6 +67,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages time)
   #:use-module (gnu packages xml)
   #:use-module (guix utils)
@@ -819,6 +821,53 @@ and many external plugins.")
     (license license:expat)
     (properties `((python2-variant . ,(delay python2-pytest))))))
 
+(define-public python-pytest-4
+  (package
+    (name "python-pytest-4")
+    (version "4.5.0")
+    (source
+     (origin
+       (method git-fetch)
+       ;; Pypi source tarball does not include tests
+       (uri (git-reference
+             (url "https://github.com/pytest-dev/pytest.git")
+             (commit version)))
+       (file-name "python-pytest-4")
+       (sha256
+        (base32
+         "0igxfasjqabkzlb81vxqr58pfsdwjx4zzd1nc1b48wn6xnkkllhk"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-atomicwrites" ,python-atomicwrites)
+       ("python-attrs" ,python-attrs)
+       ("python-attrs" ,python-attrs)
+       ("python-more-itertools" ,python-more-itertools)
+       ("python-pluggy" ,python-pluggy)
+       ("python-six" ,python-six)
+       ("python-py" ,python-py)
+       ("python-wcwidth" ,python-wcwidth)))
+    (native-inputs
+     `(("python-setuptools-scm" ,python-setuptools-scm)
+       ("git" ,git)))
+    (arguments `(#:phases
+                 (modify-phases %standard-phases
+                   (add-after 'unpack 'git-tag
+                     (lambda _
+                       ;; setuptools-scm needs to know the version
+                       (invoke "git" "init")
+                       (invoke "git" "add" ".")
+                       (invoke "git" "config" "user.name" "John Doe")
+                       (invoke "git" "config" "user.email" "nobody <at> example.com")
+                       (invoke "git" "commit" "-m" "dummy commit")
+                       (invoke "git" "tag" ,version))))))
+    (home-page "https://docs.pytest.org/en/latest/")
+    (synopsis "Python testing library")
+    (description
+     "Pytest is a testing tool that provides auto-discovery of test modules
+and functions, detailed info on failing assert statements, modular fixtures,
+and many external plugins.")
+    (license license:expat)))
+
 ;; Pytest 4.x are the last versions that support Python 2.
 (define-public python2-pytest
   (package
diff --git a/gnu/packages/tmux.scm b/gnu/packages/tmux.scm
index 8b54849b18..c4dd963b53 100644
--- a/gnu/packages/tmux.scm
+++ b/gnu/packages/tmux.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2019 Oleg Pykhalov <go.wigust <at> gmail.com>
 ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
+;;; Copyright © 2020 Edouard Klein <edk <at> beaver-labs.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,8 +31,11 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
+  #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses))
 
@@ -138,6 +142,50 @@ command and helper commands provided by tmuxifier to manage Tmux sessions and
 windows.")
     (license license:expat)))
 
+(define-public python-libtmux
+  (package
+    (name "python-libtmux")
+    (version "0.8.2")
+    (source
+     (origin
+       (method git-fetch)
+       ;; Pypi source tarball does not include tests
+       (uri (git-reference
+             (url "https://github.com/tmux-python/libtmux.git")
+             (commit (string-append "v" version))))
+       (file-name "python-libtmux")
+       (sha256
+        (base32
+         "1akjv6aqpc690c4l2cjh0fxbpxxg63sfjggapfjjjaqmcl38g1dz"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-pytest-4" ,python-pytest-4)
+       ("tmux" ,tmux)
+       ("procps" ,procps)))  ;; Tests need top
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             ;; Extend PYTHONPATH so the built package will be found.
+             (setenv "PYTHONPATH"
+                     (string-append (getcwd) "/build/lib:"
+                                    (getenv "PYTHONPATH")))
+             ;; Skip tests that I suspect fail because of a change
+             ;; in behavior in tmux 3 from tmux 2
+             ;; https://github.com/tmux-python/libtmux/issues/281
+             (invoke "pytest" "-vv" "-k"
+                     (string-append "not test_show_option_unknown "
+                                    "and not test_show_window_option_unknown"))
+             #t)))))
+    (home-page
+     "https://github.com/tmux-python/libtmux")
+    (synopsis "Scripting library / orm for tmux")
+    (description "Libtmux is the tool behind tmuxp, a tmux workspace manager in python.
+It builds upon tmux's target and formats to create an object mapping to traverse,
+ inspect and interact with live tmux sessions.")
+    (license license:expat)))
+
 (define-public tmux-xpanes
   (package
     (name "tmux-xpanes")
-- 
2.26.2




Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Mon, 25 May 2020 09:34:02 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edk <at> beaver-labs.com>
To: 41455 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: Add python-daemux
Date: Mon, 25 May 2020 11:33:31 +0200
* gnu/packages/tmux.scm (python-daemux): New variable.
---
 gnu/packages/tmux.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/tmux.scm b/gnu/packages/tmux.scm
index c4dd963b53..106a6a3f5f 100644
--- a/gnu/packages/tmux.scm
+++ b/gnu/packages/tmux.scm
@@ -35,6 +35,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages sphinx)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses))
@@ -186,6 +187,44 @@ It builds upon tmux's target and formats to create an object mapping to traverse
  inspect and interact with live tmux sessions.")
     (license license:expat)))
 
+(define-public python-daemux
+  (package
+    (name "python-daemux")
+    (version "0.1.0")
+    (source
+     ;; We fetch from the Git repo because there are no tests in the PyPI
+     ;; archive.
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/edouardklein/daemux.git")
+             (commit "58e30331d3cce08655cb5f55e94396568d484f9a")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      (mkdir-p "tmptmux")
+                      (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
+                      (invoke "tmux" "new-session" "-d")
+                      (invoke "make" "test"))))))
+    (propagated-inputs
+     `(("python-libtmux" ,python-libtmux)))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-sphinx" ,python-sphinx)))
+    (home-page "https://github.com/edouardklein/daemux")
+    (synopsis
+     "Start, stop, restart and check daemons via tmux")
+    (description
+     "Daemux lets you run daemons in a tmux pane.  Users can launch long-running
+background tasks, and check these tasks' health by hand, relaunch them, etc. by attaching
+to the corresponding pane in tmux.")
+    (license license:agpl3+)))
+
 (define-public tmux-xpanes
   (package
     (name "tmux-xpanes")
-- 
2.26.2




Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Mon, 25 May 2020 22:44:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <marius <at> gnu.org>
To: Edouard Klein <edk <at> beaver-labs.com>, 41455 <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH 1/2] gnu: Add python-libtmux
Date: Tue, 26 May 2020 00:43:10 +0200
[Message part 1 (text/plain, inline)]
Edouard Klein <edk <at> beaver-labs.com> writes:

> * gnu/packages/check.scm (python-pytest-4): New variable.
> * gnu/packages/tmux.scm (python-libtmux): New variable.

Thanks!  Can you submit these as two separate patches?

> +    (native-inputs
> +     `(("python-setuptools-scm" ,python-setuptools-scm)
> +       ("git" ,git)))
> +    (arguments `(#:phases
> +                 (modify-phases %standard-phases
> +                   (add-after 'unpack 'git-tag
> +                     (lambda _
> +                       ;; setuptools-scm needs to know the version
> +                       (invoke "git" "init")
> +                       (invoke "git" "add" ".")
> +                       (invoke "git" "config" "user.name" "John Doe")
> +                       (invoke "git" "config" "user.email" "nobody <at> example.com")
> +                       (invoke "git" "commit" "-m" "dummy commit")
> +                       (invoke "git" "tag" ,version))))))

This is weird, we haven't needed this before.  Is there a way to avoid
the dependency on git here?  In the worst case maybe we can create
".git/refs/tags/,version" manually?  :-/

Also, please make this inherit from pytest instead of duplicating all
the fields.

[...]
  
> +(define-public python-libtmux
> +  (package
> +    (name "python-libtmux")
> +    (version "0.8.2")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       ;; Pypi source tarball does not include tests
> +       (uri (git-reference
> +             (url "https://github.com/tmux-python/libtmux.git")
> +             (commit (string-append "v" version))))
> +       (file-name "python-libtmux")
> +       (sha256
> +        (base32
> +         "1akjv6aqpc690c4l2cjh0fxbpxxg63sfjggapfjjjaqmcl38g1dz"))))
> +    (build-system python-build-system)
> +    (propagated-inputs
> +     `(("python-pytest-4" ,python-pytest-4)

Do you know if pytest 4 is really needed?  Often Python packages pin a
specific version for no good reason, and one can simply substitute "=="
with ">=" in setup.py and it's all good.

> +       ("tmux" ,tmux)

Even though this is useless without tmux, I'm not sure if we should
propagate it.  Some users might have custom versions of tmux, but would
still want to use this library.  WDYT?

> +       ("procps" ,procps)))  ;; Tests need top

                                ^ only one semicolon for margin comments
                                ;typically without a space, like this

> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (replace 'check
> +           (lambda _
> +             ;; Extend PYTHONPATH so the built package will be found.
> +             (setenv "PYTHONPATH"
> +                     (string-append (getcwd) "/build/lib:"
> +                                    (getenv "PYTHONPATH")))
> +             ;; Skip tests that I suspect fail because of a change
> +             ;; in behavior in tmux 3 from tmux 2
> +             ;; https://github.com/tmux-python/libtmux/issues/281
> +             (invoke "pytest" "-vv" "-k"
> +                     (string-append "not test_show_option_unknown "
> +                                    "and not test_show_window_option_unknown"))
> +             #t)))))
> +    (home-page
> +     "https://github.com/tmux-python/libtmux")

This line break is unnecessary.

Otherwise looks good.  Can you send updated patches?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Mon, 25 May 2020 22:47:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <marius <at> gnu.org>
To: Edouard Klein <edk <at> beaver-labs.com>, 41455 <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH 2/2] gnu: Add python-daemux
Date: Tue, 26 May 2020 00:46:26 +0200
[Message part 1 (text/plain, inline)]
Edouard Klein <edk <at> beaver-labs.com> writes:

> * gnu/packages/tmux.scm (python-daemux): New variable.

[...]
  
> +(define-public python-daemux
> +  (package
> +    (name "python-daemux")
> +    (version "0.1.0")
> +    (source
> +     ;; We fetch from the Git repo because there are no tests in the PyPI
> +     ;; archive.
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/edouardklein/daemux.git")
> +             (commit "58e30331d3cce08655cb5f55e94396568d484f9a")))

This upstream looks familiar...  Do you think upstream is willing to tag
a 0.1.0 release instead of using a "magic" commit identifier?  :-)

> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases (modify-phases %standard-phases
> +                  (replace 'check
> +                    (lambda _
> +                      (mkdir-p "tmptmux")
> +                      (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
> +                      (invoke "tmux" "new-session" "-d")
> +                      (invoke "make" "test"))))))

Nice!  I guess 'tmux' needs to be a native-input if we don't propagate
it from libtmux.

> +    (propagated-inputs
> +     `(("python-libtmux" ,python-libtmux)))
> +    (native-inputs
> +     `(("python-coverage" ,python-coverage)
> +       ("python-sphinx" ,python-sphinx)))
> +    (home-page "https://github.com/edouardklein/daemux")
> +    (synopsis
> +     "Start, stop, restart and check daemons via tmux")

This line break is unnecessary.

Otherwise LGTM, thanks!
[signature.asc (application/pgp-signature, inline)]

Merged 41208 41455. Request was from Marius Bakke <marius <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 25 May 2020 23:07:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Tue, 26 May 2020 08:24:02 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edk <at> beaver-labs.com>
To: 41455 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: Add python-pytest-4
Date: Tue, 26 May 2020 10:23:24 +0200
* gnu/packages/check.scm (python-pytest-4): New variable.
---
 gnu/packages/check.scm | 49 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 7d7fd189bc..5d3e44a16d 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2020 Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
 ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
 ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991 <at> gmail.com>
+;;; Copyright © 2020 Edouard Klein <edk <at> beaver-labs.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -66,6 +67,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages time)
   #:use-module (gnu packages xml)
   #:use-module (guix utils)
@@ -819,6 +821,53 @@ and many external plugins.")
     (license license:expat)
     (properties `((python2-variant . ,(delay python2-pytest))))))
 
+(define-public python-pytest-4
+  (package
+    (name "python-pytest-4")
+    (version "4.5.0")
+    (source
+     (origin
+       (method git-fetch)
+       ;; Pypi source tarball does not include tests
+       (uri (git-reference
+             (url "https://github.com/pytest-dev/pytest.git")
+             (commit version)))
+       (file-name "python-pytest-4")
+       (sha256
+        (base32
+         "0igxfasjqabkzlb81vxqr58pfsdwjx4zzd1nc1b48wn6xnkkllhk"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-atomicwrites" ,python-atomicwrites)
+       ("python-attrs" ,python-attrs)
+       ("python-attrs" ,python-attrs)
+       ("python-more-itertools" ,python-more-itertools)
+       ("python-pluggy" ,python-pluggy)
+       ("python-six" ,python-six)
+       ("python-py" ,python-py)
+       ("python-wcwidth" ,python-wcwidth)))
+    (native-inputs
+     `(("python-setuptools-scm" ,python-setuptools-scm)
+       ("git" ,git)))
+    (arguments `(#:phases
+                 (modify-phases %standard-phases
+                   (add-after 'unpack 'git-tag
+                     (lambda _
+                       ;; setuptools-scm needs to know the version
+                       (invoke "git" "init")
+                       (invoke "git" "add" ".")
+                       (invoke "git" "config" "user.name" "John Doe")
+                       (invoke "git" "config" "user.email" "nobody <at> example.com")
+                       (invoke "git" "commit" "-m" "dummy commit")
+                       (invoke "git" "tag" ,version))))))
+    (home-page "https://docs.pytest.org/en/latest/")
+    (synopsis "Python testing library")
+    (description
+     "Pytest is a testing tool that provides auto-discovery of test modules
+and functions, detailed info on failing assert statements, modular fixtures,
+and many external plugins.")
+    (license license:expat)))
+
 ;; Pytest 4.x are the last versions that support Python 2.
 (define-public python2-pytest
   (package
-- 
2.26.2




Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Tue, 26 May 2020 08:26:01 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edk <at> beaver-labs.com>
To: 41455 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: Add python-libtmux
Date: Tue, 26 May 2020 10:24:57 +0200
* gnu/packages/tmux.scm (python-libtmux): New variable.
---
 gnu/packages/tmux.scm | 48 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/tmux.scm b/gnu/packages/tmux.scm
index 8b54849b18..c4dd963b53 100644
--- a/gnu/packages/tmux.scm
+++ b/gnu/packages/tmux.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2019 Oleg Pykhalov <go.wigust <at> gmail.com>
 ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
+;;; Copyright © 2020 Edouard Klein <edk <at> beaver-labs.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,8 +31,11 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
+  #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses))
 
@@ -138,6 +142,50 @@ command and helper commands provided by tmuxifier to manage Tmux sessions and
 windows.")
     (license license:expat)))
 
+(define-public python-libtmux
+  (package
+    (name "python-libtmux")
+    (version "0.8.2")
+    (source
+     (origin
+       (method git-fetch)
+       ;; Pypi source tarball does not include tests
+       (uri (git-reference
+             (url "https://github.com/tmux-python/libtmux.git")
+             (commit (string-append "v" version))))
+       (file-name "python-libtmux")
+       (sha256
+        (base32
+         "1akjv6aqpc690c4l2cjh0fxbpxxg63sfjggapfjjjaqmcl38g1dz"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-pytest-4" ,python-pytest-4)
+       ("tmux" ,tmux)
+       ("procps" ,procps)))  ;; Tests need top
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             ;; Extend PYTHONPATH so the built package will be found.
+             (setenv "PYTHONPATH"
+                     (string-append (getcwd) "/build/lib:"
+                                    (getenv "PYTHONPATH")))
+             ;; Skip tests that I suspect fail because of a change
+             ;; in behavior in tmux 3 from tmux 2
+             ;; https://github.com/tmux-python/libtmux/issues/281
+             (invoke "pytest" "-vv" "-k"
+                     (string-append "not test_show_option_unknown "
+                                    "and not test_show_window_option_unknown"))
+             #t)))))
+    (home-page
+     "https://github.com/tmux-python/libtmux")
+    (synopsis "Scripting library / orm for tmux")
+    (description "Libtmux is the tool behind tmuxp, a tmux workspace manager in python.
+It builds upon tmux's target and formats to create an object mapping to traverse,
+ inspect and interact with live tmux sessions.")
+    (license license:expat)))
+
 (define-public tmux-xpanes
   (package
     (name "tmux-xpanes")
-- 
2.26.2




Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Tue, 26 May 2020 08:59:02 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edk <at> beaver-labs.com>
To: 41455 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add python-daemux
Date: Tue, 26 May 2020 10:58:48 +0200
* gnu/packages/tmux.scm (python-daemux): New variable.
---
 gnu/packages/tmux.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/tmux.scm b/gnu/packages/tmux.scm
index c4dd963b53..ace4664813 100644
--- a/gnu/packages/tmux.scm
+++ b/gnu/packages/tmux.scm
@@ -35,6 +35,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages sphinx)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses))
@@ -186,6 +187,44 @@ It builds upon tmux's target and formats to create an object mapping to traverse
  inspect and interact with live tmux sessions.")
     (license license:expat)))
 
+(define-public python-daemux
+  (package
+    (name "python-daemux")
+    (version "0.1.0")
+    (source
+     ;; We fetch from the Git repo because there are no tests in the PyPI
+     ;; archive.
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/edouardklein/daemux.git")
+             (commit "v0.1.0")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      (mkdir-p "tmptmux")
+                      (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
+                      (invoke "tmux" "new-session" "-d")
+                      (invoke "make" "test"))))))
+    (propagated-inputs
+     `(("python-libtmux" ,python-libtmux)))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-sphinx" ,python-sphinx)))
+    (home-page "https://github.com/edouardklein/daemux")
+    (synopsis
+     "Start, stop, restart and check daemons via tmux")
+    (description
+     "Daemux lets you run daemons in a tmux pane.  Users can launch long-running
+background tasks, and check these tasks' health by hand, relaunch them, etc. by attaching
+to the corresponding pane in tmux.")
+    (license license:agpl3+)))
+
 (define-public tmux-xpanes
   (package
     (name "tmux-xpanes")
-- 
2.26.2




Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Tue, 26 May 2020 13:02:03 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edou <at> rdklein.fr>
To: 41455 <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH 2/2] gnu: Add python-daemux
Date: Tue, 26 May 2020 10:57:45 +0200
Marius Bakke writes:

> Edouard Klein <edk <at> beaver-labs.com> writes:
>
>> * gnu/packages/tmux.scm (python-daemux): New variable.
>
> [...]
>   
>> +(define-public python-daemux
>> +  (package
>> +    (name "python-daemux")
>> +    (version "0.1.0")
>> +    (source
>> +     ;; We fetch from the Git repo because there are no tests in the PyPI
>> +     ;; archive.
>> +     (origin
>> +       (method git-fetch)
>> +       (uri (git-reference
>> +             (url "https://github.com/edouardklein/daemux.git")
>> +             (commit "58e30331d3cce08655cb5f55e94396568d484f9a")))
>
> This upstream looks familiar...  Do you think upstream is willing to tag
> a 0.1.0 release instead of using a "magic" commit identifier?  :-)
>

Of course :) 

>> +       (file-name (git-file-name name version))
>> +       (sha256
>> +        (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
>> +    (build-system python-build-system)
>> +    (arguments
>> +     `(#:phases (modify-phases %standard-phases
>> +                  (replace 'check
>> +                    (lambda _
>> +                      (mkdir-p "tmptmux")
>> +                      (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
>> +                      (invoke "tmux" "new-session" "-d")
>> +                      (invoke "make" "test"))))))
>
> Nice!  I guess 'tmux' needs to be a native-input if we don't propagate
> it from libtmux.
>

I'm not sure what you mean. tmux is indeed a propagated input of
python-libtmux, which is in turn a propagated input of python-daemux. Do
you mean that it should be added explicitly here instead of being
implicit ?


>> +    (propagated-inputs
>> +     `(("python-libtmux" ,python-libtmux)))
>> +    (native-inputs
>> +     `(("python-coverage" ,python-coverage)
>> +       ("python-sphinx" ,python-sphinx)))
>> +    (home-page "https://github.com/edouardklein/daemux")
>> +    (synopsis
>> +     "Start, stop, restart and check daemons via tmux")
>
> This line break is unnecessary.
>
> Otherwise LGTM, thanks!

Cool ! Thank you for reviewing.





Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Sat, 30 May 2020 12:05:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <marius <at> gnu.org>
To: Edouard Klein <edou <at> rdklein.fr>, 41455 <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH 2/2] gnu: Add python-daemux
Date: Sat, 30 May 2020 14:04:25 +0200
[Message part 1 (text/plain, inline)]
Edouard Klein <edou <at> rdklein.fr> writes:

>>> +       (file-name (git-file-name name version))
>>> +       (sha256
>>> +        (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
>>> +    (build-system python-build-system)
>>> +    (arguments
>>> +     `(#:phases (modify-phases %standard-phases
>>> +                  (replace 'check
>>> +                    (lambda _
>>> +                      (mkdir-p "tmptmux")
>>> +                      (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
>>> +                      (invoke "tmux" "new-session" "-d")
>>> +                      (invoke "make" "test"))))))
>>
>> Nice!  I guess 'tmux' needs to be a native-input if we don't propagate
>> it from libtmux.
>>
>
> I'm not sure what you mean. tmux is indeed a propagated input of
> python-libtmux, which is in turn a propagated input of python-daemux. Do
> you mean that it should be added explicitly here instead of being
> implicit ?

Yes, because in another review I recommended against propagating tmux.
The reason is that I (and presumably others) sometimes add custom
patches to my local packages.  If the vanilla tmux is propagated, I
would not be able to use python-daemux with my installed patched tmux.

Does that make sense?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Sat, 30 May 2020 12:08:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <marius <at> gnu.org>
To: Edouard Klein <edk <at> beaver-labs.com>, 41455 <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH 1/2] gnu: Add python-pytest-4
Date: Sat, 30 May 2020 14:07:07 +0200
[Message part 1 (text/plain, inline)]
Edouard Klein <edk <at> beaver-labs.com> writes:

> * gnu/packages/check.scm (python-pytest-4): New variable.

[...]
  
> +(define-public python-pytest-4
> +  (package
> +    (name "python-pytest-4")
> +    (version "4.5.0")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       ;; Pypi source tarball does not include tests
> +       (uri (git-reference
> +             (url "https://github.com/pytest-dev/pytest.git")
> +             (commit version)))
> +       (file-name "python-pytest-4")
> +       (sha256
> +        (base32
> +         "0igxfasjqabkzlb81vxqr58pfsdwjx4zzd1nc1b48wn6xnkkllhk"))))
> +    (build-system python-build-system)
> +    (propagated-inputs
> +     `(("python-atomicwrites" ,python-atomicwrites)
> +       ("python-attrs" ,python-attrs)
> +       ("python-attrs" ,python-attrs)
> +       ("python-more-itertools" ,python-more-itertools)
> +       ("python-pluggy" ,python-pluggy)
> +       ("python-six" ,python-six)
> +       ("python-py" ,python-py)
> +       ("python-wcwidth" ,python-wcwidth)))
> +    (native-inputs
> +     `(("python-setuptools-scm" ,python-setuptools-scm)
> +       ("git" ,git)))
> +    (arguments `(#:phases
> +                 (modify-phases %standard-phases
> +                   (add-after 'unpack 'git-tag
> +                     (lambda _
> +                       ;; setuptools-scm needs to know the version
> +                       (invoke "git" "init")
> +                       (invoke "git" "add" ".")
> +                       (invoke "git" "config" "user.name" "John Doe")
> +                       (invoke "git" "config" "user.email" "nobody <at> example.com")
> +                       (invoke "git" "commit" "-m" "dummy commit")
> +                       (invoke "git" "tag" ,version))))))
> +    (home-page "https://docs.pytest.org/en/latest/")
> +    (synopsis "Python testing library")
> +    (description
> +     "Pytest is a testing tool that provides auto-discovery of test modules
> +and functions, detailed info on failing assert statements, modular fixtures,
> +and many external plugins.")
> +    (license license:expat)))

Can you make this inherit from pytest instead of duplicating all the
fields?

Also, we should find a way to get rid of the git dependency.  Weird that
other versions of Pytest don't have this requirement.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Sat, 30 May 2020 12:18:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <marius <at> gnu.org>
To: Edouard Klein <edk <at> beaver-labs.com>, 41455 <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH 2/2] gnu: Add python-libtmux
Date: Sat, 30 May 2020 14:17:18 +0200
[Message part 1 (text/plain, inline)]
Edouard Klein <edk <at> beaver-labs.com> writes:

> * gnu/packages/tmux.scm (python-libtmux): New variable.

[...]
  
> +(define-public python-libtmux
> +  (package
> +    (name "python-libtmux")
> +    (version "0.8.2")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       ;; Pypi source tarball does not include tests
             PyPI                  ---->               .

See nit-picks above ^.  :-)

> +       (uri (git-reference
> +             (url "https://github.com/tmux-python/libtmux.git")
> +             (commit (string-append "v" version))))
> +       (file-name "python-libtmux")

This should be (git-file-name name version).

> +       (sha256
> +        (base32
> +         "1akjv6aqpc690c4l2cjh0fxbpxxg63sfjggapfjjjaqmcl38g1dz"))))
> +    (build-system python-build-system)
> +    (propagated-inputs
> +     `(("python-pytest-4" ,python-pytest-4)
> +       ("tmux" ,tmux)
> +       ("procps" ,procps)))  ;; Tests need top
                               ^^^
Just a single semicolon for margin comments.

Also, all of these should probably be 'native-inputs'.

> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (replace 'check
> +           (lambda _
> +             ;; Extend PYTHONPATH so the built package will be found.
> +             (setenv "PYTHONPATH"
> +                     (string-append (getcwd) "/build/lib:"
> +                                    (getenv "PYTHONPATH")))
> +             ;; Skip tests that I suspect fail because of a change
> +             ;; in behavior in tmux 3 from tmux 2
> +             ;; https://github.com/tmux-python/libtmux/issues/281
> +             (invoke "pytest" "-vv" "-k"
> +                     (string-append "not test_show_option_unknown "
> +                                    "and not test_show_window_option_unknown"))
> +             #t)))))
> +    (home-page
> +     "https://github.com/tmux-python/libtmux")

This line break is unnecessary.

> +    (synopsis "Scripting library / orm for tmux")

Can we use "Python API for tmux"?

> +    (description "Libtmux is the tool behind tmuxp, a tmux workspace manager in python.

Use @command{tmuxp}.

> +It builds upon tmux's target and formats to create an object mapping to traverse,

"target" and "formats" sounds weird.  I know it has been taken from the
upstream README, but they have links to clarify the situation.

Perhaps just "It creates object mappings to traverse, ..."
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Sat, 30 May 2020 12:20:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <marius <at> gnu.org>
To: Edouard Klein <edk <at> beaver-labs.com>, 41455 <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH] gnu: Add python-daemux
Date: Sat, 30 May 2020 14:18:58 +0200
[Message part 1 (text/plain, inline)]
Edouard Klein <edk <at> beaver-labs.com> writes:

> * gnu/packages/tmux.scm (python-daemux): New variable.

[...]
  
> +(define-public python-daemux
> +  (package
> +    (name "python-daemux")
> +    (version "0.1.0")
> +    (source
> +     ;; We fetch from the Git repo because there are no tests in the PyPI
> +     ;; archive.
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/edouardklein/daemux.git")
> +             (commit "v0.1.0")))

Use (string-append "v" version).

> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases (modify-phases %standard-phases
> +                  (replace 'check
> +                    (lambda _
> +                      (mkdir-p "tmptmux")
> +                      (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
> +                      (invoke "tmux" "new-session" "-d")
> +                      (invoke "make" "test"))))))
> +    (propagated-inputs
> +     `(("python-libtmux" ,python-libtmux)))
> +    (native-inputs
> +     `(("python-coverage" ,python-coverage)
> +       ("python-sphinx" ,python-sphinx)))
> +    (home-page "https://github.com/edouardklein/daemux")
> +    (synopsis
> +     "Start, stop, restart and check daemons via tmux")

This line break is unnecessary.

Can you send updated patches?  TIA!
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Wed, 03 Jun 2020 08:19:01 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edk <at> beaver-labs.com>
To: 41455 <at> debbugs.gnu.org
Subject: Re: bug#41455: Acknowledgement ([PATCH] gnu: Add python-daemux)
Date: Wed, 03 Jun 2020 10:17:53 +0200
So, I first removed the git dependency from pytest 4
(it turns out that by writing the version in PKG-INFO,
setuptools-scm will find it), then realized that no test
were collected and forwent the test altogether.

Then it dawned on me that as you said pytest-4 was not even necessary.
I forgot why I put it there in the first place.

So anyway, here are two patches for libtmux and daemux. Hopefully this
time I did not miss anything.

Cheers,

Edouard.



GNU bug Tracking System writes:

> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  guix-patches <at> gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 41455 <at> debbugs.gnu.org.
>
> Please do not send mail to help-debbugs <at> gnu.org unless you wish
> to report a problem with the Bug-tracking system.





Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Wed, 03 Jun 2020 08:20:02 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edk <at> beaver-labs.com>
To: 41455 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: Add python-libtmux
Date: Wed, 03 Jun 2020 10:19:29 +0200
* gnu/packages/tmux.scm (python-libtmux): New variable.
---
 gnu/packages/tmux.scm | 47 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/tmux.scm b/gnu/packages/tmux.scm
index 8b54849b18..bf9f2594e1 100644
--- a/gnu/packages/tmux.scm
+++ b/gnu/packages/tmux.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2019 Oleg Pykhalov <go.wigust <at> gmail.com>
 ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
+;;; Copyright © 2020 Edouard Klein <edk <at> beaver-labs.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,8 +31,11 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
+  #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses))
 
@@ -138,6 +142,49 @@ command and helper commands provided by tmuxifier to manage Tmux sessions and
 windows.")
     (license license:expat)))
 
+(define-public python-libtmux
+  (package
+    (name "python-libtmux")
+    (version "0.8.2")
+    (source
+     (origin
+       (method git-fetch)
+       ;; PyPI source tarball does not include tests.
+       (uri (git-reference
+             (url "https://github.com/tmux-python/libtmux.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1akjv6aqpc690c4l2cjh0fxbpxxg63sfjggapfjjjaqmcl38g1dz"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("procps" ,procps)));Tests need top.
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("tmux" ,tmux)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             ;; Extend PYTHONPATH so the built package will be found.
+             (setenv "PYTHONPATH"
+                     (string-append (getcwd) "/build/lib:"
+                                    (getenv "PYTHONPATH")))
+             ;; Skip tests that I suspect fail because of a change
+             ;; in behavior in tmux 3 from tmux 2
+             ;; https://github.com/tmux-python/libtmux/issues/281
+             (invoke "pytest" "-vv" "-k"
+                     (string-append "not test_show_option_unknown "
+                                    "and not test_show_window_option_unknown"))
+             #t)))))
+    (home-page "https://github.com/tmux-python/libtmux")
+    (synopsis "Python API for tmux")
+    (description "Libtmux is the tool behind @command{tmuxp}, a tmux workspace manager in python.
+It creates object mappings to traverse, inspect and interact with live tmux sessions.")
+    (license license:expat)))
+
 (define-public tmux-xpanes
   (package
     (name "tmux-xpanes")
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Wed, 03 Jun 2020 08:21:01 GMT) Full text and rfc822 format available.

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

From: Edouard Klein <edk <at> beaver-labs.com>
To: 41455 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: Add python-daemux
Date: Wed, 03 Jun 2020 10:20:36 +0200
* gnu/packages/tmux.scm (python-daemux): New variable.
---
 gnu/packages/tmux.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/tmux.scm b/gnu/packages/tmux.scm
index bf9f2594e1..b1f1811d8c 100644
--- a/gnu/packages/tmux.scm
+++ b/gnu/packages/tmux.scm
@@ -35,6 +35,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages sphinx)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses))
@@ -185,6 +186,44 @@ windows.")
 It creates object mappings to traverse, inspect and interact with live tmux sessions.")
     (license license:expat)))
 
+(define-public python-daemux
+  (package
+    (name "python-daemux")
+    (version "0.1.0")
+    (source
+     ;; We fetch from the Git repo because there are no tests in the PyPI
+     ;; archive.
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/edouardklein/daemux.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      (mkdir-p "tmptmux")
+                      (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
+                      (invoke "tmux" "new-session" "-d")
+                      (invoke "make" "test"))))))
+    (propagated-inputs
+     `(("python-libtmux" ,python-libtmux)))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-sphinx" ,python-sphinx)
+       ("tmux" ,tmux)))
+    (home-page "https://github.com/edouardklein/daemux")
+    (synopsis "Start, stop, restart and check daemons via tmux")
+    (description
+     "Daemux lets you run daemons in a tmux pane.  Users can launch long-running
+background tasks, and check these tasks' health by hand, relaunch them, etc. by attaching
+to the corresponding pane in tmux.")
+    (license license:agpl3+)))
+
 (define-public tmux-xpanes
   (package
     (name "tmux-xpanes")
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41455; Package guix-patches. (Mon, 22 Jun 2020 19:50:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <marius <at> gnu.org>
To: Edouard Klein <edk <at> beaver-labs.com>, 41455 <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH 1/2] gnu: Add python-libtmux
Date: Mon, 22 Jun 2020 21:49:24 +0200
[Message part 1 (text/plain, inline)]
Edouard Klein <edk <at> beaver-labs.com> writes:

> * gnu/packages/tmux.scm (python-libtmux): New variable.

Applied, thanks!  I fixed the long description line and capitalized
'Python'.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Marius Bakke <marius <at> gnu.org>:
You have taken responsibility. (Mon, 22 Jun 2020 19:53:02 GMT) Full text and rfc822 format available.

Notification sent to Edouard Klein <edk <at> beaver-labs.com>:
bug acknowledged by developer. (Mon, 22 Jun 2020 19:53:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <marius <at> gnu.org>
To: Edouard Klein <edk <at> beaver-labs.com>, 41455-done <at> debbugs.gnu.org
Subject: Re: [bug#41455] [PATCH 2/2] gnu: Add python-daemux
Date: Mon, 22 Jun 2020 21:52:23 +0200
[Message part 1 (text/plain, inline)]
Edouard Klein <edk <at> beaver-labs.com> writes:

> * gnu/packages/tmux.scm (python-daemux): New variable.

Applied, thanks!
[signature.asc (application/pgp-signature, inline)]

Reply sent to Marius Bakke <marius <at> gnu.org>:
You have taken responsibility. (Mon, 22 Jun 2020 19:53:02 GMT) Full text and rfc822 format available.

Notification sent to Edouard Klein <edk <at> beaver-labs.com>:
bug acknowledged by developer. (Mon, 22 Jun 2020 19:53:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 21 Jul 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 279 days ago.

Previous Next


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