python_hatchling.bbclass 881 B

123456789101112131415161718192021222324252627
  1. #
  2. # Copyright OpenEmbedded Contributors
  3. #
  4. # SPDX-License-Identifier: MIT
  5. #
  6. inherit python_pep517 python3native python3-dir setuptools3-base
  7. DEPENDS += "python3-hatchling-native"
  8. # delete nested, empty directories from the python site-packages path. Make
  9. # sure that we remove the native ones for target builds as well
  10. hatchling_rm_emptydirs:class-target () {
  11. find ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete
  12. find ${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete
  13. }
  14. hatchling_rm_emptydirs:class-native () {
  15. find ${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete
  16. }
  17. # Define a default empty version of hatchling_rm_emptydirs to appease bitbake
  18. hatchling_rm_emptydirs () {
  19. :
  20. }
  21. do_prepare_recipe_sysroot[postfuncs] += " hatchling_rm_emptydirs"