Skip to content

Commit d89a92d

Browse files
committed
Use a table for optional module dependencies
1 parent 27acaf1 commit d89a92d

File tree

1 file changed

+109
-57
lines changed

1 file changed

+109
-57
lines changed

Doc/using/configure.rst

Lines changed: 109 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Configure Python
77
Build Requirements
88
==================
99

10-
Features and minimum versions required to build CPython:
10+
To build CPython, you will need:
1111

1212
* A `C11 <https://en.cppreference.com/w/c/11>`_ compiler. `Optional C11
1313
features
@@ -22,83 +22,135 @@ Features and minimum versions required to build CPython:
2222

2323
* Support for threads.
2424

25-
To build optional modules:
25+
* On non-Windows platforms, Autoconf 2.72 and aclocal 1.16.5 are required to
26+
regenerate the :file:`configure` script.
2627

27-
* `libbz2 <https://sourceware.org/bzip2/>`_ for the :mod:`bz2` module.
28-
29-
* `libb2 <https://github.com/BLAKE2/libb2>`_ (:ref:`BLAKE2 <hashlib-blake2>`)
30-
for the :mod:`hashlib` module.
31-
32-
* `libffi <https://sourceware.org/libffi/>`_ 3.3.0 is the recommended
33-
minimum version for the :mod:`ctypes` module.
34-
35-
* ``liblzma`` for the :mod:`lzma` module.
36-
37-
* `libmpdec <https://www.bytereef.org/mpdecimal/doc/libmpdec/>`_ 2.5.0
38-
for the :mod:`decimal` module.
39-
40-
* ``libncurses`` or ``libncursesw`` for the :mod:`curses` module.
41-
42-
* ``libpanel`` or ``libpanelw`` for the :mod:`curses.panel` module.
43-
44-
* `libreadline <https://tiswww.case.edu/php/chet/readline/rltop.html>`_ or
45-
`libedit <https://www.thrysoee.dk/editline/>`_
46-
for the :mod:`readline` module.
28+
.. versionchanged:: 3.5
29+
On Windows, Visual Studio 2015 or later is now required.
4730

48-
* `libuuid <https://linux.die.net/man/3/libuuid>`_ for the :mod:`uuid` module.
31+
.. versionchanged:: 3.6
32+
Selected C99 features, like ``<stdint.h>`` and ``static inline`` functions,
33+
are now required.
4934

50-
* `OpenSSL <https://www.openssl.org/>`_ 1.1.1 is the minimum version and
51-
OpenSSL 3.0.18 is the recommended minimum version for the
52-
:mod:`ssl` and :mod:`hashlib` extension modules.
35+
.. versionchanged:: 3.7
36+
Thread support is now required.
5337

54-
* `SQLite <https://sqlite.org/>`_ 3.15.2 for the :mod:`sqlite3` extension module.
38+
.. versionchanged:: 3.11
39+
C11 compiler, IEEE 754 and NaN support are now required.
40+
On Windows, Visual Studio 2017 or later is required.
5541

56-
* `Tcl/Tk <https://www.tcl-lang.org/>`_ 8.5.12 for the :mod:`tkinter` module.
42+
.. versionchanged:: 3.13
43+
Autoconf 2.71 and aclocal 1.16.5 and are now required to regenerate
44+
:file:`configure`.
5745

58-
* `zlib <https://www.zlib.net>`_ 1.2.2.1 is the minimum version for the
59-
:mod:`zlib` module.
46+
.. versionchanged:: 3.14
47+
Autoconf 2.72 is now required to regenerate :file:`configure`.
6048

61-
* `zstd <https://facebook.github.io/zstd/>`_ 1.4.5 is the minimum version for
62-
the :mod:`compression.zstd` module.
49+
See also :pep:`7` "Style Guide for C Code" and :pep:`11` "CPython platform
50+
support".
6351

64-
For a full list of dependencies required to build all modules and how to install
65-
them, see the
66-
`devguide <https://devguide.python.org/getting-started/setup-building/#install-dependencies>`_.
6752

68-
* Autoconf 2.72 and aclocal 1.16.5 are required to regenerate the
69-
:file:`configure` script.
53+
Requirements for Optional Modules
54+
---------------------------------
55+
56+
To build *optional modules* of the standard library, you will need several
57+
third-party libraries, along with development dependencies like header files.
58+
(In common Linux distributions, development dependencies are found in
59+
``-dev`` or ``-devel`` packages.)
60+
61+
Missing optional modules are listed near the end of ``make`` output.
62+
If you distribute a CPython interpreter without them, it's best practice to
63+
advise users, who generally expect that standard library modules are available.
64+
65+
Dependencies to build optional modules are:
66+
67+
.. list-table::
68+
:header-rows: 1
69+
:align: left
70+
71+
* - Dependency
72+
- Minimum version
73+
- Python module
74+
* - `libbz2 <https://sourceware.org/bzip2/>`_
75+
-
76+
- :mod:`bz2`
77+
* - `libb2 <https://github.com/BLAKE2/libb2>`_
78+
-
79+
- :mod:`hashlib` (:ref:`BLAKE2 <hashlib-blake2>`)
80+
* - `libffi <https://sourceware.org/libffi/>`_
81+
- 3.3.0 recommended
82+
- :mod:`ctypes`
83+
* - `liblzma <https://tukaani.org/xz/>`_
84+
-
85+
- :mod:`lzma`
86+
* - `libmpdec <https://www.bytereef.org/mpdecimal/doc/libmpdec/>`_ [4]_
87+
- 2.5.0
88+
- :mod:`decimal`
89+
* - `libreadline <https://tiswww.case.edu/php/chet/readline/rltop.html>`_ or
90+
`libedit <https://www.thrysoee.dk/editline/>`_ [1]_
91+
-
92+
- :mod:`readline`
93+
* - `libuuid <https://linux.die.net/man/3/libuuid>`_
94+
-
95+
- :mod:`uuid`
96+
* - `ncurses <https://gnu.org/software/ncurses/ncurses.html>`_ [2]_
97+
-
98+
- :mod:`curses`
99+
* - `OpenSSL <https://openssl-library.org/>`_
100+
- | 3.0.18 recommended
101+
| (1.1.1 minimum)
102+
- :mod:`ssl`, :mod:`hashlib` [3]_
103+
* - `SQLite <https://sqlite.org/>`_
104+
- 3.15.2
105+
- :mod:`sqlite3`
106+
* - `Tcl/Tk <https://www.tcl-lang.org/>`_
107+
- 8.5.12
108+
- :mod:`tkinter`
109+
* - `zlib <https://www.zlib.net>`_
110+
- 1.2.2.1
111+
- :mod:`zlib`, :mod:`ensurepip`
112+
* - `zstd <https://facebook.github.io/zstd/>`_
113+
- 1.4.5
114+
- :mod:`compression.zstd`
115+
116+
.. [1] See :option:`--with-readline` for choosing the backend for the
117+
:mod:`readline` module.
118+
.. [2] The :mod:`curses` module requires the ``libncurses`` or ``libncursesw``
119+
library.
120+
The :mod:`curses.panel` module additionally requires the ``libpanel`` or
121+
``libpanelw`` library.
122+
.. [3] If OpenSSL is not available, the :mod:`hashlib` module will use
123+
bundled implementations of several hash functions.
124+
See :option:`--with-builtin-hashlib-hashes` for *forcing* usage of OpenSSL.
125+
.. [4] If *libmpdec* is not available, CPython will use a bundled copy.
126+
This is deprecated; see :option:`--with-system-libmpdec` for details.
127+
128+
.. seealso::
129+
130+
* The `devguide <https://devguide.python.org/getting-started/setup-building/#install-dependencies>`_
131+
includes a full list of dependencies required to build all modules and
132+
instructions on how to install them on common platforms.
133+
* :option:`--with-system-expat` allows building with an external
134+
`libexpat <https://libexpat.github.io/>`_ library.
70135

71136
.. versionchanged:: 3.1
72-
Tcl/Tk version 8.3.1 is now required.
137+
Tcl/Tk version 8.3.1 is now required for :mod:`tkinter`.
73138

74139
.. versionchanged:: 3.5
75-
On Windows, Visual Studio 2015 or later is now required.
76-
Tcl/Tk version 8.4 is now required.
77-
78-
.. versionchanged:: 3.6
79-
Selected C99 features are now required, like ``<stdint.h>`` and ``static
80-
inline`` functions.
140+
Tcl/Tk version 8.4 is now required for :mod:`tkinter`.
81141

82142
.. versionchanged:: 3.7
83-
Thread support and OpenSSL 1.0.2 are now required.
143+
OpenSSL 1.0.2 are now required for :mod:`hashlib`.
84144

85145
.. versionchanged:: 3.10
86-
OpenSSL 1.1.1 is now required.
87-
Require SQLite 3.7.15.
146+
OpenSSL 1.1.1 is now required for :mod:`hashlib`.
147+
SQLite 3.7.15 is now required for :mod:`sqlite3`.
88148

89149
.. versionchanged:: 3.11
90-
C11 compiler, IEEE 754 and NaN support are now required.
91-
On Windows, Visual Studio 2017 or later is required.
92-
Tcl/Tk version 8.5.12 is now required for the :mod:`tkinter` module.
150+
Tcl/Tk version 8.5.12 is now required for :mod:`tkinter`.
93151

94152
.. versionchanged:: 3.13
95-
Autoconf 2.71, aclocal 1.16.5 and SQLite 3.15.2 are now required.
96-
97-
.. versionchanged:: 3.14
98-
Autoconf 2.72 is now required.
99-
100-
See also :pep:`7` "Style Guide for C Code" and :pep:`11` "CPython platform
101-
support".
153+
SQLite 3.15.2 is now required for :mod:`sqlite3`.
102154

103155

104156
Generated files

0 commit comments

Comments
 (0)