cpython/Doc/extending/building.rst
Miss Islington (bot) 0e0ad7b8ff
[3.14] gh-134160: Split extension module init from PyModule docs; emphasize multi-phase init (GH-135126) (#135470)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-16 18:01:09 +03:00

30 lines
860 B
ReStructuredText

.. highlight:: c
.. _building:
*****************************
Building C and C++ Extensions
*****************************
A C extension for CPython is a shared library (for example, a ``.so`` file on
Linux, ``.pyd`` on Windows), which exports an *initialization function*.
See :ref:`extension-modules` for details.
.. highlight:: c
.. _install-index:
.. _setuptools-index:
Building C and C++ Extensions with setuptools
=============================================
Building, packaging and distributing extension modules is best done with
third-party tools, and is out of scope of this document.
One suitable tool is Setuptools, whose documentation can be found at
https://setuptools.pypa.io/en/latest/setuptools.html.
The :mod:`distutils` module, which was included in the standard library
until Python 3.12, is now maintained as part of Setuptools.