diff options
| author | Jiaying Song <jiaying.song.cn@windriver.com> | 2026-04-02 15:54:34 +0800 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-02 16:05:46 +0000 |
| commit | 2a4bed73a9c7a8ff060fe7ff26153ea9c74cce6c (patch) | |
| tree | 6eed7b379a112010b21a0946fe826452027d154c /meta-python | |
| parent | 9546a4e07d62cd3fc0b8adce5634275d8f38acce (diff) | |
| download | meta-openembedded-2a4bed73a9c7a8ff060fe7ff26153ea9c74cce6c.tar.gz | |
python3-ninja: fix ninja_syntax import and version for setuptools build
Fixes issues introduced in commit 16a72067f5 ("python3-ninja: upgrade
1.11.1.1 -> 1.13.0").
Upstream's __init__.py uses a relative import:
from .ninja_syntax import Writer, escape, expand
This requires ninja_syntax.py to be present inside the ninja package
directory. Upstream relies on CMake (via scikit-build-core) to copy
ninja_syntax.py from ninja-upstream/misc/ into the package during
build [1]. Since the OE recipe replaces scikit-build-core with
setuptools (no-scikit-build.patch), CMake is not invoked and this
copy does not happen, causing ImportError at runtime.
Similarly, upstream uses scikit-build-core's generate feature to
create _version.py from the SCM version. With setuptools, this
does not happen automatically, so generate it in do_configure.
[1] https://github.com/scikit-build/ninja-python-distributions/commit/f3b4a786be
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Diffstat (limited to 'meta-python')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-ninja_1.13.0.bb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-ninja_1.13.0.bb b/meta-python/recipes-devtools/python/python3-ninja_1.13.0.bb index 1591be0912..35a192a268 100644 --- a/meta-python/recipes-devtools/python/python3-ninja_1.13.0.bb +++ b/meta-python/recipes-devtools/python/python3-ninja_1.13.0.bb | |||
| @@ -14,6 +14,11 @@ DEPENDS += "python3-setuptools-scm-native" | |||
| 14 | 14 | ||
| 15 | do_install:append () { | 15 | do_install:append () { |
| 16 | rm -rf ${D}${bindir} | 16 | rm -rf ${D}${bindir} |
| 17 | install -m 0644 ${S}/ninja-upstream/misc/ninja_syntax.py ${D}${PYTHON_SITEPACKAGES_DIR}/ninja/ninja_syntax.py | ||
| 18 | } | ||
| 19 | |||
| 20 | do_configure:prepend() { | ||
| 21 | echo 'version = "${PV}"' > ${S}/src/ninja/_version.py | ||
| 17 | } | 22 | } |
| 18 | 23 | ||
| 19 | RDEPENDS:${PN} = " \ | 24 | RDEPENDS:${PN} = " \ |
