Patchwork [3/4] gnu: Add python-sphinx-argparse.

login
register
mail settings
Submitter Marius Bakke
Date Sept. 25, 2016, 9:17 p.m.
Message ID <20160925211728.7636-3-mbakke@fastmail.com>
Download mbox | patch
Permalink /patch/15996/
State New
Headers show

Comments

Marius Bakke - Sept. 25, 2016, 9:17 p.m.
* gnu/packages/python.scm (python-sphinx-argparse,
  python2-sphinx-argparse): New variables.
---
 gnu/packages/python.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
Hartmut Goebel - Sept. 26, 2016, 9:36 a.m.
Am 25.09.2016 um 23:17 schrieb Marius Bakke:
> +     `(#:configure-flags '("--single-version-externally-managed" "--root=/")

Same here, please add a comment,

BTW: What should --root=/ be goof for? AFAIK this is the default?!

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 4b8caea..bb28363 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -10967,3 +10967,48 @@  mobile-friendly responsive design.")
                                            python-sphinx-bootstrap-theme)))
            (native-inputs
             `(("python2-setuptools" ,python2-setuptools)))))
+
+(define-public python-sphinx-argparse
+  (package
+    (name "python-sphinx-argparse")
+    (version "0.1.15")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "sphinx-argparse" version))
+              (sha256
+               (base32
+                "14wdxq379xxnhw0kgf8z6jqdi0rd4k5y20jllyar9mxwwjblayvq"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:configure-flags '("--single-version-externally-managed" "--root=/")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'adjust-tests
+           ;; Two tests compare the output of "py.test --help" and fail
+           ;; when it gets ".py.test-real" back, so we substitute it here.
+           (lambda _
+             (substitute* "test/test_parser.py"
+               (("py.test") ".py.test-real"))
+             #t))
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda _ (zero? (system* "py.test" "-vv")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("python-sphinx" ,python-sphinx)
+       ("python-docutils" ,python-docutils)))
+    (home-page "https://github.com/ribozz/sphinx-argparse")
+    (synopsis "Sphinx extension to document argparse commands")
+    (description "Sphinx extension that automatically documents @code{argparse}
+commands and options.")
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-sphinx-argparse))))))
+
+(define-public python2-sphinx-argparse
+  (let ((base (package-with-python2 (strip-python2-variant
+                                     python-sphinx-argparse))))
+    (package (inherit base)
+             (native-inputs
+              `(("python2-setuptools" ,python2-setuptools)
+                ,@(package-native-inputs base))))))