[PATCH] gnu: Add python-daemux

OpenSubmitted by Edouard Klein.
Details
4 participants
  • Edouard Klein
  • Edouard Klein
  • Marius Bakke
  • Marius Bakke
Owner
unassigned
Severity
normal
Merged with
E
E
Edouard Klein wrote on 22 May 15:10 +0200
(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.scmindex 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 20:45 +0200
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 otherpackages have been appended to python-xyz.scm. To reduce change ofmerge conflicts, I recommend adding packages somewhere "in the middle".
However, I wonder if this and python-libtmux are better suited intmux.scm. WDYT?
In any case can you rebase this patch? Thanks in advance!
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7Jb1oACgkQoqBt8qM6VPpVTwf/VTLKSWHeu2jeIxKUqyuR5vH6QDA4ly/6LE/qCPzI85NE7zspXnYMr/ByTlDXZBZ24oEoHd1AgMkYWvhIQ+RjrSGgkLLXIJQFAPj2FwXyz1DYeafTWd+q5XWTItQWwhlmHJwqoeA1UKDEGBuBqfzBsqG+Z88CsXfEcY7Q3AT7VLhxHrKCSm0JS12NrFzwYj3NBg59kd+oten1JjxVisHmcg5vNUICpq4Ke5qPpiiiNu4OuDE4mxxSedZ/ujMh2RpdU/xRpHp/0E1EQ+JYTNjaVxxA6CJ0xCPBAvHNvUmlEk/3Mc/8pLyV4SQFQty+Gjn33j9ya2nVI/htuoKEhfWrZQ===Aaq+-----END PGP SIGNATURE-----
E
E
Edouard Klein wrote on 25 May 11:31 +0200
(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 leanon the side of tmux.scm. I'll send two patches for python-libtmux andpython-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 11:32 +0200
[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.scmindex 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 (packagediff --git a/gnu/packages/tmux.scm b/gnu/packages/tmux.scmindex 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 11:33 +0200
[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.scmindex 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 00:43 +0200
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 avoidthe 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 allthe 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 aspecific 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 shouldpropagate it. Some users might have custom versions of tmux, but wouldstill 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-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7MSf4ACgkQoqBt8qM6VPopWAf8C5GSdQz00GcRPaO/WqO01W+WXLVmiAh2j//0UTgAq7uZraXOaRc4Im3veLMzPqBbeyyZ6WJUKFftK+o0Q7DzjKoNRWWECFsjajCTdgRqUWwyIKTJxz4rDsRRBnjSTOFy+/TkSvT+bZnztFNRVR49JSFQhQaP7HTUUj3LKmIopFfNWrkJuYmlJDjB9pyI+d6S1QShUmIMTlrc3O/B6uO6IEY1LNqCFZXGe8BVcDcQZ6+A42bKVOJk/uYC5ymB3x17lofMkku4v8ZAc9T/snzzkWeMl0B+T1P7b9fDEetrbxND/k0tq/CW3ifbmewsa9leFldUA+7Ea3p3vusD5flKeA===LZC0-----END PGP SIGNATURE-----
M
M
Marius Bakke wrote on 26 May 00:46 +0200
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 taga 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 propagateit 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-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7MSsIACgkQoqBt8qM6VPpBWQf/XD7IHDAX9/S5rK/gZindrOGiapJyuYf39fMPkxWl7du31GrVaYKMt0RHtCxeBLji9QrrB6ZK6s1tTsClbRUv8iQzt3MWlZvT+eUFCUENzaS/+6CYM2SNiOyXE/eYEQt38srnfBnzWcgbgkBW08SwCeYWF3YfexpoUHVKBKx+6Xw12eO8oiU8U2BjhWa6FHSsFZvrsfepmP2WpPcxaXkZabaKht3yhVLoe6dne0E+UB6t5fXCelx5ZXxJ1HEhaXhTC4dFdYYpqZisJm8hVxMy6JN/0aPP8ePbUozqZx8dmIRfpE/c4rv8fvo6hEl0A0DWz1+7OWAArK27LP5+wCMVfg===mD8c-----END PGP SIGNATURE-----
M
M
Marius Bakke wrote on 26 May 01:06 +0200
(address . control@debbugs.gnu.org)
87ftbn62dj.fsf@gnu.org
merge 41208 41455thanks
E
E
Edouard Klein wrote on 26 May 10:23 +0200
(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.scmindex 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 10:24 +0200
[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.scmindex 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 10:58 +0200
[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.scmindex 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 10:57 +0200
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 ofpython-libtmux, which is in turn a propagated input of python-daemux. Doyou mean that it should be added explicitly here instead of beingimplicit ?

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 3 days ago
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 custompatches to my local packages. If the vanilla tmux is propagated, Iwould not be able to use python-daemux with my installed patched tmux.
Does that make sense?
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7SS8kACgkQoqBt8qM6VPo4swf8CBIsJqyo8rYuJXqPWnatqD7qfafekYxa1ZIvYO7TAB39eBRTEJ6hWb6CEPrYDEFTRC0ojJxhi+WflfOMWI66UqScFbB1i2wS2fE/yBdMxalWBhMSDfxRDLDPcOQs4nOFOD1p8PBVnkKFYuZtCku8kSGkiUj3fKt+JXAF9nZIi79wWo/jLDyfaTUZi7HRmrJfH1dWwiDGHx4sTxluJztn/BZlYCk3kaVwK3x2/DcDQA9Ou/t43+st8bqgEepnD4hytMm8wKI1e7018Ml1g6PYxjxRLBmyOiVfWP+9nIl/Rks0CBOO+uOuMzTbGnEYItG8lr6Ff1tzOQZa2mrwD7A3/Q===YVmE-----END PGP SIGNATURE-----
M
M
Marius Bakke wrote 3 days ago
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 thefields?
Also, we should find a way to get rid of the git dependency. Weird thatother versions of Pytest don't have this requirement.
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7STGsACgkQoqBt8qM6VPpluQf/Q07thY3DZY+Ieb8Lj4zNSLI99uNTu9OKljkPnLpDWfVMmetbvz68FEVCjAES8fZoCwLDU78bXjxrkenCn+3yuDbfdhWlchFputAQd3rHh6tEetlmV+PL2mmVno0WEA8IVT2njmcqO/7ijrZ6GAMsQxE3X2QXMMi1ndjaJVzAfbWJF83Se0x4OshN+YUp7k2cvstmEX00TfnONGphRXE5SFXA09SromoiPWDv00jhDuZQ2FdysKQYCJKJ0mwZ/PUpMGDnUJzOE42KRYvKWlmgD48WQIlH9+3++FfcyDJX4lN+9Kq+6kH0jcSnCFT7LhXAJu6Npgt4oNWWP++djeHy5w===FN+e-----END PGP SIGNATURE-----
M
M
Marius Bakke wrote 3 days ago
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 theupstream README, but they have links to clarify the situation.
Perhaps just "It creates object mappings to traverse, ..."
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7STs4ACgkQoqBt8qM6VPqqzwgAhuP+1aZfXZaUky9WIOLpDfiU7CtUa/AZ1AHADHogvOuEQtTtsToYlEU979VSV4J7Sc+fKYJFwWMMgv1+NUEtHD0kT2zLULEaSCRVtkLqCvj86/sI3XTdEKKQqRIy+/Pua97KSIssZt2eZb10VH4SgXXS9eSwgSSYE2VrxEF2qtGPTyk5RKdHO5EKrhKSglja+5Y++JGTBmgdTzEA0H2hQPsNINXpTfdgKM1wYJ8AI3rnKwCQ/7vG1+FxG6obwDS669N/lCahcMuf6RNzQZNi/Xo40TCO7tR+dYlqBnf8ZwScgMJYyB8rkFAsJFrJ9dxHaGTw0eh0Dd492WnIHTMzvQ===Hvzk-----END PGP SIGNATURE-----
M
M
Marius Bakke wrote 3 days ago
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-----
iQEyBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7STzIACgkQoqBt8qM6VPpTPAf4t7KjcbXL+vDejTefFTJ6mh0ZAGMI0N7VZ1DNkRKapwiHiQgs2bROI3k+t38QphF4NWcGyXFJdtHnMx8tpR3hKtchxbgYLfmWibkwLXrAEbBixa/616IL0ny7HHX3FhkOFtP3PCYOtOQCkpGxnyhu4jy7WrkYePlXEglQtyWp59FS60KV9rB2UojXo+7lEn4y+6bqhs/K4Z23Yq2+z15pss1h6QUTy5IPGJkON+E04ZEmqvBKqbFOZQMURE/LbDa6AMbUMvuyEXdeBLYHtG3Kbknm5Lw8kxF7e0tF/3MrGAm8UUoEM/8nyXGxiMYOUVHnY95dPXEYFa/5eUhHPNiA=1A2C-----END PGP SIGNATURE-----
?