From ac6eb84704df6bd5eb68982c6855cfe026277bdb Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 30 Oct 2023 08:56:42 +0200 Subject: [PATCH] Add 'pypi' Sphinx role --- docs/conf.py | 1 + docs/deprecations.rst | 2 +- docs/handbook/image-file-formats.rst | 4 ++-- docs/reference/ImageFont.rst | 2 +- docs/releasenotes/4.0.0.rst | 4 ++-- docs/releasenotes/5.0.0.rst | 4 ++-- docs/releasenotes/6.0.0.rst | 4 ++-- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7dffcfae28d..fdcda3a7c26 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -338,6 +338,7 @@ def setup(app): "cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"), "issue": (_repo + "issues/%s", "#%s"), "pr": (_repo + "pull/%s", "#%s"), + "pypi": ("https://pypi.org/project/%s/", "%s"), } # sphinxext.opengraph diff --git a/docs/deprecations.rst b/docs/deprecations.rst index ce956cadeff..ffde4d45ca2 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -443,6 +443,6 @@ PIL.OleFileIO .. versionremoved:: 6.0.0 PIL.OleFileIO was removed as a vendored file in Pillow 4.0.0 (2017-01) in favour of -the upstream olefile Python package, and replaced with an ``ImportError`` in 5.0.0 +the upstream :pypi:`olefile` Python package, and replaced with an ``ImportError`` in 5.0.0 (2018-01). The deprecated file has now been removed from Pillow. If needed, install from PyPI (eg. ``python3 -m pip install olefile``). diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index e3e1dbe292f..3cf5ad7655f 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -1296,7 +1296,7 @@ Pillow reads Kodak FlashPix files. In the current version, only the highest resolution image is read from the file, and the viewing transform is not taken into account. -To enable FPX support, you must install olefile. +To enable FPX support, you must install :pypi:`olefile`. .. note:: @@ -1374,7 +1374,7 @@ the first sprite in the file is loaded. You can use :py:meth:`~PIL.Image.Image.s Note that there may be an embedded gamma of 2.2 in MIC files. -To enable MIC support, you must install olefile. +To enable MIC support, you must install :pypi:`olefile`. MPO ^^^ diff --git a/docs/reference/ImageFont.rst b/docs/reference/ImageFont.rst index 2abfa0cc997..e15aed9fc18 100644 --- a/docs/reference/ImageFont.rst +++ b/docs/reference/ImageFont.rst @@ -10,7 +10,7 @@ this class store bitmap fonts, and are used with the PIL uses its own font file format to store bitmap fonts, limited to 256 characters. You can use `pilfont.py `_ -from `pillow-scripts `_ to convert BDF and +from :pypi:`pillow-scripts` to convert BDF and PCF font descriptors (X window font formats) to this format. Starting with version 1.1.4, PIL can be configured to support TrueType and diff --git a/docs/releasenotes/4.0.0.rst b/docs/releasenotes/4.0.0.rst index cbf131c9311..5778de26a82 100644 --- a/docs/releasenotes/4.0.0.rst +++ b/docs/releasenotes/4.0.0.rst @@ -17,8 +17,8 @@ Pillow 4.0 supports Python 3.6. OleFileIO.py ============ -OleFileIO.py has been removed as a vendored file and is now installed -from the upstream olefile pypi package. All internal dependencies are +``OleFileIO.py`` has been removed as a vendored file and is now installed +from the upstream :pypi:`olefile` PyPI package. All internal dependencies are redirected to the olefile package. Direct accesses to ``PIL.OlefileIO`` raises a deprecation warning, then patches the upstream olefile into ``sys.modules`` in its place. diff --git a/docs/releasenotes/5.0.0.rst b/docs/releasenotes/5.0.0.rst index 509edbe6df8..be00a45cd87 100644 --- a/docs/releasenotes/5.0.0.rst +++ b/docs/releasenotes/5.0.0.rst @@ -28,7 +28,7 @@ Scripts The scripts formerly installed by Pillow have been split into a separate package, pillow-scripts, living at -https://github.com/python-pillow/pillow-scripts . +https://github.com/python-pillow/pillow-scripts. API Changes @@ -37,7 +37,7 @@ API Changes OleFileIO.py ^^^^^^^^^^^^ -The olefile module is no longer a required dependency when installing Pillow. +The :pypi:`olefile` module is no longer a required dependency when installing Pillow. Support for plugins requiring olefile will not be loaded if it is not installed. This allows library consumers to avoid installing this dependency if they choose. Some library consumers have little interest in the format diff --git a/docs/releasenotes/6.0.0.rst b/docs/releasenotes/6.0.0.rst index 3e3b945a0a9..70a52b58e4f 100644 --- a/docs/releasenotes/6.0.0.rst +++ b/docs/releasenotes/6.0.0.rst @@ -14,8 +14,8 @@ Pillow for Python 3.4 is 5.4.1. Removed deprecated PIL.OleFileIO ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -PIL.OleFileIO was removed as a vendored file and in Pillow 4.0.0 (2017-01) in favour of -the upstream olefile Python package, and replaced with an ``ImportError``. The +``PIL.OleFileIO`` was removed as a vendored file and in Pillow 4.0.0 (2017-01) in favour of +the upstream :pypi:`olefile` Python package, and replaced with an :py:exc:`ImportError`. The deprecated file has now been removed from Pillow. If needed, install from PyPI (eg. ``python3 -m pip install olefile``).