[arch-commits] Commit in python-recommonmark/repos (5 files)

Felix Yan felixonmars at archlinux.org
Sat Oct 26 06:04:57 UTC 2019


    Date: Saturday, October 26, 2019 @ 06:04:54
  Author: felixonmars
Revision: 520193

archrelease: copy trunk to community-staging-any

Added:
  python-recommonmark/repos/community-staging-any/
  python-recommonmark/repos/community-staging-any/PKGBUILD
    (from rev 520192, python-recommonmark/trunk/PKGBUILD)
  python-recommonmark/repos/community-staging-any/recommonmark-disable-math-on-builds.patch
    (from rev 520192, python-recommonmark/trunk/recommonmark-disable-math-on-builds.patch)
  python-recommonmark/repos/community-staging-any/recommonmark-fix-mdnode-parent.patch
    (from rev 520192, python-recommonmark/trunk/recommonmark-fix-mdnode-parent.patch)
  python-recommonmark/repos/community-staging-any/recommonmark-sphinx-refdomain-fix.patch
    (from rev 520192, python-recommonmark/trunk/recommonmark-sphinx-refdomain-fix.patch)

-------------------------------------------+
 PKGBUILD                                  |   89 ++++++++++++++++++++++++++++
 recommonmark-disable-math-on-builds.patch |   59 ++++++++++++++++++
 recommonmark-fix-mdnode-parent.patch      |   25 +++++++
 recommonmark-sphinx-refdomain-fix.patch   |   72 ++++++++++++++++++++++
 4 files changed, 245 insertions(+)

Copied: python-recommonmark/repos/community-staging-any/PKGBUILD (from rev 520192, python-recommonmark/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2019-10-26 06:04:54 UTC (rev 520193)
@@ -0,0 +1,89 @@
+# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
+
+pkgbase=python-recommonmark
+pkgname=('python-recommonmark' 'python2-recommonmark')
+pkgver=0.4.0.133.c410abb
+pkgrel=5
+_gitcommit=c410abb565a3c4ad4de0ce204ab2fa2db8031cf1
+pkgdesc='Markdown parser for docutils'
+url='https://github.com/readthedocs/recommonmark'
+arch=('any')
+license=('MIT')
+makedepends=('git'
+             'python-setuptools' 'python-commonmark' 'python-docutils' 'python-sphinx'
+             'python2-setuptools' 'python2-commonmark' 'python2-docutils' 'python2-sphinx')
+checkdepends=('python-pytest' 'python2-pytest')
+source=(${pkgbase}::"git+https://github.com/readthedocs/recommonmark#commit=$_gitcommit"
+        recommonmark-disable-math-on-builds.patch
+        recommonmark-sphinx-refdomain-fix.patch
+        recommonmark-fix-mdnode-parent.patch)
+sha512sums=('SKIP'
+            '66ef07ac21643b913c8ee551c7c71753fcb6442712e4fb11b84ea5f34265715471759b2c5a1badc1e299ca6aa831713b12284144801616349b2db61738607e8a'
+            'df2440e7ce927ca6adc31e07f9e375fa4643bbe1c33a34821d3d3e5d9d4b2ae8bbdf7412a8f2c64d343c9004f54a4a650fc59e461b3b1eb1ab11c1dec02422fd'
+            '89745108ad78349ace30582cb28f8693edc109c97e94182a37afe5219bec8988bb785d77594e34306facf0eaa4e640c0bdf4e53249d6154094222e58df9498e9')
+
+pkgver() {
+  cd ${pkgbase}
+  printf "%s.%s.%s" \
+    "$(PYTHONPATH=. python -c 'print(__import__('"'recommonmark'"').__version__)')" \
+    "$(git rev-list --count HEAD)" \
+    "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+  patch -d ${pkgbase} -p1 < "${srcdir}/recommonmark-disable-math-on-builds.patch"
+  patch -d ${pkgbase} -p1 < "${srcdir}/recommonmark-sphinx-refdomain-fix.patch"
+  patch -d ${pkgbase} -p1 < "${srcdir}/recommonmark-fix-mdnode-parent.patch"
+  cp -a ${pkgbase}{,-py2}
+  for tool in cm2{html,latex,man,pseudoxml,xetex,xml}; do
+    sed -r "s|(${tool}) |\12 |g" -i ${pkgbase}-py2/setup.py
+  done
+}
+
+build() {
+  msg2 "Building python..."
+  (cd ${pkgbase}
+    python setup.py build
+    make -j1 -C docs text man SPHINXBUILD=sphinx-build
+  )
+  msg2 "Building python2..."
+  (cd ${pkgbase}-py2
+    python2 setup.py build
+    make -j1 -C docs text man SPHINXBUILD=sphinx-build2
+  )
+}
+
+check() {
+  msg2 "Checking python..."
+  (cd ${pkgbase}
+    py.test
+  )
+  msg2 "Checking python2..."
+  (cd ${pkgbase}-py2
+    py.test2
+  )
+}
+
+package_python-recommonmark() {
+  depends=('python-docutils' 'python-commonmark' 'python-setuptools' 'python-sphinx')
+
+  cd ${pkgbase}
+  python setup.py install --root="${pkgdir}" --skip-build -O1
+  install -Dm 644 license.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
+  install -Dm 644 README.md CHANGELOG.md -t "${pkgdir}/usr/share/doc/${pkgname}"
+  install -Dm 644 docs/_build/text/*.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
+  install -Dm 644 docs/_build/man/recommonmark.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
+}
+
+package_python2-recommonmark() {
+  depends=('python2-docutils' 'python2-commonmark' 'python2-setuptools' 'python2-sphinx')
+
+  cd ${pkgbase}-py2
+  python2 setup.py install --root="${pkgdir}" --skip-build -O1
+  install -Dm 644 license.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
+  install -Dm 644 README.md CHANGELOG.md -t "${pkgdir}/usr/share/doc/${pkgname}"
+  install -Dm 644 docs/_build/text/*.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
+  install -Dm 644 docs/_build/man/recommonmark.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
+}
+
+# vim: ts=2 sw=2 et:

Copied: python-recommonmark/repos/community-staging-any/recommonmark-disable-math-on-builds.patch (from rev 520192, python-recommonmark/trunk/recommonmark-disable-math-on-builds.patch)
===================================================================
--- community-staging-any/recommonmark-disable-math-on-builds.patch	                        (rev 0)
+++ community-staging-any/recommonmark-disable-math-on-builds.patch	2019-10-26 06:04:54 UTC (rev 520193)
@@ -0,0 +1,59 @@
+From 5a14811519a219b88c96b5b9bc3103ce5d758dc4 Mon Sep 17 00:00:00 2001
+From: Eric Holscher <eric at ericholscher.com>
+Date: Fri, 9 Aug 2019 11:37:09 -0700
+Subject: [PATCH] Disable math on builds to fix doc building
+
+---
+ docs/auto_structify.md | 6 ++++++
+ docs/conf.py           | 2 ++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/docs/auto_structify.md b/docs/auto_structify.md
+index 52eba2e..c4d58e5 100644
+--- a/docs/auto_structify.md
++++ b/docs/auto_structify.md
+@@ -134,6 +134,8 @@ def function():
+ ### Math Formula
+ You can normally write latex math formula with `math` codeblock. See also [Inline Math](#inline-math).
+ 
++**Warning**: Math is currently broken on some Sphinx builds
++
+ Example
+ 
+ ````
+@@ -149,6 +151,7 @@ E = m c^2
+ ```
+ 
+ ### Embed reStructuredText
++
+ Recommonmark also allows embedding reStructuredText syntax in the codeblocks.
+ There are two styles for embedding reStructuredText. The first is enabled by `eval_rst` codeblock. The content of codeblock will be parsed as reStructuredText and insert into the document. This can be used to quickly introduce some of reStructuredText command that not yet available in markdown. For example,
+ 
+@@ -243,11 +246,14 @@ The `<div style="clear: right;"></div>` line clears the sidebar for the next tit
+ 
+ Inline Math
+ -----------
++
+ Besides the [Math Formula](#math-formula), you can also write latex math in inline codeblock text. You can do so by inserting `$`
+ in the beginning and end of inline codeblock.
+ 
+ Example
+ 
++**Warning**: Math is currently broken on some Sphinx builds
++
+ ```
+ This formula `$ y=\sum_{i=1}^n g(x_i) $`
+ ```
+diff --git a/docs/conf.py b/docs/conf.py
+index 5c2f8c1..a67cc99 100644
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -295,6 +295,8 @@ def setup(app):
+     app.add_config_value('recommonmark_config', {
+         #'url_resolver': lambda url: github_doc_root + url,
+         'auto_toc_tree_section': 'Contents',
++        'enable_math': False,
++        'enable_inline_math': False,
+         'enable_eval_rst': True,
+         'enable_auto_doc_ref': True,
+     }, True)

Copied: python-recommonmark/repos/community-staging-any/recommonmark-fix-mdnode-parent.patch (from rev 520192, python-recommonmark/trunk/recommonmark-fix-mdnode-parent.patch)
===================================================================
--- community-staging-any/recommonmark-fix-mdnode-parent.patch	                        (rev 0)
+++ community-staging-any/recommonmark-fix-mdnode-parent.patch	2019-10-26 06:04:54 UTC (rev 520193)
@@ -0,0 +1,25 @@
+From c38a2fe8c0427d74edf94627d3bc4bf43306d385 Mon Sep 17 00:00:00 2001
+From: anthraxx <levente at leventepolyak.net>
+Date: Mon, 11 Sep 2017 23:25:14 +0200
+Subject: [PATCH] guard mdnode.parent.sourcepos if not existent
+
+---
+ recommonmark/parser.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/recommonmark/parser.py b/recommonmark/parser.py
+index e54fdf4..f651467 100644
+--- a/recommonmark/parser.py
++++ b/recommonmark/parser.py
+@@ -131,7 +131,7 @@ class CommonMarkParser(parsers.Parser):
+         # these mdnodes won't have sourcepos on them for whatever reason. This
+         # is better than 0 though.
+         ref_node.line = (mdnode.sourcepos[0][0] if mdnode.sourcepos
+-                         else mdnode.parent.sourcepos[0][0])
++                         else mdnode.parent.sourcepos[0][0] if mdnode.parent.sourcepos else 0)
+         if mdnode.title:
+             ref_node['title'] = mdnode.title
+         next_node = ref_node
+-- 
+2.14.1
+

Copied: python-recommonmark/repos/community-staging-any/recommonmark-sphinx-refdomain-fix.patch (from rev 520192, python-recommonmark/trunk/recommonmark-sphinx-refdomain-fix.patch)
===================================================================
--- community-staging-any/recommonmark-sphinx-refdomain-fix.patch	                        (rev 0)
+++ community-staging-any/recommonmark-sphinx-refdomain-fix.patch	2019-10-26 06:04:54 UTC (rev 520193)
@@ -0,0 +1,72 @@
+From 90d07fbe8fccaeb0da0ed7708e4c2a89f33c2426 Mon Sep 17 00:00:00 2001
+From: anthraxx <levente at leventepolyak.net>
+Date: Mon, 7 Aug 2017 15:50:41 +0200
+Subject: [PATCH] fix for modern sphinx require refdomain
+
+---
+ recommonmark/parser.py |  1 +
+ tests/test_basic.py    | 10 +++++-----
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/recommonmark/parser.py b/recommonmark/parser.py
+index e54fdf4..c3c27ac 100644
+--- a/recommonmark/parser.py
++++ b/recommonmark/parser.py
+@@ -141,6 +141,7 @@ class CommonMarkParser(parsers.Parser):
+             wrap_node = addnodes.pending_xref(
+                 reftarget=mdnode.destination,
+                 reftype='any',
++                refdomain='',
+                 refexplicit=True,
+                 refwarn=True
+             )
+diff --git a/tests/test_basic.py b/tests/test_basic.py
+index 0e703dc..ca1a08c 100644
+--- a/tests/test_basic.py
++++ b/tests/test_basic.py
+@@ -183,7 +183,7 @@ class TestParsing(unittest.TestCase):
+             <?xml version="1.0" ?>
+             <document source="<string>">
+               <paragraph>
+-                <pending_xref refexplicit="True" reftarget="/foo" reftype="any" refwarn="True">
++                <pending_xref refdomain="" refexplicit="True" reftarget="/foo" reftype="any" refwarn="True">
+                   <reference refuri="/foo">link</reference>
+                 </pending_xref>
+               </paragraph>
+@@ -198,7 +198,7 @@ class TestParsing(unittest.TestCase):
+             <?xml version="1.0" ?>
+             <document source="<string>">
+               <paragraph>
+-                <pending_xref refexplicit="True" reftarget="foo" reftype="any" refwarn="True">
++                <pending_xref refdomain="" refexplicit="True" reftarget="foo" reftype="any" refwarn="True">
+                   <reference refuri="foo">link</reference>
+                 </pending_xref>
+               </paragraph>
+@@ -274,21 +274,21 @@ class TestParsing(unittest.TestCase):
+               <bullet_list>
+                 <list_item>
+                   <paragraph>
+-                    <pending_xref refexplicit="True" reftarget="/1" reftype="any" refwarn="True">
++                    <pending_xref refdomain="" refexplicit="True" reftarget="/1" reftype="any" refwarn="True">
+                       <reference refuri="/1">List item 1</reference>
+                     </pending_xref>
+                   </paragraph>
+                 </list_item>
+                 <list_item>
+                   <paragraph>
+-                    <pending_xref refexplicit="True" reftarget="/2" reftype="any" refwarn="True">
++                    <pending_xref refdomain="" refexplicit="True" reftarget="/2" reftype="any" refwarn="True">
+                       <reference refuri="/2">List item 2</reference>
+                     </pending_xref>
+                   </paragraph>
+                 </list_item>
+                 <list_item>
+                   <paragraph>
+-                    <pending_xref refexplicit="True" reftarget="/3" reftype="any" refwarn="True">
++                    <pending_xref refdomain="" refexplicit="True" reftarget="/3" reftype="any" refwarn="True">
+                       <reference refuri="/3">List item 3</reference>
+                     </pending_xref>
+                   </paragraph>
+-- 
+2.13.3
+



More information about the arch-commits mailing list