Skip to content

Commit 40a8f2b

Browse files
authored
Merge pull request #10288 from hugovk/update-pep-role-url
PEP role: Include trailing slash in URL to avoid 301 redirect
2 parents 59e96bf + 6586894 commit 40a8f2b

File tree

12 files changed

+20
-20
lines changed

12 files changed

+20
-20
lines changed

doc/tutorial/automatic-doc-generation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ In the :ref:`previous section <tutorial-describing-objects>` of the tutorial
55
you manually documented a Python function in Sphinx. However, the description
66
was out of sync with the code itself, since the function signature was not
77
the same. Besides, it would be nice to reuse `Python
8-
docstrings <https://www.python.org/dev/peps/pep-0257/#what-is-a-docstring>`_
8+
docstrings <https://peps.python.org/pep-0257/#what-is-a-docstring>`_
99
in the documentation, rather than having to write the information in two
1010
places.
1111

doc/usage/extensions/autodoc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ There are also config values that you can set:
662662

663663
...
664664

665-
.. __: https://www.python.org/dev/peps/pep-0563/
665+
.. __: https://peps.python.org/pep-0563/
666666
.. __: https://mypy.readthedocs.io/en/latest/kinds_of_types.html#type-aliases
667667
.. versionadded:: 3.3
668668

doc/usage/extensions/doctest.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ a comma-separated list of group names.
9494
* ``===``: Arbitrary equality clause.
9595

9696
``pyversion`` option is followed `PEP-440: Version Specifiers
97-
<https://www.python.org/dev/peps/pep-0440/#version-specifiers>`__.
97+
<https://peps.python.org/pep-0440/#version-specifiers>`__.
9898

9999
.. versionadded:: 1.6
100100

doc/usage/extensions/example_google.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def function_with_types_in_docstring(param1, param2):
5757
bool: The return value. True for success, False otherwise.
5858
5959
.. _PEP 484:
60-
https://www.python.org/dev/peps/pep-0484/
60+
https://peps.python.org/pep-0484/
6161
6262
"""
6363

doc/usage/extensions/example_numpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def function_with_types_in_docstring(param1, param2):
7272
True if successful, False otherwise.
7373
7474
.. _PEP 484:
75-
https://www.python.org/dev/peps/pep-0484/
75+
https://peps.python.org/pep-0484/
7676
7777
"""
7878

doc/usage/extensions/napoleon.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ the documentation, so it doesn't modify any of the docstrings in your actual
5050
source code files.
5151

5252
.. _ReStructuredText: https://docutils.sourceforge.io/rst.html
53-
.. _docstrings: https://www.python.org/dev/peps/pep-0287/
53+
.. _docstrings: https://peps.python.org/pep-0287/
5454
.. _Google Python Style Guide:
5555
https://google.github.io/styleguide/pyguide.html
5656
.. _Google:
@@ -267,9 +267,9 @@ Google style with types in docstrings::
267267
`Python 2/3 compatible annotations`_ aren't currently
268268
supported by Sphinx and won't show up in the docs.
269269

270-
.. _PEP 484: https://www.python.org/dev/peps/pep-0484/
271-
.. _PEP 526: https://www.python.org/dev/peps/pep-0526/
272-
.. _Python 2/3 compatible annotations: https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code
270+
.. _PEP 484: https://peps.python.org/pep-0484/
271+
.. _PEP 526: https://peps.python.org/pep-0526/
272+
.. _Python 2/3 compatible annotations: https://peps.python.org/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code
273273

274274

275275
Configuration

sphinx/ext/autodoc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ def add_directive_header(self, sig: str) -> None:
16611661
if not self.doc_as_attr and self.options.show_inheritance:
16621662
if inspect.getorigbases(self.object):
16631663
# A subclass of generic types
1664-
# refs: PEP-560 <https://www.python.org/dev/peps/pep-0560/>
1664+
# refs: PEP-560 <https://peps.python.org/pep-0560/>
16651665
bases = list(self.object.__orig_bases__)
16661666
elif hasattr(self.object, '__bases__') and len(self.object.__bases__):
16671667
# A normal class

sphinx/ext/doctest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def is_allowed_version(spec: str, version: str) -> bool:
4141
"""Check `spec` satisfies `version` or not.
4242
4343
This obeys PEP-440 specifiers:
44-
https://www.python.org/dev/peps/pep-0440/#version-specifiers
44+
https://peps.python.org/pep-0440/#version-specifiers
4545
4646
Some examples:
4747

sphinx/roles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ def build_uri(self) -> str:
193193
base_url = self.inliner.document.settings.pep_base_url
194194
ret = self.target.split('#', 1)
195195
if len(ret) == 2:
196-
return base_url + 'pep-%04d#%s' % (int(ret[0]), ret[1])
196+
return base_url + 'pep-%04d/#%s' % (int(ret[0]), ret[1])
197197
else:
198-
return base_url + 'pep-%04d' % int(ret[0])
198+
return base_url + 'pep-%04d/' % int(ret[0])
199199

200200

201201
class RFC(ReferenceRole):

sphinx/util/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def split_full_qualified_name(name: str) -> Tuple[Optional[str], str]:
422422
"""Split full qualified name to a pair of modname and qualname.
423423
424424
A qualname is an abbreviation for "Qualified name" introduced at PEP-3155
425-
(https://www.python.org/dev/peps/pep-3155/). It is a dotted path name
425+
(https://peps.python.org/pep-3155/). It is a dotted path name
426426
from the module top-level.
427427
428428
A "full" qualified name means a string containing both module name and

0 commit comments

Comments
 (0)