Skip to contentSkip to conversation

python3-varlink: Add recipe

PATCH Superseded Omri Sarig 2 participants 5 messages Mar 20, 2025 – Mar 21, 2025

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Omri Sarig

author
#0 lore raw

PATCH v2 1/1 python3-varlink: Add recipe

Add a python recipe to install the python implementation for the varlink interface.

The recipe is using the current master head, instead of the version from pypi. This is done as the pypi version is 4 years old, while the master is continuously maintained in GitHub.

The runtime dependencies were created by looking at all the import statement in the installed files of the repository and looking at the relevant packages from the python3 manifest file in meta-poky.

---
 .../ptest-packagelists-meta-python.inc        |  1 +
 .../python/python3-varlink_git.bb             | 28 +++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-varlink_git.bb
meta-python/conf/include/ptest-packagelists-meta-python.inc +1 -0
index 3a1fb13ba7..40df4f08f3 100644
@@ -89,6 +89,7 @@ PTESTS_FAST_META_PYTHON = "\
     python3-unidiff \
     python3-uritemplate \
     python3-validators \
+    python3-varlink \
     python3-wrapt \
     python3-wsproto \
     python3-xlrd \
meta-python/recipes-devtools/python/python3-varlink_git.bb new file +28 -0
new file mode 100644
index 0000000000..8b5e01cf44
@@ -0,0 +1,28 @@
+SUMMARY = " Python implementation of the Varlink protocol"
+HOMEPAGE = "https://varlink.org/python/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+SRC_URI = "git://github.com/varlink/python.git;protocol=https;branch=master"
+
+SRCREV = "6012b8805bf2ebcc981c84bd56a3e949a2141c16"
+
+S = "${WORKDIR}/git"
+
+inherit python_setuptools_build_meta ptest-python-pytest
+
+DEPENDS += "python3-setuptools-scm-native"
+
+RDEPENDS:${PN} += " \
+    python3-core \
+    python3-datetime \
+    python3-io \
+    python3-json \
+    python3-netclient \
+    python3-netserver \
+    python3-shell \
+    python3-stringold \
+    python3-unittest \
+"
+
+PTEST_PYTEST_DIR = "varlink/tests"
#1 lore raw

This recipe is missing version (e.g. 31.0.0+git).
Also the runtime dependencies should be split.
I think that at least unittests should go to ptest package, not main.

Peter

Quoted 76 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Omri Sarig via lists.openembedded.org
Sent: Thursday, March 20, 2025 12:30
To: [email protected]
Cc: Omri Sarig <[email protected]>
Subject: [oe] [meta-python][PATCH v2] python3-varlink: Add recipe

Add a python recipe to install the python implementation for the varlink interface.

The recipe is using the current master head, instead of the version from pypi. This is done as the pypi version is 4 years old, while the master is continuously maintained in GitHub.

The runtime dependencies were created by looking at all the import statement in the installed files of the repository and looking at the relevant packages from the python3 manifest file in meta-poky.

---
 .../ptest-packagelists-meta-python.inc        |  1 +
 .../python/python3-varlink_git.bb             | 28 +++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-varlink_git.bb
meta- renamed from meta-python/conf/include/ptest-packagelists-meta-python.inc +0 -0

python/conf/include/ptest-packagelists-meta-python.inc index 3a1fb13ba7..40df4f08f3 100644

meta-python/conf/include/ptest-packagelists-meta-python.inc +1 -0
@@ -89,6 +89,7 @@ PTESTS_FAST_META_PYTHON = "\
     python3-unidiff \
     python3-uritemplate \
     python3-validators \
+    python3-varlink \
     python3-wrapt \
     python3-wsproto \
     python3-xlrd \
meta- renamed from meta-python/recipes-devtools/python/python3-varlink_git.bb +0 -0

python/recipes-devtools/python/python3-varlink_git.bb new file mode 100644
index 0000000000..8b5e01cf44

meta-python/recipes-devtools/python/python3-varlink_git.bb new file +4 -0
@@ -0,0 +1,28 @@
+SUMMARY = " Python implementation of the Varlink protocol"
+HOMEPAGE = "https://varlink.org/python/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM =

"file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"

meta-python/recipes-devtools/python/python3-varlink_git.bb new file +24 -0
+
+SRC_URI = "git://github.com/varlink/python.git;protocol=https;branch=master"
+
+SRCREV = "6012b8805bf2ebcc981c84bd56a3e949a2141c16"
+
+S = "${WORKDIR}/git"
+
+inherit python_setuptools_build_meta ptest-python-pytest
+
+DEPENDS += "python3-setuptools-scm-native"
+
+RDEPENDS:${PN} += " \
+    python3-core \
+    python3-datetime \
+    python3-io \
+    python3-json \
+    python3-netclient \
+    python3-netserver \
+    python3-shell \
+    python3-stringold \
+    python3-unittest \
+"
+
+PTEST_PYTEST_DIR = "varlink/tests"
author
#2 lore raw
Quoted 1 line · Peter

This recipe is missing version (e.g. 31.0.0+git).

I'll add the version, I missed that.

Quoted 2 lines

Also the runtime dependencies should be split.
I think that at least unittests should go to ptest package, not main.

I was not sure what is the right thing to do here is.
When installing the package through setuptools, it also installs the tests directory as part of the package (so it ends up in the target at /usr/lib/python3.12/site-packages/varlink/tests/). Following the README, running the examples of the package require running some files from the tests directory, that also import unittest.

So, if we want to keep the full functionality, and allow a user on the target to run the examples, we have to keep all of the current runtime dependencies as part of main.

So the options I can think of are:

1. Leave the dependencies as-is, adding the reasoning above to the commit message.
2. Split the dependencies, and remove the tests directory from the target (even though it is included through setuptools). This way, the package is smaller (and have less dependencies), but it ends up being significantly different than what will be available when it is usually installed. 2a. If we want, we can have it done through a flag, so a user is able to explicitly decide to include the test packages in.
3. Split the dependencies, but keep the tests directory as part of the installation - this way, we have less runtime dependencies for regular use of the package, but if a user is trying to run the examples on the target, they will receive an import error.

What do you think is the best solution here?

Omri

Quoted 76 lines
Quoted 76 lines

-----Original Message----- From:[email protected] <openembedded- [email protected]> On Behalf Of Omri Sarig via lists.openembedded.org
Sent: Thursday, March 20, 2025 12:30 To:[email protected]
Cc: Omri Sarig<[email protected]>
Subject: [oe] [meta-python][PATCH v2] python3-varlink: Add recipe

Add a python recipe to install the python implementation for the varlink interface.

The recipe is using the current master head, instead of the version from pypi. This is done as the pypi version is 4 years old, while the master is continuously maintained in GitHub.

The runtime dependencies were created by looking at all the import statement in the installed files of the repository and looking at the relevant packages from the python3 manifest file in meta-poky.

---
  .../ptest-packagelists-meta-python.inc        |  1 +
  .../python/python3-varlink_git.bb             | 28 +++++++++++++++++++
  2 files changed, 29 insertions(+)

create mode 100644 meta-python/recipes-devtools/python/python3-varlink_git.bb

meta- renamed from meta-python/conf/include/ptest-packagelists-meta-python.inc +0 -0

python/conf/include/ptest-packagelists-meta-python.inc index 3a1fb13ba7..40df4f08f3 100644

meta-python/conf/include/ptest-packagelists-meta-python.inc +1 -0
@@ -89,6 +89,7 @@ PTESTS_FAST_META_PYTHON = "\
      python3-unidiff \
      python3-uritemplate \
      python3-validators \
+    python3-varlink \
      python3-wrapt \
      python3-wsproto \
      python3-xlrd \
meta- renamed from meta-python/recipes-devtools/python/python3-varlink_git.bb +0 -0

python/recipes-devtools/python/python3-varlink_git.bb new file mode 100644
index 0000000000..8b5e01cf44

meta-python/recipes-devtools/python/python3-varlink_git.bb new file +4 -0
@@ -0,0 +1,28 @@
+SUMMARY = " Python implementation of the Varlink protocol"
+HOMEPAGE ="https://varlink.org/python/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM =

"file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"

meta-python/recipes-devtools/python/python3-varlink_git.bb new file +24 -0
+
+SRC_URI ="git://github.com/varlink/python.git;protocol=https;branch=master"
+
+SRCREV = "6012b8805bf2ebcc981c84bd56a3e949a2141c16"
+
+S = "${WORKDIR}/git"
+
+inherit python_setuptools_build_meta ptest-python-pytest
+
+DEPENDS += "python3-setuptools-scm-native"
+
+RDEPENDS:${PN} += " \
+    python3-core \
+    python3-datetime \
+    python3-io \
+    python3-json \
+    python3-netclient \
+    python3-netserver \
+    python3-shell \
+    python3-stringold \
+    python3-unittest \
+"
+
+PTEST_PYTEST_DIR = "varlink/tests"
#3 lore raw

In ideal case we should do a good package split.
e.g. main package + examples package + test package (with examples depending on test) That would allow us to just install the tool with small footprint or install also tests or everything.

But we can also just keep it as is as it looks difficult. I just thought there is a low-hanging fruit somewhere.

Peter

From: Omri Sarig <[email protected]>
Sent: Friday, March 21, 2025 8:29
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>; [email protected]
Subject: Re: [oe] [meta-python][PATCH v2] python3-varlink: Add recipe

On 3/20/25 22:10, Marko, Peter wrote:

This recipe is missing version (e.g. 31.0.0+git).
I'll add the version, I missed that.

Also the runtime dependencies should be split.

I think that at least unittests should go to ptest package, not main.

I was not sure what is the right thing to do here is.
When installing the package through setuptools, it also installs the tests directory as part of the package (so it ends up in the target at /usr/lib/python3.12/site-packages/varlink/tests/). Following the README, running the examples of the package require running some files from the tests directory, that also import unittest.

So, if we want to keep the full functionality, and allow a user on the target to run the examples, we have to keep all of the current runtime dependencies as part of main.

So the options I can think of are:

1. Leave the dependencies as-is, adding the reasoning above to the commit message.
2. Split the dependencies, and remove the tests directory from the target (even though it is included through setuptools). This way, the package is smaller (and have less dependencies), but it ends up being significantly different than what will be available when it is usually installed. 2a. If we want, we can have it done through a flag, so a user is able to explicitly decide to include the test packages in.
3. Split the dependencies, but keep the tests directory as part of the installation - this way, we have less runtime dependencies for regular use of the package, but if a user is trying to run the examples on the target, they will receive an import error.

What do you think is the best solution here?

Omri

-----Original Message-----

From: [email protected]<mailto:[email protected]> <openembedded-

[email protected]<mailto:[email protected]>> On Behalf Of Omri Sarig via

lists.openembedded.org

Sent: Thursday, March 20, 2025 12:30

To: [email protected]<mailto:[email protected]>

Cc Omri Sarig <[email protected]><mailto:[email protected]>

Subject: [oe] [meta-python][PATCH v2] python3-varlink: Add recipe

Add a python recipe to install the python implementation for the varlink

interface.

The recipe is using the current master head, instead of the version from

pypi. This is done as the pypi version is 4 years old, while the master

is continuously maintained in GitHub.

The runtime dependencies were created by looking at all the import

statement in the installed files of the repository and looking at the

relevant packages from the python3 manifest file in meta-poky.

---

 .../ptest-packagelists-meta-python.inc        |  1 +
 .../python/python3-varlink_git.bb             | 28 +++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-varlink_git.bb
meta- renamed from meta-python/conf/include/ptest-packagelists-meta-python.inc +0 -0

python/conf/include/ptest-packagelists-meta-python.inc

index 3a1fb13ba7..40df4f08f3 100644

--- a/meta-python/conf/include/ptest-packagelists-meta-python.inc

+++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc

@@ -89,6 +89,7 @@ PTESTS_FAST_META_PYTHON = "\

     python3-unidiff \

     python3-uritemplate \

     python3-validators \

+ python3-varlink \

     python3-wrapt \

     python3-wsproto \

     python3-xlrd \
meta- renamed from meta-python/recipes-devtools/python/python3-varlink_git.bb +0 -0

python/recipes-devtools/python/python3-varlink_git.bb

new file mode 100644

index 0000000000..8b5e01cf44

--- /dev/null

+++ b/meta-python/recipes-devtools/python/python3-varlink_git.bb

@@ -0,0 +1,28 @@

+SUMMARY = " Python implementation of the Varlink protocol"

+HOMEPAGE = "https://varlink.org/python/"<https://varlink.org/python/>

+LICENSE = "Apache-2.0"

+LIC_FILES_CHKSUM =

"file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"<file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e>

+

+SRC_URI = "git://github.com/varlink/python.git;protocol=https;branch=master"<git://github.com/varlink/python.git;protocol=https;branch=master>

+

+SRCREV = "6012b8805bf2ebcc981c84bd56a3e949a2141c16"

+

+S = "${WORKDIR}/git"

+

+inherit python_setuptools_build_meta ptest-python-pytest

+

+DEPENDS += "python3-setuptools-scm-native"

+

+RDEPENDS:${PN} += " \

+ python3-core \

+ python3-datetime \

+ python3-io \

+ python3-json \

+ python3-netclient \

+ python3-netserver \

+ python3-shell \

+ python3-stringold \

+ python3-unittest \

+"

+

+PTEST_PYTEST_DIR = "varlink/tests"

author
#4 lore raw
Quoted 11 lines · Peter

In ideal case we should do a good package split.

e.g. main package + examples package + test package (with examples depending on test)

That would allow us to just install the tool with small footprint or install also tests or everything.

But we can also just keep it as is as it looks difficult.

I just thought there is a low-hanging fruit somewhere.

That makes sense - unfortunately, that was not the case with the way they built the varlink-python repo and setuptool installation.

I'll add this explanation to the commit message and the version number, and will send a new patch shortly.

Thanks,
Omri

Quoted 176 lines

Peter

*From:*Omri Sarig <[email protected]>
*Sent:* Friday, March 21, 2025 8:29
*To:* Marko, Peter (FT D EU SK BFS1) <[email protected]>; [email protected] *Subject:* Re: [oe] [meta-python][PATCH v2] python3-varlink: Add recipe

On 3/20/25 22:10, Marko, Peter wrote:

This recipe is missing version (e.g. 31.0.0+git).

I'll add the version, I missed that.

Also the runtime dependencies should be split.

I think that at least unittests should go to ptest package, not main.

I was not sure what is the right thing to do here is.
When installing the package through setuptools, it also installs the tests directory as part of the package (so it ends up in the target at /usr/lib/python3.12/site-packages/varlink/tests/). Following the README, running the examples of the package require running some files from the tests directory, that also import unittest.

So, if we want to keep the full functionality, and allow a user on the target to run the examples, we have to keep all of the current runtime dependencies as part of main.

So the options I can think of are:

1. Leave the dependencies as-is, adding the reasoning above to the commit message.
2. Split the dependencies, and remove the tests directory from the target (even though it is included through setuptools). This way, the package is smaller (and have less dependencies), but it ends up being significantly different than what will be available when it is usually installed. 2a. If we want, we can have it done through a flag, so a user is able to explicitly decide to include the test packages in.
3. Split the dependencies, but keep the tests directory as part of the installation - this way, we have less runtime dependencies for regular use of the package, but if a user is trying to run the examples on the target, they will receive an import error.

What do you think is the best solution here?

Omri

        -----Original Message-----

        From:[email protected] <openembedded-

        [email protected]> On Behalf Of Omri Sarig via

        lists.openembedded.org

        Sent: Thursday, March 20, 2025 12:30

        To:[email protected]

        Cc: Omri Sarig<[email protected]> <mailto:[email protected]>

        Subject: [oe] [meta-python][PATCH v2] python3-varlink: Add recipe

        Add a python recipe to install the python implementation for the varlink

        interface.

        The recipe is using the current master head, instead of the version from

        pypi. This is done as the pypi version is 4 years old, while the master

        is continuously maintained in GitHub.

        The runtime dependencies were created by looking at all the import

        statement in the installed files of the repository and looking at the

        relevant packages from the python3 manifest file in meta-poky.

        Signed-off-by: Omri Sarig<[email protected]> <mailto:[email protected]>

        ---

          .../ptest-packagelists-meta-python.inc        |  1 +

          .../python/python3-varlink_git.bb             | 28 +++++++++++++++++++

          2 files changed, 29 insertions(+)

          create mode 100644 meta-python/recipes-devtools/python/python3-varlink_git.bb

        diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-

        python/conf/include/ptest-packagelists-meta-python.inc

        index 3a1fb13ba7..40df4f08f3 100644

        --- a/meta-python/conf/include/ptest-packagelists-meta-python.inc

        +++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc

        @@ -89,6 +89,7 @@ PTESTS_FAST_META_PYTHON = "\

              python3-unidiff \

              python3-uritemplate \

              python3-validators \

        +    python3-varlink \

              python3-wrapt \

              python3-wsproto \

              python3-xlrd \

        diff --git a/meta-python/recipes-devtools/python/python3-varlink_git.bb b/meta-

        python/recipes-devtools/python/python3-varlink_git.bb

        new file mode 100644

        index 0000000000..8b5e01cf44

        --- /dev/null

        +++ b/meta-python/recipes-devtools/python/python3-varlink_git.bb

        @@ -0,0 +1,28 @@

        +SUMMARY = " Python implementation of the Varlink protocol"

        +HOMEPAGE ="https://varlink.org/python/" <https://varlink.org/python/>

        +LICENSE = "Apache-2.0"

        +LIC_FILES_CHKSUM =

        "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e" <file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e>

        +

        +SRC_URI ="git://github.com/varlink/python.git;protocol=https;branch=master" <git://github.com/varlink/python.git;protocol=https;branch=master>

        +

        +SRCREV = "6012b8805bf2ebcc981c84bd56a3e949a2141c16"

        +

        +S = "${WORKDIR}/git"

        +

        +inherit python_setuptools_build_meta ptest-python-pytest

        +

        +DEPENDS += "python3-setuptools-scm-native"

        +

        +RDEPENDS:${PN} += " \

        +    python3-core \

        +    python3-datetime \

        +    python3-io \

        +    python3-json \

        +    python3-netclient \

        +    python3-netserver \

        +    python3-shell \

        +    python3-stringold \

        +    python3-unittest \

        +"

        +

        +PTEST_PYTEST_DIR = "varlink/tests"