[PATCH] gnu: Add python-daemux

  • Done
  • quality assurance status badge
Details
4 participants
  • Edouard Klein
  • Edouard Klein
  • Marius Bakke
  • Marius Bakke
Owner
unassigned
Submitted by
Edouard Klein
Severity
normal
Merged with
E
E
Edouard Klein wrote on 22 May 2020 15:10
(address . guix-patches@gnu.org)
87d06wazez.fsf@alice.lan
* /gnu/packages/python-xyz.scm (python-daemux): New variable
---
gnu/packages/python-xyz.scm | 38 +++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (48 lines)
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
M
M
Marius Bakke wrote on 23 May 2020 20:45
87r1va7an9.fsf@devup.no
Edouard Klein <edk@beaver-labs.com> writes:

Toggle quote (2 lines)
> * /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!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7Jb1oACgkQoqBt8qM6
VPpVTwf/VTLKSWHeu2jeIxKUqyuR5vH6QDA4ly/6LE/qCPzI85NE7zspXnYMr/By
TlDXZBZ24oEoHd1AgMkYWvhIQ+RjrSGgkLLXIJQFAPj2FwXyz1DYeafTWd+q5XWT
ItQWwhlmHJwqoeA1UKDEGBuBqfzBsqG+Z88CsXfEcY7Q3AT7VLhxHrKCSm0JS12N
rFzwYj3NBg59kd+oten1JjxVisHmcg5vNUICpq4Ke5qPpiiiNu4OuDE4mxxSedZ/
ujMh2RpdU/xRpHp/0E1EQ+JYTNjaVxxA6CJ0xCPBAvHNvUmlEk/3Mc/8pLyV4SQF
Qty+Gjn33j9ya2nVI/htuoKEhfWrZQ==
=Aaq+
-----END PGP SIGNATURE-----

E
E
Edouard Klein wrote on 25 May 2020 11:31
(address . 41455@debbugs.gnu.org)
871rn8jr7y.fsf@alice.lan
Hi !

Thank you for reviewing the patches.

Marius Bakke writes:

Toggle quote (9 lines)
> Edouard Klein <edk@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 :)

Toggle quote (4 lines)
>
> 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.

Toggle quote (2 lines)
>
> In any case can you rebase this patch? Thanks in advance!
E
E
Edouard Klein wrote on 25 May 2020 11:32
[PATCH 1/2] gnu: Add python-libtmux
(address . 41455@debbugs.gnu.org)
87y2pgiclc.fsf@alice.lan
* 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(+)

Toggle diff (151 lines)
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@leibniz-psychology.org>
;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com>
+;;; Copyright © 2020 Edouard Klein <edk@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@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@tobias.gr>
;;; Copyright © 2019 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2020 Edouard Klein <edk@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
E
E
Edouard Klein wrote on 25 May 2020 11:33
[PATCH 2/2] gnu: Add python-daemux
(address . 41455@debbugs.gnu.org)
87v9kkick4.fsf@alice.lan
* gnu/packages/tmux.scm (python-daemux): New variable.
---
gnu/packages/tmux.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (59 lines)
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
M
M
Marius Bakke wrote on 26 May 2020 00:43
Re: [bug#41455] [PATCH 1/2] gnu: Add python-libtmux
87pnar63gh.fsf@gnu.org
Edouard Klein <edk@beaver-labs.com> writes:

Toggle quote (3 lines)
> * 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?

Toggle quote (15 lines)
> + (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@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.

[...]
Toggle quote (19 lines)
> +(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.

Toggle quote (2 lines)
> + ("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?

Toggle quote (2 lines)
> + ("procps" ,procps))) ;; Tests need top

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

Toggle quote (19 lines)
> + (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?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7MSf4ACgkQoqBt8qM6
VPopWAf8C5GSdQz00GcRPaO/WqO01W+WXLVmiAh2j//0UTgAq7uZraXOaRc4Im3v
eLMzPqBbeyyZ6WJUKFftK+o0Q7DzjKoNRWWECFsjajCTdgRqUWwyIKTJxz4rDsRR
BnjSTOFy+/TkSvT+bZnztFNRVR49JSFQhQaP7HTUUj3LKmIopFfNWrkJuYmlJDjB
9pyI+d6S1QShUmIMTlrc3O/B6uO6IEY1LNqCFZXGe8BVcDcQZ6+A42bKVOJk/uYC
5ymB3x17lofMkku4v8ZAc9T/snzzkWeMl0B+T1P7b9fDEetrbxND/k0tq/CW3ifb
mewsa9leFldUA+7Ea3p3vusD5flKeA==
=LZC0
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 26 May 2020 00:46
Re: [bug#41455] [PATCH 2/2] gnu: Add python-daemux
87mu5v63b1.fsf@gnu.org
Edouard Klein <edk@beaver-labs.com> writes:

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

[...]
Toggle quote (13 lines)
> +(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? :-)

Toggle quote (13 lines)
> + (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.

Toggle quote (9 lines)
> + (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!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7MSsIACgkQoqBt8qM6
VPpBWQf/XD7IHDAX9/S5rK/gZindrOGiapJyuYf39fMPkxWl7du31GrVaYKMt0RH
tCxeBLji9QrrB6ZK6s1tTsClbRUv8iQzt3MWlZvT+eUFCUENzaS/+6CYM2SNiOyX
E/eYEQt38srnfBnzWcgbgkBW08SwCeYWF3YfexpoUHVKBKx+6Xw12eO8oiU8U2Bj
hWa6FHSsFZvrsfepmP2WpPcxaXkZabaKht3yhVLoe6dne0E+UB6t5fXCelx5ZXxJ
1HEhaXhTC4dFdYYpqZisJm8hVxMy6JN/0aPP8ePbUozqZx8dmIRfpE/c4rv8fvo6
hEl0A0DWz1+7OWAArK27LP5+wCMVfg==
=mD8c
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 26 May 2020 01:06
(address . control@debbugs.gnu.org)
87ftbn62dj.fsf@gnu.org
merge 41208 41455
thanks
E
E
Edouard Klein wrote on 26 May 2020 10:23
(address . 41455@debbugs.gnu.org)
87imgjyuir.fsf@alice.lan
* gnu/packages/check.scm (python-pytest-4): New variable.
---
gnu/packages/check.scm | 49 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)

Toggle diff (76 lines)
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@leibniz-psychology.org>
;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com>
+;;; Copyright © 2020 Edouard Klein <edk@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@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
E
E
Edouard Klein wrote on 26 May 2020 10:24
[PATCH 2/2] gnu: Add python-libtmux
(address . 41455@debbugs.gnu.org)
87ftbnyug6.fsf@alice.lan
* gnu/packages/tmux.scm (python-libtmux): New variable.
---
gnu/packages/tmux.scm | 48 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)

Toggle diff (77 lines)
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@tobias.gr>
;;; Copyright © 2019 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2020 Edouard Klein <edk@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
E
E
Edouard Klein wrote on 26 May 2020 10:58
[PATCH] gnu: Add python-daemux
(address . 41455@debbugs.gnu.org)
87a71vysvr.fsf@alice.lan
* gnu/packages/tmux.scm (python-daemux): New variable.
---
gnu/packages/tmux.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (59 lines)
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
E
E
Edouard Klein wrote on 26 May 2020 10:57
Re: [bug#41455] [PATCH 2/2] gnu: Add python-daemux
(address . 41455@debbugs.gnu.org)
87d06rysxi.fsf@alice.lan
Marius Bakke writes:

Toggle quote (23 lines)
> Edouard Klein <edk@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 :)

Toggle quote (17 lines)
>> + (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 ?


Toggle quote (13 lines)
>> + (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.
M
M
Marius Bakke wrote on 30 May 2020 14:04
87d06l39yu.fsf@gnu.org
Edouard Klein <edou@rdklein.fr> writes:

Toggle quote (22 lines)
>>> + (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?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7SS8kACgkQoqBt8qM6
VPo4swf8CBIsJqyo8rYuJXqPWnatqD7qfafekYxa1ZIvYO7TAB39eBRTEJ6hWb6C
EPrYDEFTRC0ojJxhi+WflfOMWI66UqScFbB1i2wS2fE/yBdMxalWBhMSDfxRDLDP
cOQs4nOFOD1p8PBVnkKFYuZtCku8kSGkiUj3fKt+JXAF9nZIi79wWo/jLDyfaTUZ
i7HRmrJfH1dWwiDGHx4sTxluJztn/BZlYCk3kaVwK3x2/DcDQA9Ou/t43+st8bqg
EepnD4hytMm8wKI1e7018Ml1g6PYxjxRLBmyOiVfWP+9nIl/Rks0CBOO+uOuMzTb
GnEYItG8lr6Ff1tzOQZa2mrwD7A3/Q==
=YVmE
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 30 May 2020 14:07
Re: [bug#41455] [PATCH 1/2] gnu: Add python-pytest-4
87a71p39uc.fsf@gnu.org
Edouard Klein <edk@beaver-labs.com> writes:

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

[...]
Toggle quote (47 lines)
> +(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@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.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7STGsACgkQoqBt8qM6
VPpluQf/Q07thY3DZY+Ieb8Lj4zNSLI99uNTu9OKljkPnLpDWfVMmetbvz68FEVC
jAES8fZoCwLDU78bXjxrkenCn+3yuDbfdhWlchFputAQd3rHh6tEetlmV+PL2mmV
no0WEA8IVT2njmcqO/7ijrZ6GAMsQxE3X2QXMMi1ndjaJVzAfbWJF83Se0x4OshN
+YUp7k2cvstmEX00TfnONGphRXE5SFXA09SromoiPWDv00jhDuZQ2FdysKQYCJKJ
0mwZ/PUpMGDnUJzOE42KRYvKWlmgD48WQIlH9+3++FfcyDJX4lN+9Kq+6kH0jcSn
CFT7LhXAJu6Npgt4oNWWP++djeHy5w==
=FN+e
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 30 May 2020 14:17
Re: [bug#41455] [PATCH 2/2] gnu: Add python-libtmux
877dwt39dd.fsf@gnu.org
Edouard Klein <edk@beaver-labs.com> writes:

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

[...]
Toggle quote (8 lines)
> +(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 ^. :-)

Toggle quote (5 lines)
> + (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).

Toggle quote (8 lines)
> + (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'.

Toggle quote (19 lines)
> + (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.

Toggle quote (2 lines)
> + (synopsis "Scripting library / orm for tmux")

Can we use "Python API for tmux"?

Toggle quote (2 lines)
> + (description "Libtmux is the tool behind tmuxp, a tmux workspace manager in python.

Use @command{tmuxp}.

Toggle quote (2 lines)
> +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, ..."
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7STs4ACgkQoqBt8qM6
VPqqzwgAhuP+1aZfXZaUky9WIOLpDfiU7CtUa/AZ1AHADHogvOuEQtTtsToYlEU9
79VSV4J7Sc+fKYJFwWMMgv1+NUEtHD0kT2zLULEaSCRVtkLqCvj86/sI3XTdEKKQ
qRIy+/Pua97KSIssZt2eZb10VH4SgXXS9eSwgSSYE2VrxEF2qtGPTyk5RKdHO5EK
rhKSglja+5Y++JGTBmgdTzEA0H2hQPsNINXpTfdgKM1wYJ8AI3rnKwCQ/7vG1+Fx
G6obwDS669N/lCahcMuf6RNzQZNi/Xo40TCO7tR+dYlqBnf8ZwScgMJYyB8rkFAs
JFrJ9dxHaGTw0eh0Dd492WnIHTMzvQ==
=Hvzk
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 30 May 2020 14:18
Re: [bug#41455] [PATCH] gnu: Add python-daemux
874krx39al.fsf@gnu.org
Edouard Klein <edk@beaver-labs.com> writes:

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

[...]
Toggle quote (13 lines)
> +(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).

Toggle quote (21 lines)
> + (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!
-----BEGIN PGP SIGNATURE-----

iQEyBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7STzIACgkQoqBt8qM6
VPpTPAf4t7KjcbXL+vDejTefFTJ6mh0ZAGMI0N7VZ1DNkRKapwiHiQgs2bROI3k+
t38QphF4NWcGyXFJdtHnMx8tpR3hKtchxbgYLfmWibkwLXrAEbBixa/616IL0ny7
HHX3FhkOFtP3PCYOtOQCkpGxnyhu4jy7WrkYePlXEglQtyWp59FS60KV9rB2UojX
o+7lEn4y+6bqhs/K4Z23Yq2+z15pss1h6QUTy5IPGJkON+E04ZEmqvBKqbFOZQMU
RE/LbDa6AMbUMvuyEXdeBLYHtG3Kbknm5Lw8kxF7e0tF/3MrGAm8UUoEM/8nyXGx
iMYOUVHnY95dPXEYFa/5eUhHPNiA
=1A2C
-----END PGP SIGNATURE-----

E
E
Edouard Klein wrote on 3 Jun 2020 10:17
Re: bug#41455: Acknowledgement ([PATCH] gnu: Add python-daemux)
(address . 41455@debbugs.gnu.org)
875zc8r2a6.fsf@alice.lan
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:

Toggle quote (16 lines)
> 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@gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 41455@debbugs.gnu.org.
>
> Please do not send mail to help-debbugs@gnu.org unless you wish
> to report a problem with the Bug-tracking system.
E
E
Edouard Klein wrote on 3 Jun 2020 10:19
[PATCH 1/2] gnu: Add python-libtmux
(address . 41455@debbugs.gnu.org)
87367cr27i.fsf@alice.lan
* gnu/packages/tmux.scm (python-libtmux): New variable.
---
gnu/packages/tmux.scm | 47 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)

Toggle diff (76 lines)
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@tobias.gr>
;;; Copyright © 2019 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2020 Edouard Klein <edk@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
E
E
Edouard Klein wrote on 3 Jun 2020 10:20
[PATCH 2/2] gnu: Add python-daemux
(address . 41455@debbugs.gnu.org)
87zh9kpnl7.fsf@alice.lan
* gnu/packages/tmux.scm (python-daemux): New variable.
---
gnu/packages/tmux.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (59 lines)
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
M
M
Marius Bakke wrote on 22 Jun 2020 21:49
Re: [bug#41455] [PATCH 1/2] gnu: Add python-libtmux
87pn9qc24b.fsf@gnu.org
Edouard Klein <edk@beaver-labs.com> writes:

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

Applied, thanks! I fixed the long description line and capitalized
'Python'.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7xC0QACgkQoqBt8qM6
VPoeTwf/TQK6ZN/7kuvWyAzrsq97ol1mTtr5zoOKi264DPvO0cUQnRPsD+0C6XGZ
SQTLZNgAPRmATgvAMtWAZ5FWOtmwgI+ewcbxpJ4tPjhTwretabrbweIYdbyekXGJ
2TTQKQ2oXkcLL3XYX/ZXeBvW+csu4+3AiNr1imyCwju/VB/ijvjvszl2gu7AZzNm
Pc+G70YWuGPrnaHIQ0v3iql+YR1mnmCGHE1h5uWtrGxGO5Rd/cgxXDNtFAvhcM4E
czsVzJQBY/I6M4s1ptdyjt97nDktZVY9nMk4OpUzmFEBjXL2e/A7MNOknTykj5a9
N6EKR5gSN6lmKSe/GmGRMqNC3XAzNw==
=2nxD
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 22 Jun 2020 21:52
Re: [bug#41455] [PATCH 2/2] gnu: Add python-daemux
87mu4uc1zc.fsf@gnu.org
Edouard Klein <edk@beaver-labs.com> writes:

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

Applied, thanks!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7xC/cACgkQoqBt8qM6
VPpEVggAjUrnJhGWCShhAIplivVFP42MN/V/i+1tCagFi/9xqF0cx/MZ6Rv9o1Vo
l1GzwNi/5aFCgfhnhmYFS3sF3+IgsniTsTUEzuu6SEB6ffjzZTbxkb5pAZyQjtEF
1v58IFEHYdyYnMH1+iJ2Mso3a40LUBFEG7G26r14izZkslW8tPngR7fxXWihkrbl
WjW31Jw1M9s/xOrtgO/p086VXFVV58o+zqosupblPNpfqxGQoNZ8oLm3jgY2nHZZ
Ea2u1KtxDa3MVt1yjCMqmKc6b/tj8kb7Y6XsUwDoYe39JlHPzn6ysZ2NBybDI05j
5rXm70BD8l4TOTC/5BXJ1Uy3/g8w1A==
=WRpu
-----END PGP SIGNATURE-----

Closed
?