Use sphinx-inline-tabs to organise installation per OS

This commit is contained in:
Hugo van Kemenade 2022-11-28 11:08:39 +02:00
parent a2570164cc
commit e3a46fcfd0
5 changed files with 157 additions and 150 deletions

View File

@ -13,6 +13,10 @@ indent_style = space
trim_trailing_whitespace = true
[*.rst]
# Three-space indentation
indent_size = 3
[*.yml]
# Two-space indentation
indent_size = 2

View File

@ -43,7 +43,7 @@ clean:
-rm -rf $(BUILDDIR)/*
install-sphinx:
$(PYTHON) -m pip install --quiet sphinx sphinx-copybutton sphinx-issues sphinx-removed-in sphinxext-opengraph furo olefile
$(PYTHON) -m pip install --quiet furo olefile sphinx sphinx-copybutton sphinx-inline-tabs sphinx-issues sphinx-removed-in sphinxext-opengraph
html:
$(MAKE) install-sphinx

View File

@ -27,12 +27,13 @@ needs_sphinx = "2.4"
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx_copybutton",
"sphinx_issues",
"sphinx_removed_in",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinx_inline_tabs",
"sphinx_issues",
"sphinx_removed_in",
"sphinxext.opengraph",
]

View File

@ -23,6 +23,11 @@ Pillow supports these Python versions.
:file: older-versions.csv
:header-rows: 1
.. _Windows Installation:
.. _macOS Installation:
.. _Linux Installation:
.. _FreeBSD Installation:
Basic Installation
------------------
@ -38,8 +43,7 @@ Install Pillow with :command:`pip`::
python3 -m pip install --upgrade Pillow
Windows Installation
^^^^^^^^^^^^^^^^^^^^
.. tab:: Windows
We provide Pillow binaries for Windows compiled for the matrix of
supported Pythons in both 32 and 64-bit versions in the wheel format.
@ -52,9 +56,7 @@ FriBiDi to be installed separately::
To install Pillow in MSYS2, see `Building on Windows using MSYS2/MinGW`_.
macOS Installation
^^^^^^^^^^^^^^^^^^
.. tab:: macOS
We provide binaries for macOS for each of the supported Python
versions in the wheel format. These include support for all optional
@ -64,8 +66,7 @@ FriBiDi to be installed separately::
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow
Linux Installation
^^^^^^^^^^^^^^^^^^
.. tab:: Linux
We provide binaries for Linux for each of the supported Python
versions in the manylinux wheel format. These include support for all
@ -80,8 +81,7 @@ also include Pillow in packages that previously contained PIL e.g.
``python-imaging``. Debian splits it into two packages, ``python3-pil``
and ``python3-pil.imagetk``.
FreeBSD Installation
^^^^^^^^^^^^^^^^^^^^
.. tab:: FreeBSD
Pillow can be installed on FreeBSD via the official Ports or Packages systems:
@ -100,6 +100,13 @@ Pillow can be installed on FreeBSD via the official Ports or Packages systems:
are tested by the ports team with all supported FreeBSD versions.
.. _Building on macOS:
.. _Building on Windows:
.. _Building on Windows using MSYS2/MinGW:
.. _Building on FreeBSD:
.. _Building on Linux:
.. _Building on Android:
Building From Source
--------------------
@ -187,8 +194,7 @@ Many of Pillow's features require external libraries:
* **libxcb** provides X11 screengrab support.
Building on macOS
"""""""""""""""""
.. tab:: macOS
The Xcode command line tools are required to compile portions of
Pillow. The tools are installed by running ``xcode-select --install``
@ -208,8 +214,7 @@ To install libraqm on macOS use Homebrew to install its dependencies::
Then see ``depends/install_raqm_cmake.sh`` to install libraqm.
Building on Windows
"""""""""""""""""""
.. tab:: Windows
We recommend you use prebuilt wheels from PyPI.
If you wish to compile Pillow manually, you can use the build scripts
@ -219,8 +224,7 @@ These scripts require Visual Studio 2017 or newer and NASM.
The scripts also install Pillow from the local copy of the source code, so the
`Installing`_ instructions will not be necessary afterwards.
Building on Windows using MSYS2/MinGW
"""""""""""""""""""""""""""""""""""""
.. tab:: Windows using MSYS2/MinGW
To build Pillow using MSYS2, make sure you run the **MSYS2 MinGW 32-bit** or
**MSYS2 MinGW 64-bit** console, *not* **MSYS2** directly.
@ -249,8 +253,7 @@ Prerequisites are installed on **MSYS2 MinGW 64-bit** with::
mingw-w64-x86_64-libimagequant \
mingw-w64-x86_64-libraqm
Building on FreeBSD
"""""""""""""""""""
.. tab:: FreeBSD
.. Note:: Only FreeBSD 10 and 11 tested
@ -264,8 +267,7 @@ Prerequisites are installed on **FreeBSD 10 or 11** with::
Then see ``depends/install_raqm_cmake.sh`` to install libraqm.
Building on Linux
"""""""""""""""""
.. tab:: Linux
If you didn't build Python from source, make sure you have Python's
development libraries installed.
@ -312,8 +314,7 @@ See also the ``Dockerfile``\s in the Test Infrastructure repo
(https://github.com/python-pillow/docker-images) for a known working
install process for other tested distros.
Building on Android
"""""""""""""""""""
.. tab:: Android
Basic Android support has been added for compilation within the Termux
environment. The dependencies can be installed by::

View File

@ -46,6 +46,7 @@ docs =
olefile
sphinx>=2.4
sphinx-copybutton
sphinx-inline-tabs
sphinx-issues>=3.0.1
sphinx-removed-in
sphinxext-opengraph