Subject: Re: [bug#41455] [PATCH 2/2] gnu: Add python-libtmux

From: Marius Bakke <[email-masked]>
Date: Sat, 30 May 2020 14:17:18 +0200

Edouard Klein <[email-masked]> 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, ..."