[OE-core] PATCH: Fixing python3-pyvenv and adding python3-venv

Hugues Kamba Hugues.Kamba at arm.com
Tue Oct 23 21:51:32 UTC 2018


Hi Alejandro,

Although I disagree with having them bundled together (for the simple reason they are not the same), if there has to be only one it should be python3-venv and not python3-pyvenv as it currently is the case. Debian for example has a python3-venv package.

Including python3-venv should allow creation of virtual envs without the need to call on the pyvenv  script (python3-runpy must also be included). Pyvenv should be optional prior to python 3.6 and not there at all from 3.6.

In any case, python3-pyvenv as currently provided by OE is broken because it is missing the venv module depency.

Thanks
Hugues

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Alejandro Hernandez <alejandro.enedino.hernandez-samaniego at xilinx.com>
Sent: Tuesday, October 23, 2018 10:26:07 PM
To: Hugues Kamba; Alejandro Hernandez; openembedded-core at lists.openembedded.org
Cc: Diego Russo; Jeremy Johnson; aehs29 at gmail.com
Subject: Re: [OE-core] PATCH: Fixing python3-pyvenv and adding python3-venv


Hello Huges,


On 10/23/2018 12:12 AM, Hugues Kamba wrote:

Hi Alenjandro,


More information here: https://www.python.org/dev/peps/pep-0405/#creating-virtual-environments


What I am proposing is also a good idea for when python 3.6 is available in Yocto.

With Python 3.5 one can create virtual environment by including python3-pyvenv OR python3-venv+python3-runpy.

With Python 3.6 one will only be able to create virtual environments with python3-venv+python3-runpy.


I hope I made it a bit clearer now.



I do understand what you are saying, they are two different things, and while the purpose of the manifest

is to provide more granularity on what goes or doesn't go on an image, we still have to be careful on

how we package things, in this case I simply don't see any reason why we would need two separate packages,

specially because nothing else RDEPENDS on venv , and I don't see the point in creating a package that only

contains a single binary.


I believe it makes more sense to package them both together in a single package, we are upgrading to python 3.7 soon,

and I believe having a single vnenv package should work for that too.


Cheers,

Alejandro


Thanks!


Hugues
________________________________
From: Hugues Kamba
Sent: 22 October 2018 23:47:44
To: Alejandro Hernandez; openembedded-core at lists.openembedded.org<mailto:openembedded-core at lists.openembedded.org>
Cc: Diego Russo; Jeremy Johnson; aehs29 at gmail.com<mailto:aehs29 at gmail.com>
Subject: Re: [OE-core] PATCH: Fixing python3-pyvenv and adding python3-venv



Hi Alejandro,

I submitted the patch using git send-email since that email.


pyvenv and venv are not the same. pyvenv depends on venv to run.

See the entire content of pyvenv:
---------------------------------------------------
#! /usr/bin/python3.5
if __name__ == '__main__':
    import sys
    rc = 1
    try:
        import venv
        venv.main()
        rc = 0
    except Exception as e:
        print('Error: %s' % e, file=sys.stderr)
    sys.exit(rc)
----------------------------------------------------
As you can see, pyvenv depends on venv to run. Because it is confusing to have both pyvenv and venv; pyvenv has been deprecated in python 3.6.

They should be two seperate packages not a single because they are different things. Read here for more information: https://docs.python.org/3/library/venv.html


I do not understand what you mean by the cached files as I did not add it. After modifying the JSON I ran create_manifest3.py which added that, the rdepends content on venv was also added automatically after runny that script. My changes are only adding pyvenv and venv in the JSON.


I will submit another patch which removes pyvenv in the python3 recipe.


Regards,


Hugues




________________________________
From: Alejandro Hernandez <alejandro.enedino.hernandez-samaniego at xilinx.com><mailto:alejandro.enedino.hernandez-samaniego at xilinx.com>
Sent: 22 October 2018 23:17:26
To: Hugues Kamba; openembedded-core at lists.openembedded.org<mailto:openembedded-core at lists.openembedded.org>
Cc: Diego Russo; Jeremy Johnson; aehs29 at gmail.com<mailto:aehs29 at gmail.com>
Subject: Re: [OE-core] PATCH: Fixing python3-pyvenv and adding python3-venv


Hello Huges,


I cannot reply inline because you sent the patch as an attachment, please send it using git send-email next time.


Also, something doesnt add up here:



+    "pyvenv": {
+        "summary": "Allow you to create virtual environments so we can isolate our project dependencies. Deprecated in Python 3.6",
+        "rdepends": [
+            "core",
+            "venv"


This doesnt make sense, since you are saying that the python3-pyvenv package depends on python3-venv?, shouldnt they be the same package?


+        ],
+        "files": [
+            "${bindir}/pyvenv*"



Again, this should probably on one single package.




 +        ],
+        "cached": []
+    },
     "resource": {
         "summary": "Python resource control interface",
         "rdepends": [
@@ -1107,6 +1118,21 @@
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/getpass.*.pyc"
         ]




This is wrong because, cached files shouldnt be on rdepends.



Everything from there to the bottom is probably ok.

 },
+    "venv": {
+        "summary": "Provides support for creating lightweight virtual environments with their own site directories, optionally isolated from system site directories",
+        "rdepends": [
+            "compression",
+            "core",
+            "logging",
+            "shell",
+            "stringold",
+            "unixadmin"
+        ],
+        "files": [
+            "${libdir}/python${PYTHON_MAJMIN}/venv"
+        ],
+        "cached": []
+    },
     "xml": {
         "summary": "Python basic XML support",
         "rdepends": [




Also, this patch is missing the changes to the python3 recipe file where the python3-pyvenv package was being previously created, if were now doing it through the manifest, then we dont need it in the recipe.


Thanks!


Alejandro




On 10/22/2018 11:48 AM, Hugues Kamba wrote:

Dear All,


As it currently is, python3-pyvenv is broken because it is missing the venv module run-time dependency.


The patch I am submitting is to add the venv module dependency to python3-pyvenv.

The dependency has been added using the newly added venv package (python3-venv).

The python3-venv package has been added for future proofing since pyvenv has been deprecated in Python 3.6 and creation of virtual environment is done using the venv module directly (i.e python3 -m venv my_venv).


Regards,


Hugues Kamba

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20181023/1b446c8f/attachment-0002.html>


More information about the Openembedded-core mailing list