Guest User

Untitled

a guest
Feb 23rd, 2022
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.26 KB | None | 0 0
  1. python check_for_pyprojecttoml_build_backend() {
  2.     import os
  3.     import tomli
  4.     from pathlib import Path
  5.    
  6.     pyprojecttoml_file = Path(d.getVar('S')) / 'pyproject.toml'
  7.     if pyprojecttoml_file.exists():
  8.         bb.plain("pyproject.toml found")
  9.         pyprojecttoml_dict = tomli.loads(pyprojecttoml_file)
  10.         build_system = pyprojecttoml_dict["build-system"]
  11.         if build_system:
  12.             bb.plain("[build-system] found in pyproject.toml")
  13.             backend = build_system.key('build_backend')
  14.             if backend == "flit_core.buildapi":
  15.                 bb.warn("The source has a pyproject.toml which declares 'flit_core.buildapi' as a build backend, please consider 'inherit flit_core' instead of inheriting setuptools3.")
  16.             elif backend == "setuptools.build_meta":
  17.                 bb.warn("The source has a pyproject.toml which declares 'setuptools.build_meta' as a build backend, please consider 'inherit setuptools_build_meta' instead of inheriting setuptools3.")
  18.             else:
  19.                 bb.warn("The source has a pyproject.toml which declares '{backend}' as a build backend, but this is not currently supported in oe-core.".format(backend))
  20. }
  21.  
  22. do_configure[prefuncs] += "check_for_pyprojecttoml_build_backend"
  23.  
Advertisement
Add Comment
Please, Sign In to add comment