From 056a6f87ac0c2decf691d0831dbfab61ba696cd9 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Tue, 9 Apr 2024 00:22:49 +0800 Subject: [PATCH 1/8] feat: intergrate sphinx-issues to replace extlinks --- docs/html/conf.py | 10 ++-------- docs/requirements.txt | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/docs/html/conf.py b/docs/html/conf.py index 683ea7b87d8..114b94809be 100644 --- a/docs/html/conf.py +++ b/docs/html/conf.py @@ -26,11 +26,13 @@ "sphinx_copybutton", "sphinx_inline_tabs", "sphinxcontrib.towncrier", + "sphinx_issues", ] # General information about the project. project = "pip" copyright = "The pip developers" +issues_default_group_project = "pypa/pip" # Find the version and release information. # We have a single source of truth for our version number: pip's __init__.py file. @@ -71,14 +73,6 @@ "pypug": ("https://packaging.python.org", None), } -# -- Options for extlinks ------------------------------------------------------------- - -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"), -} - # -- Options for towncrier_draft extension -------------------------------------------- towncrier_draft_autoversion_mode = "draft" # or: 'sphinx-release', 'sphinx-version' diff --git a/docs/requirements.txt b/docs/requirements.txt index b3ea82a9de1..98c1527e9cc 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -7,6 +7,7 @@ myst_parser sphinx-copybutton sphinx-inline-tabs sphinxcontrib-towncrier >= 0.2.0a0 +sphinx-issues # `docs.pipext` uses pip's internals to generate documentation. So, we install # the current directory to make it work. From c6642fd035ea6e76fdf16bc43ab0f62bcbeffb84 Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Tue, 9 Apr 2024 11:42:43 +0800 Subject: [PATCH 2/8] Add news file 12551.trivial.rst --- news/12551.trivial.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/12551.trivial.rst diff --git a/news/12551.trivial.rst b/news/12551.trivial.rst new file mode 100644 index 00000000000..bfd5e9f1e9e --- /dev/null +++ b/news/12551.trivial.rst @@ -0,0 +1 @@ +Integrate ``sphinx-issues`` into the Sphinx config. From ca17fac25db70697196635cecd3306362f6581c0 Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Tue, 9 Apr 2024 15:01:26 +0800 Subject: [PATCH 3/8] fix: add pypi back and replaced pull to pr --- NEWS.rst | 4 ++-- docs/html/conf.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index 5ebf7141b1d..2fd470a4065 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -3350,7 +3350,7 @@ Improved Documentation - Upgrade the bundled copy of requests to 2.6.0, fixing CVE-2015-2296. - Display format of latest package when using ``pip list --outdated``. (#2475) - Don't use pywin32 as ctypes should always be available on Windows, using - pywin32 prevented uninstallation of pywin32 on Windows. (:pull:`2467`) + pywin32 prevented uninstallation of pywin32 on Windows. (:pr:`2467`) - Normalize the ``--wheel-dir`` option, expanding out constructs such as ``~`` when used. (#2441) - Display a warning when an undefined extra has been requested. (#2142) @@ -3641,7 +3641,7 @@ Improved Documentation --no-download`` are now formally deprecated. See #906 for discussion on possible alternatives, or lack thereof, in future releases. - **DEPRECATION** ``pip zip`` and ``pip unzip`` are now formally deprecated. -- pip will now install Mac OSX platform wheels from PyPI. (:pull:`1278`) +- pip will now install Mac OSX platform wheels from PyPI. (:pr:`1278`) - pip now generates the appropriate platform-specific console scripts when installing wheels. (#1251) - pip now confirms a wheel is supported when installing directly from a path or diff --git a/docs/html/conf.py b/docs/html/conf.py index 114b94809be..346cae25512 100644 --- a/docs/html/conf.py +++ b/docs/html/conf.py @@ -73,6 +73,10 @@ "pypug": ("https://packaging.python.org", None), } +# -- Options for extlinks ------------------------------------------------------------- +extlinks = { + "pypi": ("https://pypi.org/project/%s/", "%s"), +} # -- Options for towncrier_draft extension -------------------------------------------- towncrier_draft_autoversion_mode = "draft" # or: 'sphinx-release', 'sphinx-version' From 95604abd484bfe1c19d25580b880192a406219ce Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Wed, 10 Apr 2024 10:00:02 +0800 Subject: [PATCH 4/8] fix(config.py): revert formatting --- docs/html/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/html/conf.py b/docs/html/conf.py index 346cae25512..45e2bdb4a1a 100644 --- a/docs/html/conf.py +++ b/docs/html/conf.py @@ -74,9 +74,11 @@ } # -- Options for extlinks ------------------------------------------------------------- + extlinks = { "pypi": ("https://pypi.org/project/%s/", "%s"), } + # -- Options for towncrier_draft extension -------------------------------------------- towncrier_draft_autoversion_mode = "draft" # or: 'sphinx-release', 'sphinx-version' From 848e9297325ba27539c3238f4f15f2892776316d Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Mon, 15 Apr 2024 04:14:39 +0000 Subject: [PATCH 5/8] removed extlinks for pypi --- docs/html/conf.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/html/conf.py b/docs/html/conf.py index 45e2bdb4a1a..114b94809be 100644 --- a/docs/html/conf.py +++ b/docs/html/conf.py @@ -73,12 +73,6 @@ "pypug": ("https://packaging.python.org", None), } -# -- Options for extlinks ------------------------------------------------------------- - -extlinks = { - "pypi": ("https://pypi.org/project/%s/", "%s"), -} - # -- Options for towncrier_draft extension -------------------------------------------- towncrier_draft_autoversion_mode = "draft" # or: 'sphinx-release', 'sphinx-version' From b5a7c73bd8d6bb8eaa2de83e39fc548934acb751 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sat, 27 Apr 2024 22:57:02 +0800 Subject: [PATCH 6/8] Drop sphinx.ext.extlinks from extensions --- docs/html/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/html/conf.py b/docs/html/conf.py index 114b94809be..75198d24eb9 100644 --- a/docs/html/conf.py +++ b/docs/html/conf.py @@ -17,7 +17,6 @@ # first-party extensions "sphinx.ext.autodoc", "sphinx.ext.todo", - "sphinx.ext.extlinks", "sphinx.ext.intersphinx", # our extensions "pip_sphinxext", From 649f199ad942077793426d7eb4a52e9d2cad6c5a Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 14 Jul 2024 16:42:05 +0000 Subject: [PATCH 7/8] move the new option to sphinx_issues section --- docs/html/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/html/conf.py b/docs/html/conf.py index 75198d24eb9..9494a6652dc 100644 --- a/docs/html/conf.py +++ b/docs/html/conf.py @@ -31,7 +31,6 @@ # General information about the project. project = "pip" copyright = "The pip developers" -issues_default_group_project = "pypa/pip" # Find the version and release information. # We have a single source of truth for our version number: pip's __init__.py file. @@ -130,3 +129,7 @@ def to_document_name(path: str, base_dir: str) -> str: copybutton_prompt_text = r"\$ | C\:\> " copybutton_prompt_is_regexp = True copybutton_only_copy_prompt_lines = False + +# -- Options for sphinx_issues ---------------------------------------------------- + +issues_default_group_project = "pypa/pip" From 1baa9c8c04ecaa52ab57d530f8087d609fac84b1 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 14 Jul 2024 16:50:05 +0000 Subject: [PATCH 8/8] keep the same number of line strings --- docs/html/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/html/conf.py b/docs/html/conf.py index 9494a6652dc..be95eca2941 100644 --- a/docs/html/conf.py +++ b/docs/html/conf.py @@ -130,6 +130,6 @@ def to_document_name(path: str, base_dir: str) -> str: copybutton_prompt_is_regexp = True copybutton_only_copy_prompt_lines = False -# -- Options for sphinx_issues ---------------------------------------------------- +# -- Options for sphinx_issues -------------------------------------------------------- issues_default_group_project = "pypa/pip"