Skip to contentSkip to conversation

python3-license-expression: fix ptest installation

PATCH In review Ross Burton 2 participants 3 messages Feb 12, 2025 – Feb 13, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3-license-expression: fix ptest installation

This recipe was overriding do_install_ptest which is provided by the ptest-python-pytest class, so there was no tests or run-ptest installed.

Use an append override, and minimise the installed files: use a symlink so that scancode-licensedb-index.json is found and install setup.cfg.

---
 .../python/python3-license-expression_30.4.1.bb            | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-devtools/python/python3-license-expression_30.4.1.bb +4 -3
index 649b53ea492..ec613f6eaac 100644
@@ -22,8 +22,9 @@ RDEPENDS:${PN} += "\
 
 BBCLASSEXTEND = "native nativesdk"
 
-do_install_ptest() {
+do_install_ptest:append() {
+    # The tests need some files from the source tree
     install -d ${D}${PTEST_PATH}/src
-    cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
-    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
+    ln -s ${PYTHON_SITEPACKAGES_DIR}/license_expression/ ${D}${PTEST_PATH}/src/
+    install -m644 ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
Signature · 1 line
2.43.0
#1 lore raw
Quoted 17 lines · Ross Burton via lists.openembedded.org

This recipe was overriding do_install_ptest which is provided by the ptest-python-pytest class, so there was no tests or run-ptest installed.

Use an append override, and minimise the installed files: use a symlink so that scancode-licensedb-index.json is found and install setup.cfg.

---
 .../python/python3-license-expression_30.4.1.bb            | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-devtools/python/python3-license-expression_30.4.1.bb +0 -0
index 649b53ea492..ec613f6eaac 100644

meta/recipes-devtools/python/python3-license-expression_30.4.1.bb RDEPENDS:${PN} += "\ · line 28

Quoted 10 lines
meta/recipes-devtools/python/python3-license-expression_30.4.1.bb +3 -3
@@ -22,8 +22,9 @@ RDEPENDS:${PN} += "\
 
 BBCLASSEXTEND = "native nativesdk"
 
-do_install_ptest() {
+do_install_ptest:append() {
+    # The tests need some files from the source tree
     install -d ${D}${PTEST_PATH}/src
-    cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
-    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
+    ln -s ${PYTHON_SITEPACKAGES_DIR}/license_expression/ ${D}${PTEST_PATH}/src/

should this be ln -sf ?

Quoted 14 lines
meta/recipes-devtools/python/python3-license-expression_30.4.1.bb +1 -1
+    install -m644 ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
--

2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#211278): https://lists.openembedded.org/g/openembedded-core/message/211278
Mute This Topic: https://lists.openembedded.org/mt/111150628/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 3 lines · Khem Raj
Quoted 1 line

+ ln -s ${PYTHON_SITEPACKAGES_DIR}/license_expression/ ${D}${PTEST_PATH}/src/

should this be ln -sf ?

We’re working in a fresh directory so there is no destination file to forcible remove.

Ross