From 89e67a96383f1a0d8f44a9385637798f8c31ef3f Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 6 Feb 2024 23:19:00 +0100 Subject: [PATCH] docs/manual: update documentation about support python _SETUP_TYPE Note that we do not document the special flit-bootstrap value, as it is considered an internal implementation detail, and shouldn't normally be used by packages. Signed-off-by: Thomas Petazzoni --- docs/manual/adding-packages-directory.adoc | 4 ++-- docs/manual/adding-packages-python.adoc | 26 ++++++++++++---------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/docs/manual/adding-packages-directory.adoc b/docs/manual/adding-packages-directory.adoc index e994b7e1f6..03249ca06f 100644 --- a/docs/manual/adding-packages-directory.adoc +++ b/docs/manual/adding-packages-directory.adoc @@ -429,8 +429,8 @@ different way, using different infrastructures: and xref:cmake-package-reference[reference]. * *Makefiles for Python modules*: We have a dedicated infrastructure - for Python modules that use the +flit+, +pep517+ or +setuptools+ - mechanisms. We cover them through a + for Python modules that use the +flit+, +pep517+, +setuptools+, + +setuptools-rust+ or +maturin+ mechanisms. We cover them through a xref:python-package-tutorial[tutorial] and a xref:python-package-reference[reference]. diff --git a/docs/manual/adding-packages-python.adoc b/docs/manual/adding-packages-python.adoc index 44fd77fd1d..9953be6639 100644 --- a/docs/manual/adding-packages-python.adoc +++ b/docs/manual/adding-packages-python.adoc @@ -4,9 +4,9 @@ === Infrastructure for Python packages This infrastructure applies to Python packages that use the standard -Python setuptools or pep517 mechanisms as their build system, generally -recognizable by the usage of a +setup.py+ script or +pyproject.toml+ -file. +Python setuptools, pep517, flit or maturin mechanisms as their build +system, generally recognizable by the usage of a +setup.py+ script or ++pyproject.toml+ file. [[python-package-tutorial]] @@ -51,8 +51,9 @@ On line 13, we declare our dependencies, so that they are built before the build process of our package starts. On line 14, we declare the specific Python build system being used. In -this case the +setuptools+ Python build system is used. The three -supported ones are +flit+, +pep517+ and +setuptools+. +this case the +setuptools+ Python build system is used. The five +supported ones are +flit+, +pep517+, +setuptools+, +setuptools-rust+ +and +maturin+. Finally, on line 16, we invoke the +python-package+ macro that generates all the Makefile rules that actually allow the package to be @@ -98,13 +99,14 @@ Note that: One variable specific to the Python infrastructure is mandatory: * +PYTHON_FOO_SETUP_TYPE+, to define which Python build system is used - by the package. The three supported values are +flit+, +pep517+ and - +setuptools+. If you don't know which one is used in your package, - look at the +setup.py+ or +pyproject.toml+ file in your package - source code, and see whether it imports things from the +flit+ - module or the +setuptools+ module. If the package is using a - +pyproject.toml+ file without any build-system requires and with a - local in-tree backend-path one should use +pep517+. + by the package. The five supported values are +flit+, +pep517+ and + +setuptools+, +setuptools-rust+ and +maturin+. If you don't know + which one is used in your package, look at the +setup.py+ or + +pyproject.toml+ file in your package source code, and see whether + it imports things from the +flit+ module or the +setuptools+ + module. If the package is using a +pyproject.toml+ file without any + build-system requires and with a local in-tree backend-path one + should use +pep517+. A few additional variables, specific to the Python infrastructure, can optionally be defined, depending on the package's needs. Many of them