diff mbox series

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

Message ID 20250321084632.1889809-1-omri.sarig13@gmail.com
State New
Headers show
Series [meta-python,v3] python3-varlink: Add recipe | expand

Commit Message

Omri Sarig March 21, 2025, 8:46 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 or a tagged version. This is done as the pypi and tagged versions
are quite old, while the master is continuously maintained in GitHub.
The version set for the package is based upon the last tagged commit in
the tree, with the addition of git.
As the last tagged version is old, the recipe name is based over git,
instead of adding the old tag version to the file name.

The runtime dependencies were created by looking at all the import
statement in the installed files of the repository and taking the
relevant packages from the python3 manifest file in meta-poky.
Unfortunately, python-varlink does not have different installation
candidates for testing or example code - meaning that when the package
is install through setuptools, the test code is part of the target
system.
This causes the runtime dependencies to contain some packages (like
python3-unittest) which are not needed during regular operation of the
system, assuming the user will not want to run test or example code.
However, as these files are installed in the system, and are used as the
reference example, we've decided to keep the runtime dependencies as-is.
Future work on this package can be done to split the runtime
dependencies to different parts (main and test for example), and modify
the installed files on the system according to the user wishes.

Signed-off-by: Omri Sarig <omri.sarig13@gmail.com>
---
 .../ptest-packagelists-meta-python.inc        |  1 +
 .../python/python3-varlink_git.bb             | 30 +++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-varlink_git.bb

Comments

Khem Raj March 21, 2025, 9:40 a.m. UTC | #1
On Fri, Mar 21, 2025 at 1:47 AM Omri Sarig via lists.openembedded.org
<omri.sarig13=gmail.com@lists.openembedded.org> wrote:
>
> 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 or a tagged version. This is done as the pypi and tagged versions
> are quite old, while the master is continuously maintained in GitHub.
> The version set for the package is based upon the last tagged commit in
> the tree, with the addition of git.
> As the last tagged version is old, the recipe name is based over git,
> instead of adding the old tag version to the file name.
>
> The runtime dependencies were created by looking at all the import
> statement in the installed files of the repository and taking the
> relevant packages from the python3 manifest file in meta-poky.
> Unfortunately, python-varlink does not have different installation
> candidates for testing or example code - meaning that when the package
> is install through setuptools, the test code is part of the target
> system.
> This causes the runtime dependencies to contain some packages (like
> python3-unittest) which are not needed during regular operation of the
> system, assuming the user will not want to run test or example code.
> However, as these files are installed in the system, and are used as the
> reference example, we've decided to keep the runtime dependencies as-is.
> Future work on this package can be done to split the runtime
> dependencies to different parts (main and test for example), and modify
> the installed files on the system according to the user wishes.
>
> Signed-off-by: Omri Sarig <omri.sarig13@gmail.com>
> ---
>  .../ptest-packagelists-meta-python.inc        |  1 +
>  .../python/python3-varlink_git.bb             | 30 +++++++++++++++++++
>  2 files changed, 31 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..b50bfac379
> --- /dev/null
> +++ b/meta-python/recipes-devtools/python/python3-varlink_git.bb
> @@ -0,0 +1,30 @@
> +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"
> +
> +PV = "30.3.1+git"
> +
> +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 \
> +"

I think some of the rdeps here are only needed to run ptests, they
should be moved to RDEPENDS:${PN}-ptest rdeps



> +
> +PTEST_PYTEST_DIR = "varlink/tests"
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#116174): https://lists.openembedded.org/g/openembedded-devel/message/116174
> Mute This Topic: https://lists.openembedded.org/mt/111824890/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Omri Sarig March 21, 2025, 9:52 a.m. UTC | #2
On 3/21/25 10:40, Khem Raj wrote:
> On Fri, Mar 21, 2025 at 1:47 AM Omri Sarig via lists.openembedded.org
> <omri.sarig13=gmail.com@lists.openembedded.org> wrote:
>> 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 or a tagged version. This is done as the pypi and tagged versions
>> are quite old, while the master is continuously maintained in GitHub.
>> The version set for the package is based upon the last tagged commit in
>> the tree, with the addition of git.
>> As the last tagged version is old, the recipe name is based over git,
>> instead of adding the old tag version to the file name.
>>
>> The runtime dependencies were created by looking at all the import
>> statement in the installed files of the repository and taking the
>> relevant packages from the python3 manifest file in meta-poky.
>> Unfortunately, python-varlink does not have different installation
>> candidates for testing or example code - meaning that when the package
>> is install through setuptools, the test code is part of the target
>> system.
>> This causes the runtime dependencies to contain some packages (like
>> python3-unittest) which are not needed during regular operation of the
>> system, assuming the user will not want to run test or example code.
>> However, as these files are installed in the system, and are used as the
>> reference example, we've decided to keep the runtime dependencies as-is.
>> Future work on this package can be done to split the runtime
>> dependencies to different parts (main and test for example), and modify
>> the installed files on the system according to the user wishes.
>>
>> Signed-off-by: Omri Sarig <omri.sarig13@gmail.com>
>> ---
>>   .../ptest-packagelists-meta-python.inc        |  1 +
>>   .../python/python3-varlink_git.bb             | 30 +++++++++++++++++++
>>   2 files changed, 31 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..b50bfac379
>> --- /dev/null
>> +++ b/meta-python/recipes-devtools/python/python3-varlink_git.bb
>> @@ -0,0 +1,30 @@
>> +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"
>> +
>> +PV = "30.3.1+git"
>> +
>> +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 \
>> +"
> I think some of the rdeps here are only needed to run ptests, they
> should be moved to RDEPENDS:${PN}-ptest rdeps

Thanks for the fast reply.

The problem is that the python-varlink repository installs the test 
files as part of the package (so it'll be available in 
`/usr/lib/python3.12/site-packages/varlink/tests/` on the target), and 
these files also contains the example code for the repository.

I've discussed exactly that issue with @peter marko on the second 
version of the patch here:
https://lists.openembedded.org/g/openembedded-devel/message/116172

If you still think that we should split that, and have some solution for 
the installed tests directory (either leave it there, without allowing 
the user to run-it, or manually remove them from the installation), I 
can do that. Please let me know.

>
>
>> +
>> +PTEST_PYTEST_DIR = "varlink/tests"
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#116174): https://lists.openembedded.org/g/openembedded-devel/message/116174
>> Mute This Topic: https://lists.openembedded.org/mt/111824890/1997914
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
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..b50bfac379
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-varlink_git.bb
@@ -0,0 +1,30 @@ 
+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"
+
+PV = "30.3.1+git"
+
+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"