Skip to contentSkip to conversation

classes: update Python class documentation

PATCH In review Ross Burton 2 participants 2 messages Mar 16, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 classes: update Python class documentation

---
 documentation/ref-manual/classes.rst | 61 ++++++++++++++++------------
 1 file changed, 36 insertions(+), 25 deletions(-)
documentation/ref-manual/classes.rst +36 -25
index 4dd0901623..60fcd98928 100644
@@ -602,22 +602,6 @@ variables are not met, the recipe will be skipped, and if the
 build system attempts to build the recipe then an error will be
 triggered.
 
-.. _ref-classes-flit_core:
-
-``flit_core.bbclass``
-=====================
-
-The ``flit_core`` class enables building Python modules which declare
-the  `PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant
-``flit_core.buildapi`` ``build-backend`` in the ``[build-system]``
-section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__).
-
-Python modules built with ``flit_core.buildapi`` are pure Python (no
-``C`` or ``Rust`` extensions).
-
-The resulting ``wheel`` (See `PEP-427 <https://www.python.org/dev/peps/pep-0427/>`__)
-is installed with the :ref:`python_pep517 <ref-classes-python_pep517>` class.
-
 .. _ref-classes-fontcache:
 
 ``fontcache.bbclass``
@@ -1978,20 +1962,48 @@ When inherited by a recipe, the ``perlnative`` class supports using the
 native version of Perl built by the build system rather than using the
 version provided by the build host.
 
+.. _ref-classes-python_flit_core:
+
+``python_flit_core.bbclass``
+=====================
+
+The ``python_flit_core`` class enables building Python modules which declare
+the  `PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant
+``flit_core.buildapi`` ``build-backend`` in the ``[build-system]``
+section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__).
+
+Python modules built with ``flit_core.buildapi`` are pure Python (no
+``C`` or ``Rust`` extensions).
+
+Internally this uses the :ref:`python_pep517 <ref-classes-python_pep517>` class.
+
 .. _ref-classes-python_pep517:
 
 ``python_pep517.bbclass``
 =============================
 
-The ``python_pep517`` class installs a Python ``wheel`` binary archive (see
-`PEP-517 <https://peps.python.org/pep-0517/>`__).
+The ``python_pep517`` class builds and installs a Python ``wheel`` binary
+archive (see `PEP-517 <https://peps.python.org/pep-0517/>`__).
+
+Recipes wouldn't inherit this directly, instead typically another class will
+inherit this, add the relevant native dependencies, and set
+:term:`PEP517_BUILD_API` to the Python class which implements the PEP-517 build
+API.
+
+Examples of classes which do this are :ref:`python_flit_core
+<ref-classes-python_flit_core>`, :ref:`setuptools_build_meta
+<ref-classes-setuptools_build_meta>`, and :ref:`python_poetry_core
+<ref-classes-python_poetry_core>`.
+
+.. _ref-classes-python_poetry_core:
+
+``python_poetry_core.bbclass``
+=====================
 
-The Python ``wheel`` can be built with several classes, including :ref:`flit_core <ref-classes-flit_core>`,
-:ref:`setuptools_build_meta <ref-classes-setuptools_build_meta>`, and :ref:`setuptools3 <ref-classes-setuptools3>`.
+The ``python_poetry_core`` class enables building Python modules which use the
+`Poetry Core <https://python-poetry.org>`__ build system.
 
-The path to the wheel to be installed is defined by :term:`PEP517_WHEEL_PATH`.
-This defaults to ``${D}/dist`` and should be respected by the builder class
-(such as :ref:`flit_core <ref-classes-flit_core>`).
+Internally this uses the :ref:`python_pep517 <ref-classes-python_pep517>` class.
 
 .. _ref-classes-pixbufcache:
 
@@ -2362,8 +2374,7 @@ section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep
 Python modules built with ``setuptools.build_meta`` can be pure Python or
 include ``C`` or ``Rust`` extensions).
 
-The resulting ``wheel`` (See `PEP-427 <https://www.python.org/dev/peps/pep-0427/>`__)
-is installed with the :ref:`python_pep517 <ref-classes-python_pep517>` class.
+Internally this uses the :ref:`python_pep517 <ref-classes-python_pep517>` class.
 
 .. _ref-classes-setuptools3:
 
Signature · 1 line
2.25.1
#1 lore raw

Hi Ross,

Thanks for the patch!

Quoted 89 lines · Ross Burton
---
 documentation/ref-manual/classes.rst | 61 ++++++++++++++++------------
 1 file changed, 36 insertions(+), 25 deletions(-)
documentation/ref-manual/classes.rst +35 -23
index 4dd0901623..60fcd98928 100644
@@ -602,22 +602,6 @@ variables are not met, the recipe will be skipped, and if the
 build system attempts to build the recipe then an error will be
 triggered.
 
-.. _ref-classes-flit_core:
-
-``flit_core.bbclass``
-=====================
-
-The ``flit_core`` class enables building Python modules which declare
-the  `PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant
-``flit_core.buildapi`` ``build-backend`` in the ``[build-system]``
-section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__).
-
-Python modules built with ``flit_core.buildapi`` are pure Python (no
-``C`` or ``Rust`` extensions).
-
-The resulting ``wheel`` (See `PEP-427 <https://www.python.org/dev/peps/pep-0427/>`__)
-is installed with the :ref:`python_pep517 <ref-classes-python_pep517>` class.
-
 .. _ref-classes-fontcache:
 
 ``fontcache.bbclass``
@@ -1978,20 +1962,48 @@ When inherited by a recipe, the ``perlnative`` class supports using the
 native version of Perl built by the build system rather than using the
 version provided by the build host.
 
+.. _ref-classes-python_flit_core:
+
+``python_flit_core.bbclass``
+=====================
+
+The ``python_flit_core`` class enables building Python modules which declare
+the  `PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant
+``flit_core.buildapi`` ``build-backend`` in the ``[build-system]``
+section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__).
+
+Python modules built with ``flit_core.buildapi`` are pure Python (no
+``C`` or ``Rust`` extensions).
+
+Internally this uses the :ref:`python_pep517 <ref-classes-python_pep517>` class.
+
 .. _ref-classes-python_pep517:
 
 ``python_pep517.bbclass``
 =============================
 
-The ``python_pep517`` class installs a Python ``wheel`` binary archive (see
-`PEP-517 <https://peps.python.org/pep-0517/>`__).
+The ``python_pep517`` class builds and installs a Python ``wheel`` binary
+archive (see `PEP-517 <https://peps.python.org/pep-0517/>`__).
+
+Recipes wouldn't inherit this directly, instead typically another class will
+inherit this, add the relevant native dependencies, and set
+:term:`PEP517_BUILD_API` to the Python class which implements the PEP-517 build
+API.
+
+Examples of classes which do this are :ref:`python_flit_core
+<ref-classes-python_flit_core>`, :ref:`setuptools_build_meta
+<ref-classes-setuptools_build_meta>`, and :ref:`python_poetry_core
+<ref-classes-python_poetry_core>`.
+
+.. _ref-classes-python_poetry_core:
+
+``python_poetry_core.bbclass``
+=====================
 
-The Python ``wheel`` can be built with several classes, including :ref:`flit_core <ref-classes-flit_core>`,
-:ref:`setuptools_build_meta <ref-classes-setuptools_build_meta>`, and :ref:`setuptools3 <ref-classes-setuptools3>`.
+The ``python_poetry_core`` class enables building Python modules which use the
+`Poetry Core <https://python-poetry.org>`__ build system.
 
-The path to the wheel to be installed is defined by :term:`PEP517_WHEEL_PATH`.
-This defaults to ``${D}/dist`` and should be respected by the builder class
-(such as :ref:`flit_core <ref-classes-flit_core>`).
+Internally this uses the :ref:`python_pep517 <ref-classes-python_pep517>` class.
 
 .. _ref-classes-pixbufcache:
 

documentation/ref-manual/classes.rst section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep · line 2379

Quoted 8 lines
documentation/ref-manual/classes.rst +1 -2
@@ -2362,8 +2374,7 @@ section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep
 Python modules built with ``setuptools.build_meta`` can be pure Python or
 include ``C`` or ``Rust`` extensions).
 
-The resulting ``wheel`` (See `PEP-427 <https://www.python.org/dev/peps/pep-0427/>`__)
-is installed with the :ref:`python_pep517 <ref-classes-python_pep517>` class.
+Internally this uses the :ref:`python_pep517 <ref-classes-python_pep517>` class.
 
 .. _ref-classes-setuptools3:

The contents look good, but I've got issues at compile time (using Sphinx 4.4):

/home/mike/work/git/git.yoctoproject.org/yocto-docs/documentation/ref-manual/classes.rst:1968:
WARNING: Title underline too short.

``python_flit_core.bbclass``
=====================
/home/mike/work/git/git.yoctoproject.org/yocto-docs/documentation/ref-manual/classes.rst:1968:
WARNING: Title underline too short.

``python_flit_core.bbclass``
=====================
/home/mike/work/git/git.yoctoproject.org/yocto-docs/documentation/ref-manual/classes.rst:2001:
WARNING: Title underline too short.

``python_poetry_core.bbclass``
=====================
/home/mike/work/git/git.yoctoproject.org/yocto-docs/documentation/ref-manual/classes.rst:2001:
WARNING: Title underline too short.

``python_poetry_core.bbclass``
=====================
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done /home/mike/work/git/git.yoctoproject.org/yocto-docs/documentation/ref-manual/classes.rst:1988:
WARNING: term not in glossary: PEP517_BUILD_API

Could you add a description for PEP517_BUILD_API?
Thanks again
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com