Skip to content

Commit b1857a1

Browse files
authored
Merge pull request matplotlib#27058 from story645/dep-headings
DOC: concise dependency heading + small clarifications
2 parents ddf9163 + 0a139a0 commit b1857a1

File tree

3 files changed

+67
-46
lines changed

3 files changed

+67
-46
lines changed

doc/devel/dependencies.rst

Lines changed: 64 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
.. _dependencies:
22

3-
============
3+
************
44
Dependencies
5-
============
5+
************
6+
7+
.. _runtime_dependencies:
68

79
Runtime dependencies
810
====================
911

1012

11-
Mandatory dependencies
12-
----------------------
13+
Required
14+
--------
1315

1416
When installing through a package manager like ``pip`` or ``conda``, the
1517
mandatory dependencies are automatically installed. This list is mainly for
@@ -31,8 +33,8 @@ reference.
3133

3234
.. _optional_dependencies:
3335

34-
Optional dependencies
35-
---------------------
36+
Optional
37+
--------
3638

3739
The following packages and tools are not required but extend the capabilities
3840
of Matplotlib.
@@ -106,10 +108,14 @@ Additionally, Matplotlib depends on:
106108
.. _FreeType: https://www.freetype.org/
107109
.. _Qhull: http://www.qhull.org/
108110

109-
By default, Matplotlib downloads and builds its own copies of FreeType (this is
110-
necessary to run the test suite, because different versions of FreeType
111-
rasterize characters differently) and of Qhull. As an exception, Matplotlib
112-
defaults to the system version of FreeType on AIX.
111+
112+
Download during install
113+
^^^^^^^^^^^^^^^^^^^^^^^
114+
115+
By default, Matplotlib downloads and builds its own copies of Qhull and FreeType.
116+
The vendored version of FreeType is necessary to run the test suite, because
117+
different versions of FreeType rasterize characters differently.
118+
113119

114120
Use system libraries
115121
^^^^^^^^^^^^^^^^^^^^
@@ -176,9 +182,8 @@ remember to clear your artifacts before re-building::
176182

177183
git clean -xfd
178184

179-
180-
Manual Download
181-
^^^^^^^^^^^^^^^
185+
From source files
186+
^^^^^^^^^^^^^^^^^
182187

183188
If the automatic download does not work (for example, on air-gapped systems) it is
184189
preferable to instead use system libraries. However you can manually download the
@@ -202,19 +207,23 @@ In all cases the required version of pip is embedded in the CPython source.
202207

203208
.. _development-dependencies:
204209

205-
Dependencies for building Matplotlib
206-
====================================
210+
Build dependencies
211+
==================
212+
207213

208214
.. _setup-dependencies:
209215

210-
Setup dependencies
211-
------------------
216+
Python
217+
------
218+
219+
By default, ``pip`` will build packages using build isolation, meaning that these
220+
build dependencies are temporally installed by pip for the duration of the
221+
Matplotlib build process. However, build isolation is disabled when :ref:`installing Matplotlib for development <development-install>`;
222+
therefore we recommend using one of our :ref:`virtual environment configurations <dev-environment>` to
223+
create a development environment in which these packages are automatically installed.
212224

213-
By default, ``pip`` will build packages using build isolation, and the following
214-
dependencies will be automatically installed in the isolated environment to build
215-
Matplotlib. However, for development, you may wish to make an editable install, which
216-
will require disabling build isolation, so these build dependencies should be installed
217-
in your target environment manually:
225+
If you are developing Matplotlib and unable to use our environment configurations,
226+
then you must manually install the following packages into your development environment:
218227

219228
- `meson-python <https://meson-python.readthedocs.io/>`_ (>= 0.13.1).
220229
- `ninja <https://ninja-build.org/>`_ (>= 1.8.2). This may be available in your package
@@ -230,11 +239,13 @@ in your target environment manually:
230239

231240
.. _compile-dependencies:
232241

233-
C++ compiler
234-
------------
242+
Compiled extensions
243+
-------------------
235244

236245
Matplotlib requires a C++ compiler that supports C++17, and each platform has a
237246
development environment that must be installed before a compiler can be installed.
247+
You may also need to install headers for various libraries used in the compiled extension
248+
source files.
238249

239250
.. tab-set::
240251

@@ -261,6 +272,8 @@ development environment that must be installed before a compiler can be installe
261272

262273
Alternatively, you can install a Linux-like environment such as `CygWin <https://www.cygwin.com/>`_
263274
or `Windows Subsystem for Linux <https://learn.microsoft.com/en-us/windows/wsl/install>`_.
275+
If using `MinGW-64 <https://www.mingw-w64.org/>`_, we require **v6** of the
276+
```Mingw-w64-x86_64-headers``.
264277

265278

266279
We highly recommend that you install a compiler using your platform tool, i.e.,
@@ -294,16 +307,19 @@ Xcode, VS Code or Linux package manager. Choose **one** compiler from this list:
294307

295308
.. _test-dependencies:
296309

297-
Dependencies for testing Matplotlib
298-
===================================
310+
Test dependencies
311+
=================
312+
299313
This section lists the additional software required for
300314
:ref:`running the tests <testing>`.
301315

302-
Required:
316+
Required
317+
--------
303318

304319
- pytest_ (>= 7.0.0)
305320

306-
Optional:
321+
Optional
322+
--------
307323

308324
In addition to all of the optional dependencies on the main library, for
309325
testing the following will be used if they are installed.
@@ -357,11 +373,12 @@ them will be skipped by pytest.
357373

358374
.. _doc-dependencies:
359375

360-
Dependencies for building Matplotlib's documentation
361-
====================================================
376+
Documentation dependencies
377+
==========================
378+
379+
Python
380+
------
362381

363-
Python packages
364-
---------------
365382
The additional Python packages required to build the
366383
:ref:`documentation <documenting-matplotlib>` are listed in
367384
:file:`doc-requirements.txt` and can be installed using ::
@@ -373,13 +390,22 @@ The content of :file:`doc-requirements.txt` is also shown below:
373390
.. include:: ../../requirements/doc/doc-requirements.txt
374391
:literal:
375392

376-
Additional external dependencies
377-
--------------------------------
378-
Required:
379393

394+
External tools
395+
--------------
396+
397+
The documentation requires LaTeX and Graphviz. These are not
398+
Python packages and must be installed separately. The documentation can be
399+
built without Inkscape and optipng, but the build process will raise various
400+
warnings. If the build process warns that you are missing fonts, make sure
401+
your LaTeX distribution bundles cm-super or install it separately.
402+
403+
Required
404+
^^^^^^^^
405+
406+
* `Graphviz <http://www.graphviz.org/download>`_
380407
* a minimal working LaTeX distribution, e.g., `TeX Live <https://www.tug.org/texlive/>`_ or
381408
`MikTeX <https://miktex.org/>`_
382-
* `Graphviz <http://www.graphviz.org/download>`_
383409
* the following LaTeX packages (if your OS bundles TeX Live, the
384410
"complete" version of the installer, e.g. "texlive-full" or "texlive-all",
385411
will often automatically include these packages):
@@ -388,18 +414,11 @@ Required:
388414
* `dvipng <https://ctan.org/pkg/dvipng>`_
389415
* `underscore <https://ctan.org/pkg/underscore>`_
390416

391-
Optional, but recommended:
417+
Optional
418+
^^^^^^^^
392419

393420
* `Inkscape <https://inkscape.org>`_
394421
* `optipng <http://optipng.sourceforge.net>`_
395422
* the font "Humor Sans" (aka the "XKCD" font), or the free alternative
396423
`Comic Neue <http://comicneue.com/>`_
397424
* the font "Times New Roman"
398-
399-
.. note::
400-
401-
The documentation will not build without LaTeX and Graphviz. These are not
402-
Python packages and must be installed separately. The documentation can be
403-
built without Inkscape and optipng, but the build process will raise various
404-
warnings. If the build process warns that you are missing fonts, make sure
405-
your LaTeX distribution bundles cm-super or install it separately.

doc/devel/development_setup.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ Most Python dependencies will be installed when :ref:`setting up the environment
154154
but non-Python dependencies like C++ compilers, LaTeX, and other system applications
155155
must be installed separately. For a full list, see :ref:`dependencies`.
156156

157+
.. _development-install:
158+
157159
Install Matplotlib in editable mode
158160
===================================
159161

doc/users/installing/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ precompiled wheel for your OS and Python.
3131

3232
For support of other GUI frameworks, LaTeX rendering, saving
3333
animations and a larger selection of file formats, you can
34-
install :ref:`optional_dependencies`.
34+
install :ref:`optional dependencies <optional_dependencies>`.
3535

3636

3737
Third-party distributions

0 commit comments

Comments
 (0)