diff mbox series

python3-license-expression: fix ptest installation

Message ID 20250212203113.398422-1-ross.burton@arm.com
State Accepted, archived
Commit 164876d33af9edaac37a686726727d3bc3d10aa9
Headers show
Series python3-license-expression: fix ptest installation | expand

Commit Message

Ross Burton Feb. 12, 2025, 8:31 p.m. UTC
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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../python/python3-license-expression_30.4.1.bb            | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Khem Raj Feb. 12, 2025, 10:56 p.m. UTC | #1
On Wed, Feb 12, 2025 at 12:31 PM Ross Burton via
lists.openembedded.org <ross.burton=arm.com@lists.openembedded.org>
wrote:
>
> 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.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  .../python/python3-license-expression_30.4.1.bb            | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb b/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb
> index 649b53ea492..ec613f6eaac 100644
> --- a/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb
> +++ b/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb
> @@ -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 ?

> +    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: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Ross Burton Feb. 13, 2025, 12:04 p.m. UTC | #2
On 12 Feb 2025, at 22:56, Khem Raj <raj.khem@gmail.com> wrote:
>> +    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
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb b/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb
index 649b53ea492..ec613f6eaac 100644
--- a/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb
+++ b/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb
@@ -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}/
 }