mirror of
https://git.yoctoproject.org/poky-contrib
synced 2025-05-08 23:52:25 +08:00
add pydeps wip using modulefinder
doesn't appear to entirely work right, claims that it couldn't find os.path for example. Need to somehow reduce the names to the top levels if that makes sense.
This commit is contained in:
parent
cc5e3503e4
commit
c380234ecd
22
meta/classes-recipe/pydeps.bbclass
Normal file
22
meta/classes-recipe/pydeps.bbclass
Normal file
@ -0,0 +1,22 @@
|
||||
inherit python3-dir
|
||||
|
||||
PACKAGEFUNCS += "package_generate_pydeps"
|
||||
|
||||
python package_generate_pydeps() {
|
||||
import modulefinder
|
||||
paths = (
|
||||
d.expand("${RECIPE_SYSROOT}${PYTHON_SITEPACKAGES_DIR}"),
|
||||
d.expand("${RECIPE_SYSROOT}${libdir}/${PYTHON_DIR}/")
|
||||
)
|
||||
finder = modulefinder.ModuleFinder(paths)
|
||||
|
||||
for pkg in d.getVar("PACKAGES").split():
|
||||
for path in pkgfiles[pkg]:
|
||||
if not path.endswith(".py"):
|
||||
continue
|
||||
|
||||
bb.plain("Scanning %s" % path)
|
||||
finder.load_file(path)
|
||||
bb.plain("Modules found: " + " ".join(finder.modules.keys()))
|
||||
bb.plain("Modules not found: " + " ".join(finder.badmodules.keys()))
|
||||
}
|
@ -49,3 +49,5 @@ RDEPENDS:${PN} += " \
|
||||
RDEPENDS:${PN}-tests = "${PN}"
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
inherit pydeps
|
||||
|
Loading…
x
Reference in New Issue
Block a user