diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 6782732..76ccb54 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -11,29 +11,48 @@ pkgdesc="A discovery-based unittest extension" arch=('any') url='https://readthedocs.org/docs/nose/' license=('LGPL2.1') -makedepends=('python' 'python-setuptools' 'python2' 'python2-setuptools' 'python2-sphinx') -source=("https://pypi.python.org/packages/source/n/nose/nose-${pkgver}.tar.gz"{,.asc}) +makedepends=('python' 'python-setuptools' 'python2' 'python2-setuptools' 'python-sphinx') +source=("https://pypi.python.org/packages/source/n/nose/nose-${pkgver}.tar.gz"{,.asc} + sphinx-body-max-width.diff + sphinx-class-directives.diff + sphinx-html_sidebars.diff + docs-sys.path.diff) sha512sums=('e65c914f621f8da06b9ab11a0ff2763d6e29b82ce2aaed56da0e3773dc899d9deb1f20015789d44c65a5dad7214520f5b659b3f8d7695fb207ad3f78e5cf1b62' - 'SKIP') + 'SKIP' + 'e6816e5e3a4570881f0181fe06fa7ab1c43386b05f15b8f36bd819f944e0f2c650ee43bbd874ef16d567c787fe8ec1bf256e5085f40dd81e5d2827b6212d66f1' + 'e7bcbee30a334c058080b8bc9cb0233912a24730f8178b7b98b1324804f47770be97ba8bdeec99570da253495bd87165870bea1ffef921b6645a49e7aa9e6944' + '81e28aa2120eefbdb33548d9582ff143eb82157ad8f46d28421f1fb7a331a7d8af8d89bc4a15203cee084679993aaa65f45d674f21430a7e9954d9f5727906f6' + '21c49ba412540a9c807fba5026ee7cbb00f40bf07f17d58136099d2222619ecb40f4ab27cca0518a490b51b54da5039462c66a3618a9457d85b8ca817868f365') validpgpkeys=('58B277C0D208F7AC460C07C84548B3A8C0D70C12') # John Szakmeister +prepare() { + sed -i -e "s:man/man1:share/man/man1:g" nose-$pkgver/setup.py + cp -r nose-$pkgver nose2-$pkgver + cd nose-$pkgver + patch -p1 -i ../sphinx-body-max-width.diff + patch -p1 -i ../sphinx-class-directives.diff + patch -p1 -i ../sphinx-html_sidebars.diff + patch -p1 -i ../docs-sys.path.diff +} + build() { - cd "$srcdir/nose-$pkgver" - sed -i -e "s:man/man1:share/man/man1:g" setup.py - cp -R "$srcdir/nose-$pkgver" "$srcdir/nose2-$pkgver" + cd nose-$pkgver + python3 setup.py build + cd ../nose2-$pkgver + python2 setup.py build } package_python-nose() { depends=('python' 'python-setuptools') - cd "$srcdir/nose-$pkgver" - python3 setup.py install --prefix=/usr --root="${pkgdir}" + cd nose-$pkgver + python3 setup.py install --skip-build --optimize=1 --root="${pkgdir}" ln -s nosetests "$pkgdir/usr/bin/nosetests3" } package_python2-nose() { depends=('python2' 'python2-setuptools') - cd "$srcdir/nose2-$pkgver" - python2 setup.py install --prefix=/usr --root="${pkgdir}" + cd nose2-$pkgver + python2 setup.py install --skip-build --optimize=1 --root="${pkgdir}" mv "$pkgdir/usr/bin/nosetests" "$pkgdir/usr/bin/nosetests2" rm -rf "$pkgdir/usr/share" } @@ -41,7 +60,8 @@ package_python2-nose() { package_python-nose-doc(){ pkgdesc="Nose documentation and examples" cd "$srcdir/nose-$pkgver/doc" - make SPHINXBUILD=sphinx-build2 html + #set the PYTHONPATH to use the built lib that has been run through 2to3 + PYTHONPATH=../build/lib make SPHINXBUILD=sphinx-build html mkdir -p "$pkgdir/usr/share/doc/python-nose" cp -r .build/html "$pkgdir/usr/share/doc/python-nose" cp -r ../examples "$pkgdir/usr/share/doc/python-nose" diff --git a/trunk/docs-sys.path.diff b/trunk/docs-sys.path.diff new file mode 100644 index 0000000..91e21fd --- /dev/null +++ b/trunk/docs-sys.path.diff @@ -0,0 +1,26 @@ +From: Dmitry Shachnev +Date: Sat, 8 Feb 2020 12:26:00 +0300 +Subject: Use correct sys.path when building docs + +The parent directory contains Python 2 nose, however we need the +Python 3 version, which we will pass via PYTHONPATH. +--- + doc/conf.py | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/doc/conf.py b/doc/conf.py +index 34ea147..ac7f0cb 100644 +--- a/doc/conf.py ++++ b/doc/conf.py +@@ -20,10 +20,7 @@ import sys, os + # is relative to the documentation root, use os.path.abspath to make it + # absolute, like shown here. + +-# need to be brutal because of easy_install's pth hacks: +-sys.path.insert(0, +- os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) +-sys.path.insert(0, os.path.abspath('.')) ++sys.path[0] = os.path.abspath('.') + + from nose import __versioninfo__ as nose_version + nose_version = tuple(str(x) for x in nose_version) diff --git a/trunk/sphinx-body-max-width.diff b/trunk/sphinx-body-max-width.diff new file mode 100644 index 0000000..9bb9413 --- /dev/null +++ b/trunk/sphinx-body-max-width.diff @@ -0,0 +1,22 @@ +From: Dmitry Shachnev +Date: Sat, 8 Feb 2020 13:12:45 +0300 +Subject: Unset body max-width option + +Sphinx 1.7+ sets it to 800px by default, which does not play nice with +our right sidebar. +--- + doc/conf.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/doc/conf.py b/doc/conf.py +index 358414f..cccfd95 100644 +--- a/doc/conf.py ++++ b/doc/conf.py +@@ -199,6 +199,7 @@ html_theme_options = { + 'relbarbgcolor': '#fff', + 'relbartextcolor': '#20435c', + 'relbarlinkcolor': '#355f7c', ++ 'body_max_width': None, + } + + # the css mostly overrides this: diff --git a/trunk/sphinx-class-directives.diff b/trunk/sphinx-class-directives.diff new file mode 100644 index 0000000..233745c --- /dev/null +++ b/trunk/sphinx-class-directives.diff @@ -0,0 +1,39 @@ +From: Dmitry Shachnev +Date: Thu, 25 Jun 2020 11:58:34 +0300 +Subject: Use class-based directives to fix build with Sphinx 3.x + +--- + nose/sphinx/pluginopts.py | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/nose/sphinx/pluginopts.py b/nose/sphinx/pluginopts.py +index d2b284a..033297b 100644 +--- a/nose/sphinx/pluginopts.py ++++ b/nose/sphinx/pluginopts.py +@@ -34,7 +34,7 @@ import os + try: + from docutils import nodes, utils + from docutils.statemachine import ViewList +- from docutils.parsers.rst import directives ++ from docutils.parsers.rst import convert_directive_function, directives + except ImportError: + pass # won't run anyway + +@@ -183,7 +183,14 @@ class Opt(object): + + + def setup(app): ++ autoplugin_directive.content = True ++ autoplugin_directive.arguments = (1, 0, True) ++ autoplugin_directive.options = {'plugin': directives.unchanged} + app.add_directive('autoplugin', +- autoplugin_directive, 1, (1, 0, 1), +- plugin=directives.unchanged) +- app.add_directive('autohelp', autohelp_directive, 0, (0, 0, 1)) ++ convert_directive_function(autoplugin_directive)) ++ ++ autohelp_directive.content = False ++ autohelp_directive.arguments = (0, 0, True) ++ autohelp_directive.options = {} ++ app.add_directive('autohelp', ++ convert_directive_function(autohelp_directive)) diff --git a/trunk/sphinx-html_sidebars.diff b/trunk/sphinx-html_sidebars.diff new file mode 100644 index 0000000..a8ed30a --- /dev/null +++ b/trunk/sphinx-html_sidebars.diff @@ -0,0 +1,29 @@ +From: Dmitry Shachnev +Date: Sat, 8 Feb 2020 12:47:10 +0300 +Subject: html_sidebars values should be lists, not single strings + +The single string values were deprecated in Sphinx 1.7 and removed +in Sphinx 2.0. +--- + doc/conf.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/doc/conf.py b/doc/conf.py +index ac7f0cb..358414f 100644 +--- a/doc/conf.py ++++ b/doc/conf.py +@@ -132,7 +132,13 @@ html_static_path = ['.static'] + + # Custom sidebar templates, maps document names to template names. + html_sidebars = { +- 'index': 'indexsidebar.html' ++ 'index': [ ++ 'localtoc.html', ++ 'relations.html', ++ 'sourcelink.html', ++ 'indexsidebar.html', ++ 'searchbox.html', ++ ], + } + + # Additional templates that should be rendered to pages, maps page names to