[arch-commits] Commit in (4 files)

Baptiste Jonglez zorun at archlinux.org
Wed Apr 18 10:01:56 UTC 2018


    Date: Wednesday, April 18, 2018 @ 10:01:54
  Author: zorun
Revision: 316858

python-sphinx-testing: initial upload

Added:
  python-sphinx-testing/
  python-sphinx-testing/trunk/
  python-sphinx-testing/trunk/0001-Skip-checking-cleanup-is-called.patch
  python-sphinx-testing/trunk/PKGBUILD

--------------------------------------------+
 0001-Skip-checking-cleanup-is-called.patch |   60 +++++++++++++++++++++++++++
 PKGBUILD                                   |   59 ++++++++++++++++++++++++++
 2 files changed, 119 insertions(+)

Added: python-sphinx-testing/trunk/0001-Skip-checking-cleanup-is-called.patch
===================================================================
--- python-sphinx-testing/trunk/0001-Skip-checking-cleanup-is-called.patch	                        (rev 0)
+++ python-sphinx-testing/trunk/0001-Skip-checking-cleanup-is-called.patch	2018-04-18 10:01:54 UTC (rev 316858)
@@ -0,0 +1,60 @@
+From 136add59744446a13a276f50cb0285e116d19fa8 Mon Sep 17 00:00:00 2001
+From: Takeshi KOMIYA <i.tkomiya at gmail.com>
+Date: Tue, 6 Mar 2018 22:10:14 +0900
+Subject: [PATCH] Skip checking cleanup() is called
+
+---
+ tests/test_util.py | 32 +++++++++++++-------------------
+ 1 file changed, 13 insertions(+), 19 deletions(-)
+
+diff --git a/tests/test_util.py b/tests/test_util.py
+index f432325..1a5ce86 100644
+--- a/tests/test_util.py
++++ b/tests/test_util.py
+@@ -96,30 +96,24 @@ class TestSphinxTesting(unittest.TestCase):
+         app = TestApp(create_new_srcdir=True)
+         self.assertTrue(app.builddir.exists())
+ 
+-        with patch("sphinx.theming.Theme") as Theme:
+-            with patch("sphinx.ext.autodoc.AutoDirective") as AutoDirective:
+-                app.cleanup()
+-                self.assertEqual(1, Theme.themes.clear.call_count)
+-                self.assertEqual(1, AutoDirective._registry.clear.call_count)
+-                self.assertFalse(app.builddir.exists())
++        with patch("sphinx.ext.autodoc.AutoDirective") as AutoDirective:
++            app.cleanup()
++            self.assertEqual(1, AutoDirective._registry.clear.call_count)
++            self.assertFalse(app.builddir.exists())
+ 
+     def test_TestApp_cleanup_when_cleanup_on_errors(self):
+         app = TestApp(create_new_srcdir=True, cleanup_on_errors=False)
+         self.assertTrue(app.builddir.exists())
+ 
+-        with patch("sphinx.theming.Theme") as Theme:
+-            with patch("sphinx.ext.autodoc.AutoDirective") as AutoDirective:
+-                app.cleanup(error=True)
+-                self.assertEqual(0, Theme.themes.clear.call_count)
+-                self.assertEqual(0, AutoDirective._registry.clear.call_count)
+-                self.assertTrue(app.builddir.exists())
+-
+-        with patch("sphinx.theming.Theme") as Theme:
+-            with patch("sphinx.ext.autodoc.AutoDirective") as AutoDirective:
+-                app.cleanup(error=None)
+-                self.assertEqual(1, Theme.themes.clear.call_count)
+-                self.assertEqual(1, AutoDirective._registry.clear.call_count)
+-                self.assertFalse(app.builddir.exists())
++        with patch("sphinx.ext.autodoc.AutoDirective") as AutoDirective:
++            app.cleanup(error=True)
++            self.assertEqual(0, AutoDirective._registry.clear.call_count)
++            self.assertTrue(app.builddir.exists())
++
++        with patch("sphinx.ext.autodoc.AutoDirective") as AutoDirective:
++            app.cleanup(error=None)
++            self.assertEqual(1, AutoDirective._registry.clear.call_count)
++            self.assertFalse(app.builddir.exists())
+ 
+     def test_with_app(self):
+         srcdir = path(__file__).dirname() / 'examples'
+-- 
+2.17.0
+

Added: python-sphinx-testing/trunk/PKGBUILD
===================================================================
--- python-sphinx-testing/trunk/PKGBUILD	                        (rev 0)
+++ python-sphinx-testing/trunk/PKGBUILD	2018-04-18 10:01:54 UTC (rev 316858)
@@ -0,0 +1,59 @@
+# Maintainer: Baptiste Jonglez <archlinux at bitsofnetworks dot org>
+
+pkgbase=python-sphinx-testing
+pkgname=(python-sphinx-testing python2-sphinx-testing)
+pkgver=0.7.2
+pkgrel=1
+pkgdesc="Testing utility classes and functions for Sphinx extensions"
+arch=('any')
+url="https://github.com/sphinx-doc/sphinx-testing"
+license=('BSD')
+makedepends=('python-setuptools' 'python2-setuptools')
+checkdepends=('python-mock' 'python-sphinx' 'python2-mock' 'python2-sphinx')
+source=("https://pypi.io/packages/source/s/sphinx-testing/sphinx-testing-$pkgver.tar.gz"
+        "0001-Skip-checking-cleanup-is-called.patch")
+sha256sums=('9d30f93007620e137b33edf19f52a7225eab853546b7e588ef09d1342e821e94'
+            '21f729deaa27b8476858f0bfa123d83fcc0583fa9fe2b3e22131fc3882f26821')
+
+prepare() {
+  cd "$srcdir/sphinx-testing-$pkgver"
+  # Fix test failure
+  patch -p1 < "$srcdir/0001-Skip-checking-cleanup-is-called.patch"
+  cp -a "$srcdir"/sphinx-testing-$pkgver{,-py2}
+}
+
+build() {
+  cd "$srcdir/sphinx-testing-$pkgver"
+  python setup.py build
+
+  cd "$srcdir/sphinx-testing-$pkgver-py2"
+  python2 setup.py build
+}
+
+check() {
+  export PYTHONPATH="$srcdir/sphinx-testing-$pkgver/src"
+  cd "$srcdir/sphinx-testing-$pkgver/tests"
+  #python setup.py test
+  python -m unittest discover
+
+  export PYTHONPATH="$srcdir/sphinx-testing-$pkgver-py2/src"
+  cd "$srcdir/sphinx-testing-$pkgver-py2/tests"
+  #python2 setup.py test
+  python2 -m unittest discover
+}
+
+package_python-sphinx-testing() {
+  depends=('python-six' 'python-sphinx')
+
+  cd "$srcdir/sphinx-testing-$pkgver"
+  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+package_python2-sphinx-testing() {
+  depends=('python2-six' 'python2-sphinx')
+
+  cd "$srcdir/sphinx-testing-$pkgver-py2"
+  python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}



More information about the arch-commits mailing list