From e81dcaa9ad6ffd507ddbd19ab8d1583b626d3dc1 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 25 Sep 2016 20:45:07 +0100 Subject: [PATCH 3/4] gnu: Add python-sphinx-argparse. * gnu/packages/python.scm (python-sphinx-argparse, python2-sphinx-argparse): New variables. --- gnu/packages/python.scm | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index c649bee..8ed0bc5 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -10969,3 +10969,50 @@ 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 + `(;; Without this flag, various artifacts from the build inputs may end up + ;; in the final output. It also works around https://bugs.gnu.org/20765 . + #: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)))))) -- 2.10.0