From 1b74a7b71e6c8a034163b57ef4e13b4a58c1f844 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Sat, 22 Apr 2023 15:05:22 +1200 Subject: bitbake-user-manual: add addpylib and BB_GLOBAL_PYMODULES New directive and variable for 2.4. Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- .../bitbake-user-manual-metadata.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'doc/bitbake-user-manual/bitbake-user-manual-metadata.rst') diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst index ba8129afa..b35c332c8 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst @@ -1972,6 +1972,24 @@ looking at the source code of the ``bb`` module, which is in the commonly used functions ``bb.utils.contains()`` and ``bb.utils.mkdirhier()``, which come with docstrings. +Extending Python Library Code +----------------------------- + +If you wish to add your own Python library code (e.g. to provide +functions/classes you can use from Python functions in the metadata) +you can do so from any layer using the ``addpylib`` directive. +This directive is typically added to your layer configuration ( +``conf/layer.conf``) although it will be handled in any ``.conf`` file. + +Usage is of the form:: + + addpylib + +Where specifies the directory to add to the library path. +The specified is imported automatically, and if the imported +module specifies an attribute named ``BBIMPORTS``, that list of +sub-modules is iterated and imported too. + Testing and Debugging BitBake Python code ----------------------------------------- -- cgit 1.2.3-korg