poky/meta/classes-recipe/python_hatchling.bbclass
Ross Burton 3ca199c5f8 classes/python_pep517: centralise shared inherits
For the build process to actually work some inherits are always needed:

- python3native for the python that is actually running build.
- setuptools3-base (badly named) defines how to build extensions and
  where to put modules.

Instead of inheriting these in every class, inherit them once in the
python_pep517 class.

(From OE-Core rev: 449b226aca6a5db378dc5576dde47499925dfb26)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-04 18:04:03 +01:00

28 lines
838 B
Plaintext

#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: MIT
#
inherit python_pep517
DEPENDS += "python3-hatchling-native"
# delete nested, empty directories from the python site-packages path. Make
# sure that we remove the native ones for target builds as well
hatchling_rm_emptydirs:class-target () {
find ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete
find ${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete
}
hatchling_rm_emptydirs:class-native () {
find ${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete
}
# Define a default empty version of hatchling_rm_emptydirs to appease bitbake
hatchling_rm_emptydirs () {
:
}
do_prepare_recipe_sysroot[postfuncs] += " hatchling_rm_emptydirs"