From bab078237e1865a015efc13bbf4411b5642774c074530ef0e74163a50d859972 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 18 Jun 2021 21:11:16 +0000 Subject: [PATCH] - add 22198.patch to build with Sphinx 4 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python38?expand=0&rev=71 --- 22198.patch | 92 ++++++++++++++++++++++++++++++++++++++++++++++++ python38.changes | 5 +++ python38.spec | 3 ++ 3 files changed, 100 insertions(+) create mode 100644 22198.patch diff --git a/22198.patch b/22198.patch new file mode 100644 index 0000000..294f91e --- /dev/null +++ b/22198.patch @@ -0,0 +1,92 @@ +From 02f1485b1a26b575ad3a2c957ea279fcff789f63 Mon Sep 17 00:00:00 2001 +From: Dong-hee Na +Date: Fri, 11 Sep 2020 20:41:43 +0900 +Subject: [PATCH 1/3] bpo-35293: Remove RemovedInSphinx40Warning + +--- + Doc/tools/extensions/pyspecific.py | 40 ++++++++++++------- + .../2020-09-12-17-37-13.bpo-35293._cOwPD.rst | 1 + + 2 files changed, 26 insertions(+), 15 deletions(-) + create mode 100644 Misc/NEWS.d/next/Documentation/2020-09-12-17-37-13.bpo-35293._cOwPD.rst + +Index: Python-3.6.13/Doc/tools/extensions/pyspecific.py +=================================================================== +--- Python-3.6.13.orig/Doc/tools/extensions/pyspecific.py ++++ Python-3.6.13/Doc/tools/extensions/pyspecific.py +@@ -27,7 +27,12 @@ from sphinx.util.nodes import split_expl + from sphinx.writers.html import HTMLTranslator + from sphinx.writers.text import TextWriter, TextTranslator + from sphinx.writers.latex import LaTeXTranslator +-from sphinx.domains.python import PyModulelevel, PyClassmember ++ ++try: ++ from sphinx.domains.python import PyFunction, PyMethod ++except ImportError: ++ from sphinx.domains.python import PyClassmember as PyMethod ++ from sphinx.domains.python import PyModulelevel as PyFunction + + # Support for checking for suspicious markup + +@@ -142,17 +147,18 @@ class PyDecoratorMixin(object): + return False + + +-class PyDecoratorFunction(PyDecoratorMixin, PyModulelevel): ++class PyDecoratorFunction(PyDecoratorMixin, PyFunction): + def run(self): + # a decorator function is a function after all + self.name = 'py:function' +- return PyModulelevel.run(self) ++ return PyFunction.run(self) + + +-class PyDecoratorMethod(PyDecoratorMixin, PyClassmember): ++# TODO: Use sphinx.domains.python.PyDecoratorMethod when possible ++class PyDecoratorMethod(PyDecoratorMixin, PyMethod): + def run(self): + self.name = 'py:method' +- return PyClassmember.run(self) ++ return PyMethod.run(self) + + + class PyCoroutineMixin(object): +@@ -162,19 +168,19 @@ class PyCoroutineMixin(object): + return ret + + +-class PyCoroutineFunction(PyCoroutineMixin, PyModulelevel): ++class PyCoroutineFunction(PyCoroutineMixin, PyFunction): + def run(self): + self.name = 'py:function' +- return PyModulelevel.run(self) ++ return PyFunction.run(self) + + +-class PyCoroutineMethod(PyCoroutineMixin, PyClassmember): ++class PyCoroutineMethod(PyCoroutineMixin, PyMethod): + def run(self): + self.name = 'py:method' +- return PyClassmember.run(self) ++ return PyMethod.run(self) + + +-class PyAbstractMethod(PyClassmember): ++class PyAbstractMethod(PyMethod): + + def handle_signature(self, sig, signode): + ret = super(PyAbstractMethod, self).handle_signature(sig, signode) +@@ -184,7 +190,7 @@ class PyAbstractMethod(PyClassmember): + + def run(self): + self.name = 'py:method' +- return PyClassmember.run(self) ++ return PyMethod.run(self) + + + # Support for documenting version of removal in deprecations +Index: Python-3.6.13/Misc/NEWS.d/next/Documentation/2020-09-12-17-37-13.bpo-35293._cOwPD.rst +=================================================================== +--- /dev/null ++++ Python-3.6.13/Misc/NEWS.d/next/Documentation/2020-09-12-17-37-13.bpo-35293._cOwPD.rst +@@ -0,0 +1 @@ ++Fix RemovedInSphinx40Warning when building the documentation. Patch by Dong-hee Na. diff --git a/python38.changes b/python38.changes index 6ca6748..ad77d7b 100644 --- a/python38.changes +++ b/python38.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jun 18 21:10:48 UTC 2021 - Matej Cepl + +- add 22198.patch to build with Sphinx 4 + ------------------------------------------------------------------- Tue Jun 8 11:18:08 UTC 2021 - Dirk Müller diff --git a/python38.spec b/python38.spec index 4292162..f17d87b 100644 --- a/python38.spec +++ b/python38.spec @@ -151,6 +151,8 @@ Patch28: bpo36302-sort-module-sources.patch Patch29: bpo-31046_ensurepip_honours_prefix.patch # PATCH-FIX-UPSTREAM stop calling removed Sphinx function gh#python/cpython#13236 Patch32: sphinx-update-removed-function.patch +# PATCH-FIX-UPSTREAM https://github.com/python/cpython/pull/22198 - adopted for 3.6 dmueller@suse.com +Patch33: 22198.patch BuildRequires: autoconf-archive BuildRequires: automake BuildRequires: fdupes @@ -406,6 +408,7 @@ other applications. %patch28 -p1 %patch29 -p1 %patch32 -p1 +%patch33 -p1 # drop Autoconf version requirement sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac