diff --git a/intersphinx-mapping.patch b/intersphinx-mapping.patch new file mode 100644 index 0000000..3cf82c5 --- /dev/null +++ b/intersphinx-mapping.patch @@ -0,0 +1,25 @@ +--- + docs/source/conf.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/docs/source/conf.py ++++ b/docs/source/conf.py +@@ -12,6 +12,7 @@ + # serve to show the default. + + import sys, os ++import sphinx + + # If extensions (or modules to document with autodoc) are in another directory, + # add these directories to sys.path here. If the directory is relative to the +@@ -196,6 +197,9 @@ latex_logo = "_static/logo.png" + + + # Example configuration for intersphinx: refer to the Python standard library. +-intersphinx_mapping = {'http://docs.python.org/': None} ++if sphinx.version_info[0] < 8: ++ intersphinx_mapping = {"http://docs.python.org/": None} ++else: ++ intersphinx_mapping = {'python': ('https://docs.python.org/', None)} + + autoclass_content = 'both' diff --git a/python-ncclient.changes b/python-ncclient.changes index f2ecfbc..3c80d3d 100644 --- a/python-ncclient.changes +++ b/python-ncclient.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 25 22:17:02 UTC 2024 - Matej Cepl + +- Add intersphinx-mapping.patch to allow working with Sphinx >= + 8.* (gh#ncclient/ncclient#604). + ------------------------------------------------------------------- Wed Feb 28 04:55:02 UTC 2024 - Steve Kowalik diff --git a/python-ncclient.spec b/python-ncclient.spec index 358ffaf..a6cb551 100644 --- a/python-ncclient.spec +++ b/python-ncclient.spec @@ -26,6 +26,9 @@ Source: https://github.com/ncclient/ncclient/archive/v%{version}.tar.gz# # PATCH-FIX-OPENSUSE allow_old_sphinx.patch mcepl@suse.com # Allow build with old Sphinx (< 2.0) on Leap Patch0: allow_old_sphinx.patch +# PATCH-FIX-UPSTREAM intersphinx-mapping.patch gh#ncclient/ncclient#604 mcepl@suse.com +# use conditionally new form of intersphinx_mapping +Patch1: intersphinx-mapping.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -58,8 +61,9 @@ This package contains documentation files for %{name}. %prep %setup -q -n ncclient-%{version} %if 0%{?suse_version} < 1550 -%patch -P 0 -p 1 +%patch -p 1 -P 0 %endif +%patch -p 1 -P 1 find examples/ -name "*.py" -exec sed -i 's|#!/usr/bin/env python$|#!/usr/bin/python|g' {} \; # drop shebang