diff mbox series

[meta-arago,scarthgap,v2] pytesseract: Add runtime dependencies

Message ID 20250304205358.268668-1-a-christidis@ti.com
State Superseded
Delegated to: Ryan Eatmon
Headers show
Series [meta-arago,scarthgap,v2] pytesseract: Add runtime dependencies | expand

Commit Message

Antonios Christidis March 4, 2025, 8:53 p.m. UTC
From: Antonios Christidis <a-christidis@ti.com>

Pytesseract is a python wrapper for tesseract, so it should depend on it.
The pytesseract script calls the python packaging module, so add it as
well as a dependecy.

This is only for scarthgap branch, as the master recipe for this package
is in meta-openembedded.

Signed-off-by: Antonios Christidis <a-christidis@ti.com>
---

v2: 
- Updated subject to start off with recipe name that is changed 

 .../recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb  | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ryan Eatmon March 4, 2025, 10:24 p.m. UTC | #1
On 3/4/2025 2:53 PM, a-christidis@ti.com wrote:
> From: Antonios Christidis <a-christidis@ti.com>
> 
> Pytesseract is a python wrapper for tesseract, so it should depend on it.
> The pytesseract script calls the python packaging module, so add it as
> well as a dependecy.
> 
> This is only for scarthgap branch, as the master recipe for this package
> is in meta-openembedded.
> 
> Signed-off-by: Antonios Christidis <a-christidis@ti.com>
> ---
> 
> v2:
> - Updated subject to start off with recipe name that is changed
> 
>   .../recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb  | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb b/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb
> index 91350cd5..0f505f63 100644
> --- a/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb
> +++ b/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb
> @@ -7,6 +7,8 @@ HOMEPAGE = "https://github.com/madmaze/pytesseract"
>   LICENSE = "Apache-2.0"
>   LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
>   
> +RDEPENDS:${PN}:append = "python3-packaging tesseract"
> +

As Denys pointed out on v1.  The append requires a " " at the beginning 
of the string.  += adds the space, but append is just a raw append.

RDEPENDS:${PN}:append = " python3-packaging tesseract"
                          ^


>   SRC_URI[sha256sum] = "4bf5f880c99406f52a3cfc2633e42d9dc67615e69d8a509d74867d3baddb5db9"
>   
>   PYPI_PACKAGE = "pytesseract"
Denys Dmytriyenko March 6, 2025, 7:22 p.m. UTC | #2
On Tue, Mar 04, 2025 at 04:24:43PM -0600, Ryan Eatmon via lists.yoctoproject.org wrote:
> 
> 
> On 3/4/2025 2:53 PM, a-christidis@ti.com wrote:
> >From: Antonios Christidis <a-christidis@ti.com>
> >
> >Pytesseract is a python wrapper for tesseract, so it should depend on it.
> >The pytesseract script calls the python packaging module, so add it as
> >well as a dependecy.
> >
> >This is only for scarthgap branch, as the master recipe for this package
> >is in meta-openembedded.
> >
> >Signed-off-by: Antonios Christidis <a-christidis@ti.com>
> >---
> >
> >v2:
> >- Updated subject to start off with recipe name that is changed
> >
> >  .../recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb  | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> >diff --git a/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb b/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb
> >index 91350cd5..0f505f63 100644
> >--- a/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb
> >+++ b/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb
> >@@ -7,6 +7,8 @@ HOMEPAGE = "https://github.com/madmaze/pytesseract"
> >  LICENSE = "Apache-2.0"
> >  LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
> >+RDEPENDS:${PN}:append = "python3-packaging tesseract"
> >+
> 
> As Denys pointed out on v1.  The append requires a " " at the
> beginning of the string.  += adds the space, but append is just a
> raw append.
> 
> RDEPENDS:${PN}:append = " python3-packaging tesseract"
>                          ^

The rule of thumb is to avoid using generic (non SoC/machine specific) :append 
when += can be used on space-separated lists.

E.g. don't use:

VAR:append = " val"

Instead, use:

VAR += "val"

But this is fine:

VAR:append:k3 = " val"
diff mbox series

Patch

diff --git a/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb b/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb
index 91350cd5..0f505f63 100644
--- a/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb
+++ b/meta-arago-test/recipes-graphics/python3-pytesseract/pytesseract_0.3.13.bb
@@ -7,6 +7,8 @@  HOMEPAGE = "https://github.com/madmaze/pytesseract"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 
+RDEPENDS:${PN}:append = "python3-packaging tesseract"
+
 SRC_URI[sha256sum] = "4bf5f880c99406f52a3cfc2633e42d9dc67615e69d8a509d74867d3baddb5db9"
 
 PYPI_PACKAGE = "pytesseract"