From f657771b14d64d4348d3f6f349bd567c8ce1ee98 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Mon, 27 Mar 2023 10:54:18 +0200 Subject: [PATCH] Fix compatibility with Sphinx 6+ (fixes FTBFS) --- 11883.patch | 41 ++++++++++++++++++++++++++++++ 11904.patch | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ python-pip.spec | 10 +++++++- 3 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 11883.patch create mode 100644 11904.patch diff --git a/11883.patch b/11883.patch new file mode 100644 index 0000000..0bb3865 --- /dev/null +++ b/11883.patch @@ -0,0 +1,41 @@ +From 4944f6ff75e0a5e28d9719ae30dba03f196f2acf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +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 -------------------------------------------- diff --git a/11904.patch b/11904.patch new file mode 100644 index 0000000..e478f78 --- /dev/null +++ b/11904.patch @@ -0,0 +1,67 @@ +From 30a13bcaa7b0139c200458878a21e5467121fa34 Mon Sep 17 00:00:00 2001 +From: Pradyun Gedam +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 +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 ` + tutorial on packaging.python.org. + +From 6810341fd010d721541e87ba3125b275d0108c45 Mon Sep 17 00:00:00 2001 +From: Pradyun Gedam +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 diff --git a/python-pip.spec b/python-pip.spec index d6fb850..37ce4dd 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -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 - 23.0.1-2 +- Fix compatibility with Sphinx 6+ +Resolves: rhbz#2180479 + * Mon Feb 20 2023 Tomáš Hrnčiar - 23.0.1-1 - Update to 23.0.1 Resolves: rhbz#2165760