Accepting request 1218489 from devel:languages:python

- Add intersphinx-mapping.patch to allow working with Sphinx >=
  8.* (gh#ncclient/ncclient#604).

OBS-URL: https://build.opensuse.org/request/show/1218489
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-ncclient?expand=0&rev=22
This commit is contained in:
Ana Guerrero 2024-10-27 10:25:53 +00:00 committed by Git OBS Bridge
commit fb8d5c7a87
3 changed files with 36 additions and 1 deletions

25
intersphinx-mapping.patch Normal file

@ -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'

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Oct 25 22:17:02 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Add intersphinx-mapping.patch to allow working with Sphinx >=
8.* (gh#ncclient/ncclient#604).
-------------------------------------------------------------------
Wed Feb 28 04:55:02 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>

@ -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