From patchwork Mon Feb 28 03:55:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 4380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E60D4C433EF for ; Mon, 28 Feb 2022 03:56:09 +0000 (UTC) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mx.groups.io with SMTP id smtpd.web08.16789.1646020555431500875 for ; Sun, 27 Feb 2022 19:55:55 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Q2ieeAA7; spf=pass (domain: gmail.com, ip: 209.85.214.179, mailfrom: ticotimo@gmail.com) Received: by mail-pl1-f179.google.com with SMTP id h17so4027948plc.5 for ; Sun, 27 Feb 2022 19:55:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MMKVUC+OP0JJLOgIX80DfG1EC2rgbei2PtkoKrSunOU=; b=Q2ieeAA7PHECUK89PLIaohsgxPXtkVeLNAiYyKYYJ7cRFFa8p1IjFrSML0M887jHzr Ro7JQcmjJ2ZUWVrTt89tdUdadW5f4UJrZkx+sjdO3C3lH/zQRLPeAscNHpiPgn3kbMNW E1knxgdQ3RzzKzWH025fAaMUqR/xl82OCy8Oxu9b7/QT7cyKMnqqNWvM8pPAGLE8TTsy TWysNuuipcsZky5FJ6QHG784zDLxDcdk7s1T+o0ia6vc2xwgsoSRrTWrd+esyy79pQYH beI0Ld0xzzll9foAut02Ao6whXJgexTZ7IKrJJMtz6w0xQWJPmXjyrrOl3WY8y4PJ94F miDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MMKVUC+OP0JJLOgIX80DfG1EC2rgbei2PtkoKrSunOU=; b=B+4JuRltimERjJZAQM0hmuCVX044jtnZ7knfd7IqdOAYh1oEOD5RLszVpFsreqJjti 4MiinJLPteQrCbNNxClafWfMrWknT7qhJ7r8ZEengDCn6nTpayo5nwpSCWZGtO9JirTd CtHKFAeMiiuYC9BnZQRDxqaZmMKzCQswk5aomVL+H3ka+jktYuHM98K7EkioXjIJIZBk PHWv08bDsCbqZmU3mXFeFJuaAUSTNA0l4jHnzRKEJO+ctx92egLjMxEbU0KyEvhGs7g0 U9ikK6uwgEOL/35WcWvWhJpp+9OS0bYUNS7jBAgOE3kL1HA7ZRu/dpWok2wdweHrREmC 1/OQ== X-Gm-Message-State: AOAM530FhAvbUUY3s4blKWc9ZOnxvw3ylLpSftGF+HhO6o5r0FSr1AXG O5N4WHDyfLIdYfkyGVFBvVssGZleNW8= X-Google-Smtp-Source: ABdhPJxCGFVslqiNy/eQQdlNjvyUbvwu/+0HyFx6v9qQ5WKuUJvoVlGCVRxCabYWRG5pV2hUmFWhKA== X-Received: by 2002:a17:90a:a42:b0:1bd:1985:5182 with SMTP id o60-20020a17090a0a4200b001bd19855182mr8974579pjo.5.1646020554259; Sun, 27 Feb 2022 19:55:54 -0800 (PST) Received: from nereus.hsd1.or.comcast.net ([2601:1c0:6000:1b20:1961:a694:c80b:3158]) by smtp.gmail.com with ESMTPSA id g5-20020a655805000000b003643e405b56sm8811011pgr.24.2022.02.27.19.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 19:55:53 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: docs@lists.yoctoproject.org Cc: Tim Orling Subject: [PATCH 1/3] docs: add new python packaging classes Date: Sun, 27 Feb 2022 19:55:45 -0800 Message-Id: <20220228035547.1134436-1-tim.orling@konsulko.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 28 Feb 2022 03:56:09 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/2505 Add the new classes used for Python packaging: * flit_core * pip_install_wheel * setuptools_build_meta Signed-off-by: Tim Orling --- documentation/ref-manual/classes.rst | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index 949217bf4..2338ef6b3 100644 --- a/documentation/ref-manual/classes.rst +++ b/documentation/ref-manual/classes.rst @@ -650,6 +650,22 @@ variables are not met, the recipe will be skipped, and if the build system attempts to build the recipe then an error will be triggered. +.. _ref-classes-flit_core: + +``flit_core.bbclass`` +===================== + +The ``flit_core`` class enables building Python modules which declare +the `PEP-517 `__ compliant +``flit_core.buildapi`` ``build-backend`` in the ``[build-system]`` +section of ``pyproject.toml`` (See `PEP-518 `__). + +Python modules built with ``flit_core.buildapi`` are pure Python (no +``C`` or ``Rust`` extensions). + +The resulting ``wheel`` (See `PEP-427 `__) +is installed with the :ref:`pip_install_wheel ` class. + .. _ref-classes-fontcache: ``fontcache.bbclass`` @@ -2025,6 +2041,26 @@ When inherited by a recipe, the ``perlnative`` class supports using the native version of Perl built by the build system rather than using the version provided by the build host. +.. _ref-classes-pip_install_wheel: + +``pip_install_wheel.bbclass`` +============================= + +The ``pip_install_wheel`` class uses ``pip`` to install a Python ``wheel`` +binary archive format (See `PEP-427 `__) + +The Python ``wheel`` can be built with several classes, including :ref:`flit_core `, +:ref:`setuptools_build_meta `, and :ref:`setuptools3 `. + +The absolute path to the built ``wheel`` to be installed is defined by :term:`PYPA_WHEEL` which can be +overriden for recipes where the filename or version number of the wheel are not easily +determined by the defaults. Other variables which can be used to customize the behavior +of the ``pip_install_wheel`` class include: + +- :term:`PIP_INSTALL_ARGS` +- :term:`PIP_INSTALL_PACKAGE` +- :term:`PIP_INSTALL_DIST_PATH` + .. _ref-classes-pixbufcache: ``pixbufcache.bbclass`` @@ -2380,6 +2416,23 @@ additional configuration options you want to pass SCons command line. The ``sdl`` class supports recipes that need to build software that uses the Simple DirectMedia Layer (SDL) library. +.. _ref-classes-setuptools_build_meta: + +``setuptools_build_meta.bbclass`` +================================= + +The ``setuptools_build_meta`` class enables building Python modules which +declare the +`PEP-517 `__ compliant +``setuptools.build_meta`` ``build-backend`` in the ``[build-system]`` +section of ``pyproject.toml`` (See `PEP-518 `__). + +Python modules built with ``setuptools.build_meta`` can be pure Python or +include ``C`` or ``Rust`` extensions). + +The resulting ``wheel`` (See `PEP-427 `__) +is installed with the :ref:`pip_install_wheel ` class. + .. _ref-classes-setuptools3: ``setuptools3.bbclass`` From patchwork Mon Feb 28 03:55:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 4378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05650C433EF for ; Mon, 28 Feb 2022 03:56:03 +0000 (UTC) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mx.groups.io with SMTP id smtpd.web08.16790.1646020563177040221 for ; Sun, 27 Feb 2022 19:56:03 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pTTMnpjT; spf=pass (domain: gmail.com, ip: 209.85.210.174, mailfrom: ticotimo@gmail.com) Received: by mail-pf1-f174.google.com with SMTP id t5so839398pfg.4 for ; Sun, 27 Feb 2022 19:56:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=53phjAYjPKJRokA7PbJSubVRmKCeGYgelotB6K6iAhg=; b=pTTMnpjT8IvldxSkFnKSiOU9iaFBGEqR2vDRDJ7waTqlBNvYKx7w+xV3Vfi8VGj6oR leWj7ytAKUe0fWYD/ULoTaQz6blGd0jyj2L8uJKSwcH5deLAlrtCg4qFFQwYxf2rs9cL TQEX1fzK/LuMr0jvtvkeUOjkz1TxHNh3hr72Fn7HYgItTZlblkvdydLCcMBZe1Uvl3ay IlxAYOqrEEz5F53C+JFeSXbU98/2rK5cpxVlfC8kVItEtHaEuaL1H/CWKgUi95AYlYl4 p8GV7eKLJrKiyva98np8AZbUVOKj01d7+1L2LzbUyNnnrYkR3Z1YjIj9Ft2l1F0a9XZf 9kxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=53phjAYjPKJRokA7PbJSubVRmKCeGYgelotB6K6iAhg=; b=w0b5xM8S61zfnsrL160S5X0x2HMvHzzwLwgrRV9atY8QVILmUHdB2/6oRJ7u2kYyRj 1zAC18cTIn8jBEuFJLeM/06QtFraJNPzyh9K2Mhadz7plSFRGqmEX++VA41M5uN2UBkm wYOnkpgZ1OZ5EgaUwGi2JO0pXo5d/G3CAqyTI2zojamV0eU7TmcHcenV3clv9D18iTSv 7vU1GyD3sWjtxM0/qrYBNfIFdxcrk5qEsU2dDJQfIEbjs2UWFPAfSOvLRdCKNOerETgH BcR3KPA/3OO57+Vdu7upVCVABv9ByaOLr2ijiv8u3OutcY1m8U3whx0z/EL6oEHSbABE s6wg== X-Gm-Message-State: AOAM531syp4zlPG5tFk3xPQx38Gi6VXA1QkXANJa5WVmmINZHoZJpnZW 0J4+zFRtgJua58hAYLB5iXZaIxytLzU= X-Google-Smtp-Source: ABdhPJzr+LDySX5L3koqSIwOtkyQt4s342T3IzS4ZgtYybPmkSqpN/oVZzjLGPb20b2/BKENWENAvg== X-Received: by 2002:a05:6a00:b84:b0:492:64f1:61b5 with SMTP id g4-20020a056a000b8400b0049264f161b5mr19424162pfj.52.1646020562241; Sun, 27 Feb 2022 19:56:02 -0800 (PST) Received: from nereus.hsd1.or.comcast.net ([2601:1c0:6000:1b20:1961:a694:c80b:3158]) by smtp.gmail.com with ESMTPSA id g5-20020a655805000000b003643e405b56sm8811011pgr.24.2022.02.27.19.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 19:56:01 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: docs@lists.yoctoproject.org Cc: Tim Orling Subject: [PATCH 2/3] docs: add pip install variables Date: Sun, 27 Feb 2022 19:55:46 -0800 Message-Id: <20220228035547.1134436-2-tim.orling@konsulko.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220228035547.1134436-1-tim.orling@konsulko.com> References: <20220228035547.1134436-1-tim.orling@konsulko.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 28 Feb 2022 03:56:03 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/2506 Add the new variables used to install Python `wheel` binary archives: * PIP_INSTALL_ARGS * PIP_INSTALL_DIST_PATH * PIP_INSTALL_PACKAGE * PYPA_WHEEL Signed-off-by: Tim Orling Reviewed-by: Michael Opdenacker --- documentation/ref-manual/variables.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index ecb2b60c7..1f6433084 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -5594,6 +5594,25 @@ system and gives an overview of their function and contents. ``bash-4.2-r1/``). This variable is comprised of the following: ${:term:`PN`}-${:term:`EXTENDPE`}${:term:`PV`}-${:term:`PR`} + :term:`PIP_INSTALL_ARGS` + When used by recipes that inherit the + :ref:`pip_install_wheel ` class, + denotes the arguments passed to ``pip install`` to adjust the + behavior of how the ``wheel`` is installed. + + :term:`PIP_INSTALL_DIST_PATH` + When used by recipes that inherit the + :ref:`pip_install_wheel ` class, + denotes the path to ``dist/`` (short for distribution) where the + binary archive ``wheel`` is built. This is used in part to create + the :term:`PYPA_WHEEL` variable. + + :term:`PIP_INSTALL_PACKAGE` + When used by recipes that inherit the + :ref:`pip_install_wheel ` class, + denotes the name of the package portion of the ``wheel`` filename. + This is used in part to create the :term:`PYPA_WHEEL` variable. + :term:`PIXBUF_PACKAGES` When inheriting the :ref:`pixbufcache ` class, this variable identifies packages that contain the pixbuf @@ -6021,6 +6040,13 @@ system and gives an overview of their function and contents. :term:`PV` is the default value of the :term:`PKGV` variable. + :term:`PYPA_WHEEL` + When used by recipes that inherit the + :ref:`pip_install_wheel ` class, denotes + the absolute path to the built ``wheel`` to be installed. Normally the + defaults which use :term:`PIP_INSTALL_PACKAGE` and :term:`PIP_INSTALL_DIST_PATH` + to build the path to the ``wheel`` should be sufficient. + :term:`PYTHON_ABI` When used by recipes that inherit the :ref:`distutils3 `, From patchwork Mon Feb 28 03:55:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 4379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAACCC433F5 for ; Mon, 28 Feb 2022 03:56:09 +0000 (UTC) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mx.groups.io with SMTP id smtpd.web12.16366.1646020568621133258 for ; Sun, 27 Feb 2022 19:56:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=X1Tu52Qw; spf=pass (domain: gmail.com, ip: 209.85.215.173, mailfrom: ticotimo@gmail.com) Received: by mail-pg1-f173.google.com with SMTP id w37so10306700pga.7 for ; Sun, 27 Feb 2022 19:56:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6xoZG7vF7EGXho4zaD24p6uJNiFrLE3fOyAuDN2CQX4=; b=X1Tu52QwYpG+WR51qM8xK1dFy5R/56nvMVAkYN62U5dJEqYdKmM7V3cKexB5FCKkpY Kz78Fp3trEXYsT8nfe5nSdjHcfyiF+bwPSsJnbLOf5urLT1c6A1xNV8d80nQK7rz8ezf XvTceXmc4yoFp67wxjcgE4nUll/viYcI/TcoEeI3qH7ApvQ/ZguvXdpN70IU4Pwjs+cD XuF8DhiNrz9Wt03LLBCersPwEiyBKYYqGgcc9KfCj8VJISXUW3u9IqDsAxNaWfgRfgG7 N6cxfmmWSGnPptZw+RxpwweJGLgpnWViT4TU9KdvujD/HP2FhbEyuLWIb8yw1UOyVvJt Zj4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6xoZG7vF7EGXho4zaD24p6uJNiFrLE3fOyAuDN2CQX4=; b=u+S70mM50trOSRtfcd4JhiP4VdVbuayH/NbGktK+2EQnz5dMFCMkaHNAfdELvpk6j2 mCz6n2bScIl5qCDUQSZ76BdjrqtvMSzfQRQqo5XfTwq1//9iE4+3E05MIYCtkGMnv8ak lSy+Rez4P4jGxSHumjYr2D7y3/eAYLN1Ug39q15BSZXBs/d/SLK8BtWQVyBRECr9lN13 vXrwDn9q9MKqb4WzI7CelSHvX9ZGCB94LFDO2VzNrglAFEzonFvO91mXHeLX6F3CAqSQ wZUFVIKQk8ybspb8RCo8NFqKFvq1hVLXVRR37Ov52m69FASEIWw8ztWJ0JdvpxbJiF+M qjrA== X-Gm-Message-State: AOAM530y8s4e2I/tlBGqZtSiwe9xl6Drxrgux6xv45sDJYdgfLBhIRQU laeclyLgL+EKX10yQQf6987DSiYiNFE= X-Google-Smtp-Source: ABdhPJxjfI5zGojCf8S6mo+0KTMZnslwy5oy9hm5SBEfhXedVkfbu+YKQ2nOdDTQW+2DAJdG/Fygkw== X-Received: by 2002:a63:698a:0:b0:36c:1d0a:2808 with SMTP id e132-20020a63698a000000b0036c1d0a2808mr15535425pgc.567.1646020567618; Sun, 27 Feb 2022 19:56:07 -0800 (PST) Received: from nereus.hsd1.or.comcast.net ([2601:1c0:6000:1b20:1961:a694:c80b:3158]) by smtp.gmail.com with ESMTPSA id g5-20020a655805000000b003643e405b56sm8811011pgr.24.2022.02.27.19.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 19:56:07 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: docs@lists.yoctoproject.org Cc: Tim Orling Subject: [PATCH 3/3] docs: update setuptools3 class Date: Sun, 27 Feb 2022 19:55:47 -0800 Message-Id: <20220228035547.1134436-3-tim.orling@konsulko.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220228035547.1134436-1-tim.orling@konsulko.com> References: <20220228035547.1134436-1-tim.orling@konsulko.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 28 Feb 2022 03:56:09 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/2507 Add notes to inform about the new `wheel` behavior of the setuptools3.bbclass. Signed-off-by: Tim Orling --- documentation/ref-manual/classes.rst | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index 2338ef6b3..d216f8843 100644 --- a/documentation/ref-manual/classes.rst +++ b/documentation/ref-manual/classes.rst @@ -2439,8 +2439,23 @@ is installed with the :ref:`pip_install_wheel ` c ======================= The ``setuptools3`` class supports Python version 3.x extensions that -use build systems based on ``setuptools``. If your recipe uses these -build systems, the recipe needs to inherit the ``setuptools3`` class. +use build systems based on ``setuptools`` (e.g. only have a ``setup.py`` and +have not migrated to the official ``pyproject.toml`` format). If your recipe +uses these build systems, the recipe needs to inherit the ``setuptools3`` class. + + .. note:: + + ``setuptools3`` ``do_compile`` now calls `setup.py bdist_wheel` to + build the ``wheel`` binary package format + (See `PEP-427 `__). + A consequence of this is that legacy software still using deprecated + `distutils` from the Python standard library cannot be packaged as + ``wheels`. A common solution is the replace + ``from distutils.core import setup`` with ``from setuptools import setup``. + + ``setuptools3`` ``do_install`` now calls ``pip install`` to install + the ``wheel`` binary package. In current versions of ``setuptools`` the + legacy ``setup.py install`` method is deprecated. .. _ref-classes-setuptools3-base: