diff --git a/srcpkgs/python3-repoze.sphinx.autointerface/patches/sphinx3.patch b/srcpkgs/python3-repoze.sphinx.autointerface/patches/sphinx3.patch new file mode 100644 index 00000000000..7611b89a2b3 --- /dev/null +++ b/srcpkgs/python3-repoze.sphinx.autointerface/patches/sphinx3.patch @@ -0,0 +1,60 @@ +From f1ce0d2f790ebd8e1158ac8e4a1d04715053fc38 Mon Sep 17 00:00:00 2001 +From: Fred Drake +Date: Tue, 24 Mar 2020 15:01:46 -0400 +Subject: [PATCH] update to work with newer sphinx + +- avoid sphinx.util.force_decode on python 3.x +- support sphinx 3.x: + * Sphinx.domains -> Sphinx.registry.domains + * Sphinx.override_domain(D) -> Sphinx.add_domain(D, override=True) +--- + repoze/sphinx/autointerface.py | 26 ++++++++++++++++++++++---- + +Modified by fosslinux. + +diff --git repoze/sphinx/autointerface.py repoze/sphinx/autointerface.py +index 597567e..147c790 100644 +--- repoze/sphinx/autointerface.py ++++ repoze/sphinx/autointerface.py +@@ -1,2 +1,10 @@ + from zope.interface.interface import InterfaceClass + ++ ++if sys.version_info < (3,): ++ from sphinx.util import force_decode ++else: ++ def force_decode(s, encoding): ++ return s ++ ++ +@@ -117,17 +117,27 @@ + + from sphinx.domains import ObjType + ++ try: ++ domains = app.domains ++ except AttributeError: ++ domains = app.registry.domains ++ + # Allow the :class: directive to xref interface objects through the search + # mechanism, i.e., prefixed with a '.', like :class:`.ITheInterface` + # (without this, an exact match is required) +- class InterfacePythonDomain(app.domains['py']): ++ class InterfacePythonDomain(domains['py']): + pass +- InterfacePythonDomain.object_types = app.domains['py'].object_types.copy() ++ InterfacePythonDomain.object_types = domains['py'].object_types.copy() + InterfacePythonDomain.object_types['interface'] = ObjType( 'interface', 'interface', 'obj', 'class') + old_class = InterfacePythonDomain.object_types['class'] + new_class = ObjType( old_class.lname, *(old_class.roles + ('interface',)), **old_class.attrs ) + InterfacePythonDomain.object_types['class'] = new_class +- app.override_domain( InterfacePythonDomain ) ++ ++ if hasattr(app, 'override_domain'): ++ app.override_domain( InterfacePythonDomain ) ++ else: ++ app.add_domain( InterfacePythonDomain, override=True ) ++ + except AttributeError: + # Sphinx < 1.0 + app.add_directive('interface', InterfaceDesc) diff --git a/srcpkgs/python3-repoze.sphinx.autointerface/template b/srcpkgs/python3-repoze.sphinx.autointerface/template index f0352fc9b7e..684c7f90d05 100644 --- a/srcpkgs/python3-repoze.sphinx.autointerface/template +++ b/srcpkgs/python3-repoze.sphinx.autointerface/template @@ -1,12 +1,13 @@ # Template file for 'python3-repoze.sphinx.autointerface' pkgname=python3-repoze.sphinx.autointerface version=0.8 -revision=2 +revision=3 archs=noarch wrksrc="repoze.sphinx.autointerface-${version}" build_style=python3-module hostmakedepends="python3-setuptools" -depends="python3-zope.interface" +depends="python3-zope.interface python3-Sphinx python3-setuptools" +checkdepends="$depends" short_desc="Sphinx extension to auto-generate API docs from Zope interfaces" maintainer="Alex Childs " license="BSD-4-Clause"