diff mbox series

[meta-python,v2] python3-varlink: Add recipe

Message ID 20250320113010.1428716-1-omri.sarig13@gmail.com
State Under Review
Headers show
Series [meta-python,v2] python3-varlink: Add recipe | expand

Commit Message

Omri Sarig March 20, 2025, 11:30 a.m. UTC
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 <omri.sarig13@gmail.com>
---
 .../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

Comments

Peter Marko March 20, 2025, 9:10 p.m. UTC | #1
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

> -----Original Message-----
> From: openembedded-devel@lists.openembedded.org <openembedded-
> devel@lists.openembedded.org> On Behalf Of Omri Sarig via
> lists.openembedded.org
> Sent: Thursday, March 20, 2025 12:30
> To: openembedded-devel@lists.openembedded.org
> Cc: Omri Sarig <omri.sarig13@gmail.com>
> 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 <omri.sarig13@gmail.com>
> ---
>  .../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/"
> +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"
Omri Sarig March 21, 2025, 7:28 a.m. UTC | #2
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:openembedded-devel@lists.openembedded.org <openembedded-
>> devel@lists.openembedded.org> On Behalf Of Omri Sarig via
>> lists.openembedded.org
>> Sent: Thursday, March 20, 2025 12:30
>> To:openembedded-devel@lists.openembedded.org
>> Cc: Omri Sarig<omri.sarig13@gmail.com>
>> 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<omri.sarig13@gmail.com>
>> ---
>>   .../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/"
>> +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"
Peter Marko March 21, 2025, 7:54 a.m. UTC | #3
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 <omri.sarig13@gmail.com>
Sent: Friday, March 21, 2025 8:29
To: Marko, Peter (FT D EU SK BFS1) <Peter.Marko@siemens.com>; openembedded-devel@lists.openembedded.org
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: openembedded-devel@lists.openembedded.org<mailto:openembedded-devel@lists.openembedded.org> <openembedded-

devel@lists.openembedded.org<mailto:devel@lists.openembedded.org>> On Behalf Of Omri Sarig via

lists.openembedded.org

Sent: Thursday, March 20, 2025 12:30

To: openembedded-devel@lists.openembedded.org<mailto:openembedded-devel@lists.openembedded.org>

Cc: Omri Sarig <omri.sarig13@gmail.com><mailto:omri.sarig13@gmail.com>

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 <omri.sarig13@gmail.com><mailto:omri.sarig13@gmail.com>

---

 .../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"
Omri Sarig March 21, 2025, 8 a.m. UTC | #4
On 3/21/25 08:54, Marko, Peter wrote:
>
> 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

> Peter
>
> *From:*Omri Sarig <omri.sarig13@gmail.com>
> *Sent:* Friday, March 21, 2025 8:29
> *To:* Marko, Peter (FT D EU SK BFS1) <Peter.Marko@siemens.com>; 
> openembedded-devel@lists.openembedded.org
> *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:openembedded-devel@lists.openembedded.org <openembedded-
>
>         devel@lists.openembedded.org> On Behalf Of Omri Sarig via
>
>         lists.openembedded.org
>
>         Sent: Thursday, March 20, 2025 12:30
>
>         To:openembedded-devel@lists.openembedded.org
>
>         Cc: Omri Sarig<omri.sarig13@gmail.com> <mailto:omri.sarig13@gmail.com>
>
>         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<omri.sarig13@gmail.com> <mailto:omri.sarig13@gmail.com>
>
>         ---
>
>           .../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"
>
diff mbox series

Patch

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/"
+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"