diff mbox series

[bug#43443] gnu: Add python-pypandoc.

Message ID m1ft7iyrd5.fsf@khs-macbook.home
State Accepted
Headers show
Series [bug#43443] gnu: Add python-pypandoc. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

Konrad Hinsen Sept. 16, 2020, 9:59 a.m. UTC
* gnu/packages/python-xyz.scm (python-pypandoc): New variable.
---
 gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

Comments

Ricardo Wurmus Sept. 16, 2020, 10:09 a.m. UTC | #1
Hi Konrad,

> * gnu/packages/python-xyz.scm (python-pypandoc): New variable.
[…]

> +    (inputs
> +     `(("pandoc" ,ghc-pandoc)
> +       ("pandoc-citeproc" ,ghc-pandoc-citeproc)))

Should this really be the Haskell library variants?  Or just the
executables?  If it’s just the executables you can use the “pandoc” and
“pandoc-citeproc” packages.

> +    (propagated-inputs
> +     `(("pip" ,python-pip)
> +       ("setuptools" ,python-setuptools)
> +       ("wheel" ,python-wheel)))
> +    (native-inputs
> +     `(("texlive" ,texlive)))

It would be better to avoid this huge monolithic package.  Does
texlive-tiny work?  If it doesn’t: what else does it need that could be
added to a texlive-union?

> +    (synopsis "Python wrapper for pandoc.")

There should be no trailing period.

> +    (description "Thin Python wrapper for pandoc.")

This should be a complete sentence.
<
Konrad Hinsen Sept. 16, 2020, 2:57 p.m. UTC | #2
Hi Ricardo,

Thanks for your comments!

> Should this really be the Haskell library variants?  Or just the
> executables?  If it’s just the executables you can use the “pandoc” and
> “pandoc-citeproc” packages.

Ooops, I didn't know there were distinct packages for that! The binaries
are sufficient here.

> It would be better to avoid this huge monolithic package.  Does
> texlive-tiny work?  If it doesn’t: what else does it need that could be
> added to a texlive-union?

texlive-tiny doesn't work, and after experimenting for about an hour
I have given up on finding a small combination of packages for
a texlive-union. It needs ifluatex.sty which apparently is part of
texlive-latex-oberdiek, but if I add that package the test fails
in creating a temporary directory for whatever reason.

Another shortcut is disabling the one test case that depends
on LaTeX, and thus completely remove texlive from native-inputs.
Does that sound like an acceptable solution?

Cheers,
  Konrad
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 593bb3f468..24fc512178 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -129,6 +129,7 @@ 
   #:use-module (gnu packages gsasl)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages haskell-xyz)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
   #:use-module (gnu packages imagemagick)
@@ -21979,3 +21980,39 @@  dates in almost any string formats commonly found on web pages.")
     (description "Safety checks installed dependencies for known vulnerabilities.
 By default it uses the open Python vulnerability database Safety DB.")
   (license license:expat)))
+
+(define-public python-pypandoc
+  (package
+    (name "python-pypandoc")
+    (version "1.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pypandoc" version))
+       (sha256
+        (base32
+         "1zvn9764cf7kkjkmr9gw6wc8adpk06qxr1rhxwa9pg0zmdvrk90l"))))
+    (build-system python-build-system)
+    (inputs
+     `(("pandoc" ,ghc-pandoc)
+       ("pandoc-citeproc" ,ghc-pandoc-citeproc)))
+    (propagated-inputs
+     `(("pip" ,python-pip)
+       ("setuptools" ,python-setuptools)
+       ("wheel" ,python-wheel)))
+    (native-inputs
+     `(("texlive" ,texlive)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'disable-tests
+           (lambda _
+             ;; Disable test requiring network access
+             (substitute* "tests.py"
+               (("test_basic_conversion_from_http_url")
+                "skip_test_basic_conversion_from_http_url"))
+             #t)))))
+    (home-page "https://github.com/bebraw/pypandoc")
+    (synopsis "Python wrapper for pandoc.")
+    (description "Thin Python wrapper for pandoc.")
+    (license license:expat)))