The newer meta-python versions (honister, kirkstone, master) still use python3-django version 2.2 as default preference, stating in the newer recipes that the LTS version should be build by default. However, 2.2 had end of extended support April 11, 2022. The current LTS is 3.2, which is available as recipe in the layers, but not activated as default. https://www.djangoproject.com/download/ Additionally, python3-django version 3.2 and 4.x depend on python3-asgiref, which is missing as dependency in the recipes and not part of meta-python.
*** Bug 14889 has been marked as a duplicate of this bug. ***
Created attachment 4897 [details] Patch to pull python3-asgiref package for python3-django.
Though python3-django needs python3-asgiref it does not break while building python3-django v3.2.12 and v4.0.2. This probably is the reason why python3-asgiref recipe was not added. This can be verified with the following changes for kirkstone. diff --git a/meta-python/recipes-devtools/python/python3-django_3.2.12.bb b/meta-python/recipes-devtools/python/python3-django_3.2.12.bb index adbc498bd..9e9d6768d 100644 --- a/meta-python/recipes-devtools/python/python3-django_3.2.12.bb +++ b/meta-python/recipes-devtools/python/python3-django_3.2.12.bb @@ -10,4 +10,4 @@ RDEPENDS:${PN} += "\ # Set DEFAULT_PREFERENCE so that the LTS version of django is built by # default. To build the 3.x branch, # PREFERRED_VERSION_python3-django = "3.2.2" can be added to local.conf -DEFAULT_PREFERENCE = "-1" +#DEFAULT_PREFERENCE = "-1" diff --git a/meta-python/recipes-devtools/python/python3-django_4.0.2.bb b/meta-python/recipes-devtools/python/python3-django_4.0.2.bb index 690b9809d..84348e0af 100644 --- a/meta-python/recipes-devtools/python/python3-django_4.0.2.bb +++ b/meta-python/recipes-devtools/python/python3-django_4.0.2.bb @@ -10,4 +10,4 @@ RDEPENDS:${PN} += "\ # Set DEFAULT_PREFERENCE so that the LTS version of django is built by # default. To build the 4.x branch, # PREFERRED_VERSION_python3-django = "4.0.2" can be added to local.conf -DEFAULT_PREFERENCE = "-1" +#DEFAULT_PREFERENCE = "-1" and adding any of the two lines in the conf/local.conf. PREFERRED_VERSION_python3-django = "4.0.2" PREFERRED_VERSION_python3-django = "3.2.12" But yes it crashes while running /usr/bin/django-admin. -- snip -- root@qemuarm:~# /usr/bin/django-admin Traceback (most recent call last): File "/usr/bin/django-admin", line 5, in <module> from django.core.management import execute_from_command_line File "/usr/lib/python3.10/site-packages/django/core/management/__init__.py", line 13, in <module> from django.apps import apps File "/usr/lib/python3.10/site-packages/django/apps/__init__.py", line 1, in <module> from .config import AppConfig File "/usr/lib/python3.10/site-packages/django/apps/config.py", line 7, in <module> from django.utils.deprecation import RemovedInDjango41Warning File "/usr/lib/python3.10/site-packages/django/utils/deprecation.py", line 5, in <module> from asgiref.sync import sync_to_async ModuleNotFoundError: No module named 'asgiref' root@qemuarm:~# -- snip -- With the attached [patch|https://bugzilla.yoctoproject.org/attachment.cgi?id=4897&action=edit] for kirkstone, /usr/bin/django-admin runs correctly (though not all options are tested). -- snip -- root@qemuarm:~# /usr/bin/django-admin shell Python 3.10.4 (main, Mar 23 2022, 20:25:24) [GCC 11.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> now exiting InteractiveConsole... root@qemuarm:~# -- snip -- If the changes look good then I will try to push to meta-openembedded mailing list. Regards, Jagadeesh
This isn't a Yocto ( bitbake or oe-core ) bug since the recipe is in meta-openembedded. Please post a patch or report the bug to the list / layer maintainers where such things are handled: openembedded-devel@lists.openembedded.org -- YP Triage meeting.
For the record, the patches are merged in the meta-openembedded layer at https://git.openembedded.org/meta-openembedded/log/meta-python/recipes-devtools/python. Regards, Jagadeesh
Thank you Jagadeesh! Best regards, Johannes