Fix compatibility with Sphinx 6+ (fixes FTBFS)

This commit is contained in:
Karolina Surma 2023-03-27 10:54:18 +02:00
parent 83fe8f1d73
commit f657771b14
3 changed files with 117 additions and 1 deletions

41
11883.patch Normal file
View File

@ -0,0 +1,41 @@
From 4944f6ff75e0a5e28d9719ae30dba03f196f2acf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Tue, 21 Mar 2023 16:42:09 +0100
Subject: [PATCH] Make sphinx.ext.extlinks captions actual string templates
In Sphinx 3, this used to be a prefix, but it is the full caption since Sphinx 4:
https://github.com/sphinx-doc/sphinx/commit/fb39974486ab09320f0cf45f3c0ba0175f04d7d6
With Sphinx 6, captions without %s fail:
https://github.com/sphinx-doc/sphinx/commit/ce31e1c0c7b32f6be93186e0fef076ef65ff0b05
Exception occurred:
File "/usr/lib/python3.11/site-packages/sphinx/ext/extlinks.py", line 103, in role
title = caption % part
~~~~~~~~^~~~~~
TypeError: not all arguments converted during string formatting
Fixes Fedora downstream report: https://bugzilla.redhat.com/2180479
---
docs/html/conf.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/html/conf.py b/docs/html/conf.py
index cc967e0ba3c..aae1364b87a 100644
--- a/docs/html/conf.py
+++ b/docs/html/conf.py
@@ -74,9 +74,9 @@
# -- Options for extlinks -------------------------------------------------------------
extlinks = {
- "issue": ("https://github.com/pypa/pip/issues/%s", "#"),
- "pull": ("https://github.com/pypa/pip/pull/%s", "PR #"),
- "pypi": ("https://pypi.org/project/%s/", ""),
+ "issue": ("https://github.com/pypa/pip/issues/%s", "#%s"),
+ "pull": ("https://github.com/pypa/pip/pull/%s", "PR #%s"),
+ "pypi": ("https://pypi.org/project/%s/", "%s"),
}
# -- Options for towncrier_draft extension --------------------------------------------

67
11904.patch Normal file
View File

@ -0,0 +1,67 @@
From 30a13bcaa7b0139c200458878a21e5467121fa34 Mon Sep 17 00:00:00 2001
From: Pradyun Gedam <pradyunsg@users.noreply.github.com>
Date: Mon, 27 Mar 2023 12:49:35 +0100
Subject: [PATCH 1/3] Add `--kep-going` to documentation build flags
This ensures that all warnings are printed for Sphinx builds.
---
noxfile.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/noxfile.py b/noxfile.py
index 5c4683b7d79..565a5039955 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -133,6 +133,7 @@ def get_sphinx_build_command(kind: str) -> List[str]:
# fmt: off
return [
"sphinx-build",
+ "--keep-going",
"-W",
"-c", "docs/html", # see note above
"-d", "docs/build/doctrees/" + kind,
From 4fccbf0c74d252fd2301df397002c783ac6ad057 Mon Sep 17 00:00:00 2001
From: Pradyun Gedam <pradyunsg@users.noreply.github.com>
Date: Mon, 27 Mar 2023 12:50:43 +0100
Subject: [PATCH 2/3] Use a standard Sphinx document reference rather than
Markdown syntax
This avoids providing too much information or using weird mechanics to
build across various MyST-Parser versions.
---
docs/html/getting-started.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/html/getting-started.md b/docs/html/getting-started.md
index 0967b0eb99f..2b3f0bc9310 100644
--- a/docs/html/getting-started.md
+++ b/docs/html/getting-started.md
@@ -98,5 +98,5 @@ Successfully uninstalled sampleproject
## Next Steps
It is recommended to learn about what virtual environments are and how to use
-them. This is covered in the ["Installing Packages"](pypug:tutorials/installing-packages)
+them. This is covered in the {doc}`Installing Packages <pypug:tutorials/installing-packages>`
tutorial on packaging.python.org.
From 6810341fd010d721541e87ba3125b275d0108c45 Mon Sep 17 00:00:00 2001
From: Pradyun Gedam <pradyunsg@users.noreply.github.com>
Date: Mon, 27 Mar 2023 12:51:17 +0100
Subject: [PATCH 3/3] Bump to Sphinx 6
This is the current latest version of Sphinx.
---
docs/requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/requirements.txt b/docs/requirements.txt
index fa3a7390c15..ef72c8fb722 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,4 +1,4 @@
-sphinx ~= 4.2, != 4.4.0
+sphinx ~= 6.0
towncrier
furo
myst_parser

View File

@ -14,7 +14,7 @@
Name: python-%{srcname}
Version: %{base_version}%{?prerel:~%{prerel}}
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A tool for installing and managing Python packages
# We bundle a lot of libraries with pip, which itself is under MIT license.
@ -83,6 +83,10 @@ Patch: nowarn-pip._internal.main.patch
# Upstream issue: https://github.com/pypa/packaging/issues/368
Patch: no-version-warning.patch
# Fix compatibility with Sphinx 6+, merged upstream
Patch: https://github.com/pypa/pip/pull/11883.patch
Patch: https://github.com/pypa/pip/pull/11904.patch
# Downstream only patch
# Users might have local installations of pip from using
# `pip install --user --upgrade pip` on older/newer versions.
@ -383,6 +387,10 @@ pytest_k='not completion'
%{python_wheel_dir}/%{python_wheel_name}
%changelog
* Mon Mar 27 2023 Karolina Surma <ksurma@redhat.com> - 23.0.1-2
- Fix compatibility with Sphinx 6+
Resolves: rhbz#2180479
* Mon Feb 20 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 23.0.1-1
- Update to 23.0.1
Resolves: rhbz#2165760