Bug 2180479 - python-pip fails to build with Sphinx 6.1.3
Summary: python-pip fails to build with Sphinx 6.1.3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pip
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karolina Surma
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2135122
TreeView+ depends on / blocked
 
Reported: 2023-03-21 14:36 UTC by Karolina Surma
Modified: 2023-03-28 09:39 UTC (History)
8 users (show)

Fixed In Version: python-pip-23.0.1-2.fc39
Clone Of:
Environment:
Last Closed: 2023-03-28 09:39:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pypa pip pull 11883 0 None Draft Make sphinx.ext.extlinks captions actual string templates 2023-03-21 15:43:13 UTC
Github pypa pip pull 11884 0 None Draft Reference intersphinx packaging documentation unambiguously 2023-03-21 16:16:20 UTC

Description Karolina Surma 2023-03-21 14:36:34 UTC
python-pip fails to build with Sphinx 6.1.3 in Fedora 39 (currently Rawhide).

For the logs from testing build attempts, see:
https://copr.fedorainfracloud.org/coprs/ksurma/sphinx-6.1.3/package/python-pip/

You can test you package in mock running:

$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-6.1.3/fedora-rawhide-x86_64/ --no-clean your.src.rpm
$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-6.1.3/fedora-rawhide-x86_64/ shell

The issue detected:

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

It's an error in configuration.
To resolve, edit the documentation `conf.py` and correct the `extlinks` definition to contain exactly one `%s` in the captions, eg.

Bad:
'github': ('https://github.com/%s', '')

Good:
'github': ('https://github.com/%s', '%s')

Sphinx 6.1.3 will be included in Fedora 39.
Let us know here if you have any questions. Thank you!

Comment 1 Miro Hrončok 2023-03-21 15:35:10 UTC
See https://github.com/pypa/pip/blob/23.0.1/docs/html/conf.py#L76-L80

extlinks = {
    "issue": ("https://github.com/pypa/pip/issues/%s", "#"),
    "pull": ("https://github.com/pypa/pip/pull/%s", "PR #"),
    "pypi": ("https://pypi.org/project/%s/", ""),
}


Where do I put the %s? At the ends?

extlinks = {
    "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"),
}

Comment 2 Miro Hrončok 2023-03-21 15:38:07 UTC
Yeah, https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html makes me believe so.

It used to be a "prefix" in sphinx 3, now it is a "templated string".

https://github.com/sphinx-doc/sphinx/commit/fb39974486ab09320f0cf45f3c0ba0175f04d7d6

Comment 3 Miro Hrončok 2023-03-21 15:43:13 UTC
Upstream PR: https://github.com/pypa/pip/pull/11883

Comment 4 Miro Hrončok 2023-03-21 16:16:20 UTC
And https://github.com/pypa/pip/pull/11884

Comment 6 Fedora Update System 2023-03-28 08:42:03 UTC
FEDORA-2023-ef96424070 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-ef96424070

Comment 7 Fedora Update System 2023-03-28 09:39:12 UTC
FEDORA-2023-ef96424070 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.