diff options
author | Ross Burton <ross@burtonini.com> | 2022-03-08 14:30:34 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-09 11:46:28 +0000 |
commit | c7054e363aa34e2c1a04c1c7de08d9a2068f5794 (patch) | |
tree | 7248ff98e7df38e04bea4809c953857ceb442425 | |
parent | 37527ea5bd0e7a7e7e7c6a69548f1f66cf964ddc (diff) | |
download | poky-c7054e363aa34e2c1a04c1c7de08d9a2068f5794.tar.gz |
setuptools_build_meta: add variable to control where pyproject.toml is located
The PEP517[1] pyproject.toml doesn't have to be located at the top-level
of the source tree (for example, in recipes with multiple components), so
add a variable PEP517_SOURCE_PATH to set where the file is.
In the future there should be a pep517.bbclass to centralise the common
logic, but for now this can be defined in each of the relevant classes.
[1] https://www.python.org/dev/peps/pep-0517/
(From OE-Core rev: 891fab83683cf032d4849f2dfbcd03a3eb22f158)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/setuptools_build_meta.bbclass | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes/setuptools_build_meta.bbclass b/meta/classes/setuptools_build_meta.bbclass index 18ae2e6004..787fbd5f36 100644 --- a/meta/classes/setuptools_build_meta.bbclass +++ b/meta/classes/setuptools_build_meta.bbclass | |||
@@ -2,12 +2,16 @@ inherit pip_install_wheel setuptools3-base | |||
2 | 2 | ||
3 | DEPENDS += "python3-setuptools-native python3-wheel-native" | 3 | DEPENDS += "python3-setuptools-native python3-wheel-native" |
4 | 4 | ||
5 | # Where to execute the build process from | ||
6 | PEP517_SOURCE_PATH ?= "${S}" | ||
7 | |||
5 | setuptools_build_meta_do_configure () { | 8 | setuptools_build_meta_do_configure () { |
6 | : | 9 | : |
7 | } | 10 | } |
8 | 11 | ||
9 | # TODO: ideally this uses pypa/build | 12 | # TODO: ideally this uses pypa/build |
10 | setuptools_build_meta_do_compile () { | 13 | setuptools_build_meta_do_compile () { |
14 | cd ${PEP517_SOURCE_PATH} | ||
11 | nativepython3 -c "from setuptools import build_meta; build_meta.build_wheel('${PIP_INSTALL_DIST_PATH}')" | 15 | nativepython3 -c "from setuptools import build_meta; build_meta.build_wheel('${PIP_INSTALL_DIST_PATH}')" |
12 | } | 16 | } |
13 | do_compile[cleandirs] += "${PIP_INSTALL_DIST_PATH}" | 17 | do_compile[cleandirs] += "${PIP_INSTALL_DIST_PATH}" |