Skip to content

Commit b919a71

Browse files
committed
📝 Replace GH/PyPI extlinks w/ sphinx_issues
This extension implements more generic roles that can also be used more flexibly. Relying on an external extension allows to stop maintaining an in-repo copy of the commonly used behavior.
1 parent 66dbab6 commit b919a71

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

doc/en/conf.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"sphinx_removed_in",
9090
"sphinxcontrib_trio",
9191
"sphinxcontrib.towncrier.ext", # provides `towncrier-draft-entries` directive
92+
"sphinx_issues", # implements `:issue:`, `:pr:` and other GH-related roles
9293
]
9394

9495
# Building PDF docs on readthedocs requires inkscape for svg to pdf
@@ -170,13 +171,8 @@
170171
linkcheck_workers = 5
171172

172173

173-
_repo = "https://github.com/pytest-dev/pytest"
174174
extlinks = {
175175
"bpo": ("https://bugs.python.org/issue%s", "bpo-%s"),
176-
"pypi": ("https://pypi.org/project/%s/", "%s"),
177-
"issue": (f"{_repo}/issues/%s", "issue #%s"),
178-
"pr": (f"{_repo}/pull/%s", "pull request #%s"),
179-
"user": ("https://github.com/%s", "@%s"),
180176
}
181177

182178

@@ -451,6 +447,13 @@
451447
towncrier_draft_config_path = "pyproject.toml" # relative to cwd
452448

453449

450+
# -- Options for sphinx_issues extension -----------------------------------
451+
452+
issues_github_path = "pytest-dev/pytest"
453+
issues_prefix = "issue #"
454+
issues_pr_prefix = "pull request #"
455+
456+
454457
intersphinx_mapping = {
455458
"pluggy": ("https://pluggy.readthedocs.io/en/stable", None),
456459
"python": ("https://docs.python.org/3", None),

doc/en/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ sphinxcontrib-svg2pdfconverter
1010
packaging
1111
furo
1212
sphinxcontrib-towncrier
13+
sphinx-issues

0 commit comments

Comments
 (0)