diff mbox series

[bug#48842,6/6] gnu: Add python-myst-parser.

Message ID 20210605014655.18459-6-monego@posteo.net
State New
Headers show
Series gnu: Add python-myst-parser. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Vinicius Monego June 5, 2021, 1:46 a.m. UTC
* gnu/packages/sphinx.scm (python-myst-parser): New variable.
---
 gnu/packages/sphinx.scm | 53 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

Comments

Xinglu Chen June 5, 2021, 1:37 p.m. UTC | #1
On Sat, Jun 05 2021, Vinicius Monego wrote:

> * gnu/packages/sphinx.scm (python-myst-parser): New variable.
> ---
>  gnu/packages/sphinx.scm | 53 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 53 insertions(+)
>
> diff --git a/gnu/packages/sphinx.scm b/gnu/packages/sphinx.scm
> index 14bc3f5a79..7ec0afae8b 100644
> --- a/gnu/packages/sphinx.scm
> +++ b/gnu/packages/sphinx.scm
> @@ -44,6 +44,7 @@
>    #:use-module (gnu packages image)
>    #:use-module (gnu packages imagemagick)
>    #:use-module (gnu packages python-build)
> +  #:use-module (gnu packages python-check)
>    #:use-module (gnu packages python-crypto)
>    #:use-module (gnu packages python-web)
>    #:use-module (gnu packages python-xyz)
> @@ -603,6 +604,58 @@ and several other projects.")
>  (define-public python2-sphinx-rtd-theme
>    (package-with-python2 python-sphinx-rtd-theme))
>  
> +(define-public python-myst-parser
> +  (package
> +    (name "python-myst-parser")
> +    (version "0.14.0")
> +    (source
> +     (origin
> +       ;; There are no tests in the PyPI tarball.
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/executablebooks/myst-parser")
> +             (commit (string-append "v" version))))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "0s5lmhj1rb94na646klivzvzzhzpy03m5q9ixif9vg14yin3gm7s"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (replace 'check
> +           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
> +             (when tests?
> +               (add-installed-pythonpath inputs outputs)
> +               (invoke "python" "-m" "pytest"
> +                       ;; Tests fail with AssertionErrors like these:
> +                       ;; E -   <section id="test">
> +                       ;; E +   <div class="section" id="test">
> +                       "--ignore" "tests/test_sphinx/test_sphinx_builds.py"
> +                       ;; E -     <hlist>
> +                       ;; E +     <hlist ncolumns="2">
> +                       "-k" "not test_sphinx_directives")))))))

Maybe this is because our ‘python-sphinx’ package is outdated?  Just a
guess.

> +    (propagated-inputs
> +     `(("python-docutils" ,python-docutils)
> +       ("python-jinja2" ,python-jinja2)
> +       ("python-markdown-it-py" ,python-markdown-it-py)
> +       ("python-mdit-py-plugins"
> +        ,python-mdit-py-plugins)
> +       ("python-pyyaml" ,python-pyyaml)
> +       ("python-sphinx" ,python-sphinx)))
> +    (native-inputs
> +     `(("python-beautifulsoup4" ,python-beautifulsoup4)
> +       ("python-coverage" ,python-coverage)
> +       ("python-pytest" ,python-pytest)
> +       ("python-pytest-cov" ,python-pytest-cov)
> +       ("python-pytest-regressions"
> +        ,python-pytest-regressions)))
> +    (home-page "https://github.com/executablebooks/MyST-Parser")
> +    (synopsis "Extended commonmark compliant parser")
> +    (description
> +     "An extended commonmark compliant parser, with bridges to docutils and
> +Sphinx.")

Full sentence.  :)

Builds fine for me!
Vinicius Monego Nov. 12, 2021, 3:42 a.m. UTC | #2
Hi,

Em sáb, 2021-06-05 às 15:37 +0200, Xinglu Chen escreveu:
> On Sat, Jun 05 2021, Vinicius Monego wrote:
> 
> > * gnu/packages/sphinx.scm (python-myst-parser): New variable.
> > ---
> >  gnu/packages/sphinx.scm | 53
> > +++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 53 insertions(+)
> > 
> > diff --git a/gnu/packages/sphinx.scm b/gnu/packages/sphinx.scm
> > index 14bc3f5a79..7ec0afae8b 100644
> > --- a/gnu/packages/sphinx.scm
> > +++ b/gnu/packages/sphinx.scm
> > @@ -44,6 +44,7 @@
> >    #:use-module (gnu packages image)
> >    #:use-module (gnu packages imagemagick)
> >    #:use-module (gnu packages python-build)
> > +  #:use-module (gnu packages python-check)
> >    #:use-module (gnu packages python-crypto)
> >    #:use-module (gnu packages python-web)
> >    #:use-module (gnu packages python-xyz)
> > @@ -603,6 +604,58 @@ and several other projects.")
> >  (define-public python2-sphinx-rtd-theme
> >    (package-with-python2 python-sphinx-rtd-theme))
> >  
> > +(define-public python-myst-parser
> > +  (package
> > +    (name "python-myst-parser")
> > +    (version "0.14.0")
> > +    (source
> > +     (origin
> > +       ;; There are no tests in the PyPI tarball.
> > +       (method git-fetch)
> > +       (uri (git-reference
> > +             (url
> > "https://github.com/executablebooks/myst-parser")
> > +             (commit (string-append "v" version))))
> > +       (file-name (git-file-name name version))
> > +       (sha256
> > +        (base32
> > "0s5lmhj1rb94na646klivzvzzhzpy03m5q9ixif9vg14yin3gm7s"))))
> > +    (build-system python-build-system)
> > +    (arguments
> > +     `(#:phases
> > +       (modify-phases %standard-phases
> > +         (replace 'check
> > +           (lambda* (#:key inputs outputs tests? #:allow-other-
> > keys)
> > +             (when tests?
> > +               (add-installed-pythonpath inputs outputs)
> > +               (invoke "python" "-m" "pytest"
> > +                       ;; Tests fail with AssertionErrors like
> > these:
> > +                       ;; E -   <section id="test">
> > +                       ;; E +   <div class="section" id="test">
> > +                       "--ignore"
> > "tests/test_sphinx/test_sphinx_builds.py"
> > +                       ;; E -     <hlist>
> > +                       ;; E +     <hlist ncolumns="2">
> > +                       "-k" "not test_sphinx_directives")))))))
> 
> Maybe this is because our ‘python-sphinx’ package is outdated?  Just
> a
> guess.
> 

A very late thanks for the review.

After updating to version 0.15.2 in v3 the tests are running fine, so I
guess the problem was in upstream.

> > +    (propagated-inputs
> > +     `(("python-docutils" ,python-docutils)
> > +       ("python-jinja2" ,python-jinja2)
> > +       ("python-markdown-it-py" ,python-markdown-it-py)
> > +       ("python-mdit-py-plugins"
> > +        ,python-mdit-py-plugins)
> > +       ("python-pyyaml" ,python-pyyaml)
> > +       ("python-sphinx" ,python-sphinx)))
> > +    (native-inputs
> > +     `(("python-beautifulsoup4" ,python-beautifulsoup4)
> > +       ("python-coverage" ,python-coverage)
> > +       ("python-pytest" ,python-pytest)
> > +       ("python-pytest-cov" ,python-pytest-cov)
> > +       ("python-pytest-regressions"
> > +        ,python-pytest-regressions)))
> > +    (home-page "https://github.com/executablebooks/MyST-Parser")
> > +    (synopsis "Extended commonmark compliant parser")
> > +    (description
> > +     "An extended commonmark compliant parser, with bridges to
> > docutils and
> > +Sphinx.")
> 
> Full sentence.  :)
> 

I added full sentences in the series and removed the first 2 patches in
v3 because these were merged in another commit. Thanks again!

> Builds fine for me!
diff mbox series

Patch

diff --git a/gnu/packages/sphinx.scm b/gnu/packages/sphinx.scm
index 14bc3f5a79..7ec0afae8b 100644
--- a/gnu/packages/sphinx.scm
+++ b/gnu/packages/sphinx.scm
@@ -44,6 +44,7 @@ 
   #:use-module (gnu packages image)
   #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages python-build)
+  #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
@@ -603,6 +604,58 @@  and several other projects.")
 (define-public python2-sphinx-rtd-theme
   (package-with-python2 python-sphinx-rtd-theme))
 
+(define-public python-myst-parser
+  (package
+    (name "python-myst-parser")
+    (version "0.14.0")
+    (source
+     (origin
+       ;; There are no tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/executablebooks/myst-parser")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0s5lmhj1rb94na646klivzvzzhzpy03m5q9ixif9vg14yin3gm7s"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest"
+                       ;; Tests fail with AssertionErrors like these:
+                       ;; E -   <section id="test">
+                       ;; E +   <div class="section" id="test">
+                       "--ignore" "tests/test_sphinx/test_sphinx_builds.py"
+                       ;; E -     <hlist>
+                       ;; E +     <hlist ncolumns="2">
+                       "-k" "not test_sphinx_directives")))))))
+    (propagated-inputs
+     `(("python-docutils" ,python-docutils)
+       ("python-jinja2" ,python-jinja2)
+       ("python-markdown-it-py" ,python-markdown-it-py)
+       ("python-mdit-py-plugins"
+        ,python-mdit-py-plugins)
+       ("python-pyyaml" ,python-pyyaml)
+       ("python-sphinx" ,python-sphinx)))
+    (native-inputs
+     `(("python-beautifulsoup4" ,python-beautifulsoup4)
+       ("python-coverage" ,python-coverage)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-regressions"
+        ,python-pytest-regressions)))
+    (home-page "https://github.com/executablebooks/MyST-Parser")
+    (synopsis "Extended commonmark compliant parser")
+    (description
+     "An extended commonmark compliant parser, with bridges to docutils and
+Sphinx.")
+    (license license:expat)))
+
 (define-public python-breathe
   (package
     (name "python-breathe")