Add setuptools*.bbclass changes and distutils deprecation
This series deprecates the 'distutils' bbclasses and variables and documents the replacements based on 'setuptools'.
We intend to move the 'distutils' bbclasses to meta-python, probably during 3.5-M3. An updated series for the docs will be sent at that time.
This series depends on the 'deprecation of distutils' patches for oe-core [1]
PATCH 1/3 ref-manual/variables.rst: add SETUPTOOLS_SETUP_PATH
Add SETUPTOOLS_SETUP_PATH for setuptools3 class.
Deprecate DISTUTILS_SETUP_PATH and drop mention of ref-classes-setuptools3 as that class has moved to new variable.
[YOCTO #14610]
--- documentation/ref-manual/variables.rst | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
documentation/ref-manual/variables.rst +20 -2
@@ -1985,8 +1985,7 @@ system and gives an overview of their function and contents. :term:`DISTUTILS_SETUP_PATH` When used by recipes that inherit the - :ref:`distutils3 <ref-classes-distutils3>` or - :ref:`setuptools3 <ref-classes-setuptools3>` class, this variable should + :ref:`distutils3 <ref-classes-distutils3>` class, this variable should be used to specify the directory in which the ``setup.py`` file is located if it is not at the root of the source tree (as specified by :term:`S`). For example, in a recipe where the sources are fetched from
@@ -1995,6 +1994,13 @@ system and gives an overview of their function and contents. S = "${WORKDIR}/git" DISTUTILS_SETUP_PATH = "${S}/python/pythonmodule" + + .. note:: + + ``distutils`` has been deprecated in Python 3.10 and will be removed + in Python 3.12. For this reason, the use of :ref:`distutils3 <ref-classes-distutils3>` + is deprecated. Instead use :ref:`setuptools3 <ref-classes-setuptools3>` and the + :term:`SETUPTOOLS_SETUP_PATH` variable. :term:`DL_DIR` The central download directory used by the build process to store
@@ -6841,6 +6847,18 @@ system and gives an overview of their function and contents. EXTRA_IMAGE_FEATURES += "read-only-rootfs" + :term:`SETUPTOOLS_SETUP_PATH` + When used by recipes that inherit the + :ref:`setuptools3 <ref-classes-setuptools3>` class, this variable should + be used to specify the directory in which the ``setup.py`` file is + located if it is not at the root of the source tree (as specified by + :term:`S`). For example, in a recipe where the sources are fetched from + a Git repository and ``setup.py`` is in a ``python/pythonmodule`` + subdirectory, you would have this:: + + S = "${WORKDIR}/git" + SETUPTOOLS_SETUP_PATH = "${S}/python/pythonmodule" + :term:`SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS` A list of recipe dependencies that should not be used to determine signatures of tasks from one recipe when they depend on tasks from
Signature · 1 line
2.30.2
PATCH 2/3 ref-manual/variables.rst: add SETUPTOOLS_*_ARGS
In reply to Tim OrlingAdd SETUPTOOLS_BUILD_ARGS variable which can be used to pass additional arguments to setup.py build.
Add SETUPTOOLS_INSTALL_ARGS variable which can be used to pass additional arguments to setup.py install.
[YOCTO #14610]
--- documentation/ref-manual/variables.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
documentation/ref-manual/variables.rst +19 -0
@@ -6847,6 +6847,25 @@ system and gives an overview of their function and contents. EXTRA_IMAGE_FEATURES += "read-only-rootfs" + :term:`SETUPTOOLS_BUILD_ARGS` + When used by recipes that inherit the + :ref:`setuptools3 <ref-classes-setuptools3>` class, this variable can + be used to specify additional arguments to be passed to ``setup.py build`` + in the ``setuptools3_do_compile()`` task. By default, this variable is unset:: + + SETUPTOOLS_BUILD_ARGS ?= "" + + :term:`SETUPTOOLS_INSTALL_ARGS` + When used by recipes that inherit the + :ref:`setuptools3 <ref-classes-setuptools3>` class, this variable can + be used to specify additional arguments to be passed to ``setup.py install`` + in the ``setuptools3_do_install()`` task. By default, this variable is:: + + SETUPTOOLS_INSTALL_ARGS ?= "--root=${D} \ + --prefix=${prefix} \ + --install-lib=${PYTHON_SITEPACKAGES_DIR} \ + --install-data=${datadir}" + :term:`SETUPTOOLS_SETUP_PATH` When used by recipes that inherit the :ref:`setuptools3 <ref-classes-setuptools3>` class, this variable should
Signature · 1 line
2.30.2
Re: [docs] [PATCH 2/3] ref-manual/variables.rst: add SETUPTOOLS_*_ARGS
Hi Tim,
Quoted 30 lines · Tim Orling
Add
SETUPTOOLS_BUILD_ARGSvariable which can be used to pass additional arguments tosetup.py build.Add
SETUPTOOLS_INSTALL_ARGSvariable which can be used to pass additional arguments tosetup.py install.[YOCTO #14610]
Signed-off-by Tim Orling <[email protected]>--- documentation/ref-manual/variables.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)documentation/ref-manual/variables.rst +9
-0@@ -6847,6 +6847,25 @@ system and gives an overview of their function and contents. EXTRA_IMAGE_FEATURES += "read-only-rootfs" + :term:`SETUPTOOLS_BUILD_ARGS` + When used by recipes that inherit the + :ref:`setuptools3 <ref-classes-setuptools3>` class, this variable can + be used to specify additional arguments to be passed to ``setup.py build`` + in the ``setuptools3_do_compile()`` task. By default, this variable is unset:: + + SETUPTOOLS_BUILD_ARGS ?= "" + + :term:`SETUPTOOLS_INSTALL_ARGS`
documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 6868
Quoted 10 lines
documentation/ref-manual/variables.rst +10
-0+ When used by recipes that inherit the + :ref:`setuptools3 <ref-classes-setuptools3>` class, this variable can + be used to specify additional arguments to be passed to ``setup.py install`` + in the ``setuptools3_do_install()`` task. By default, this variable is:: + + SETUPTOOLS_INSTALL_ARGS ?= "--root=${D} \ + --prefix=${prefix} \ + --install-lib=${PYTHON_SITEPACKAGES_DIR} \ + --install-data=${datadir}" +
I don't really like specifying the default values of variables in the docs. The default value can change and the docs will most likely not be kept in sync (as a few recent patches from Michael has shown :) ).
I think the paragraph can stop at "be passed to ``setup.py install``. Or maybe we can add a few words on what someone would typically set this variable to in their recipe if they have to modify it?
Cheers,
Quentin
Quoted 14 lines
documentation/ref-manual/variables.rst +0
-1:term:`SETUPTOOLS_SETUP_PATH` When used by recipes that inherit the :ref:`setuptools3 <ref-classes-setuptools3>` class, this variable should -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group.
View/Reply Online (#2384): https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.yoctoproject.org_g_docs_message_2384&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=8wGMTT7Mjy9XFEK8rx13kzdh8PSQEe7L1DRuSkGS_zIIejVqWrVUWNVNxtQDiQjR&s=Hrn-7ZEdMEgRnmJGvVy19eX7zCYGwQY2oq4Hr0XGhz0&e=
Mute This Topic: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.yoctoproject.org_mt_88357645_6293953&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=8wGMTT7Mjy9XFEK8rx13kzdh8PSQEe7L1DRuSkGS_zIIejVqWrVUWNVNxtQDiQjR&s=KVFe8_QAMfcjQibqPvJqj14YPqUGtIHNOSHR0hmZEZI&e=
Group Owner: [email protected]
Unsubscribe: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.yoctoproject.org_g_docs_unsub&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=8wGMTT7Mjy9XFEK8rx13kzdh8PSQEe7L1DRuSkGS_zIIejVqWrVUWNVNxtQDiQjR&s=a2EqtjY70frDTNQjHZiWadqWOQo6eyBrV7c4oFuIVUI&e= [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [docs] [PATCH 2/3] ref-manual/variables.rst: add SETUPTOOLS_*_ARGS
Quoted 56 lines · Quentin Schulz
Hi Tim,
Quoted 6 lines · Tim Orling
Add
SETUPTOOLS_BUILD_ARGSvariable which can be used to pass additional arguments tosetup.py build.Add
SETUPTOOLS_INSTALL_ARGSvariable which can be used to pass additional arguments tosetup.py install.Review
Quoted 8 lines
[YOCTO #14610]
Signed-off-by Tim Orling <[email protected]>--- documentation/ref-manual/variables.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)(quoted diff) +0
-0
b/documentation/ref-manual/variables.rstdocumentation/ref-manual/variables.rst system and gives an overview of their function
Quoted 4 lines
index
83ccda830..3011c1c83100644documentation/ref-manual/variables.rst +0
-0@@ -6847,6 +6847,25 @@ system and gives an overview of their functionand contents.
documentation/ref-manual/variables.rst system and gives an overview of their function and contents.
Quoted 6 lines
documentation/ref-manual/variables.rst +3
-0EXTRA_IMAGE_FEATURES += "read-only-rootfs" + :term:`SETUPTOOLS_BUILD_ARGS` + When used by recipes that inherit the + :ref:`setuptools3 <ref-classes-setuptools3>` class, this variablecan
documentation/ref-manual/variables.rst system and gives an overview of their function · line 6852
Quoted 1 line
documentation/ref-manual/variables.rst +1
-0+ be used to specify additional arguments to be passed to``setup.py build``
documentation/ref-manual/variables.rst system and gives an overview of their function · line 6853
Quoted 1 line
documentation/ref-manual/variables.rst +1
-0+ in the ``setuptools3_do_compile()`` task. By default, thisvariable is unset::
documentation/ref-manual/variables.rst system and gives an overview of their function and contents.
Quoted 6 lines
documentation/ref-manual/variables.rst +6
-0+ + SETUPTOOLS_BUILD_ARGS ?= "" + + :term:`SETUPTOOLS_INSTALL_ARGS` + When used by recipes that inherit the + :ref:`setuptools3 <ref-classes-setuptools3>` class, this variablecan
documentation/ref-manual/variables.rst system and gives an overview of their function · line 6860
Quoted 1 line
documentation/ref-manual/variables.rst +1
-0+ be used to specify additional arguments to be passed to``setup.py install``
documentation/ref-manual/variables.rst system and gives an overview of their function · line 6861
Quoted 1 line
documentation/ref-manual/variables.rst +1
-0+ in the ``setuptools3_do_install()`` task. By default, thisvariable is::
documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 6868
Quoted 6 lines
documentation/ref-manual/variables.rst +6
-0+ + SETUPTOOLS_INSTALL_ARGS ?= "--root=${D} \ + --prefix=${prefix} \ + --install-lib=${PYTHON_SITEPACKAGES_DIR} \ + --install-data=${datadir}" +I don't really like specifying the default values of variables in the docs. The default value can change and the docs will most likely not be kept in sync (as a few recent patches from Michael has shown :) ).
Quoted 8 lines
Agreed. I didn't like it either ;)
I think the paragraph can stop at "be passed to ``setup.py install``. Or maybe we can add a few words on what someone would typically set this variable to in their recipe if they have to modify it?
Of course the problem is I didn't have any examples other than the default...
Quoted 23 lines
Cheers,
Quentindocumentation/ref-manual/variables.rst system and gives an overview of their function and contents.
Quoted 3 lines
documentation/ref-manual/variables.rst +0
-0:term:`SETUPTOOLS_SETUP_PATH` When used by recipes that inherit the :ref:`setuptools3 <ref-classes-setuptools3>` class, thisvariable should
Quoted 6 lines
documentation/ref-manual/variables.rst +0
-1-=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group. View/Reply Online (#2384):
Quoted 1 line
Mute This Topic:
Quoted 2 lines
Group Owner: [email protected]
Unsubscribe:https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.yoctoproject.org_g_docs_unsub&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=8wGMTT7Mjy9XFEK8rx13kzdh8PSQEe7L1DRuSkGS_zIIejVqWrVUWNVNxtQDiQjR&s=a2EqtjY70frDTNQjHZiWadqWOQo6eyBrV7c4oFuIVUI&e=
[[email protected]]Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-
PATCH 3/3 ref-manual/classes.rst: add setuptools3-base
In reply to Tim OrlingAdd setuptools3-base class
Deprecate distutils3* classes.
[YOCTO #14610]
--- documentation/ref-manual/classes.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
documentation/ref-manual/classes.rst +19 -0
@@ -515,6 +515,14 @@ used. - Extensions that use ``distutils``-based build systems require the ``distutils`` class in their recipes. + .. note:: + + ``distutils`` has been deprecated in Python 3.10 and will be removed + in Python 3.12. For this reason the ``distutils3*`` classes are now + deprecated and will be removed from core in the near future. Instead, + use the ``setuptools3*`` classes. + + - Extensions that use build systems based on ``setuptools3`` require the :ref:`setuptools3 <ref-classes-setuptools3>` class in their recipes.
@@ -2376,6 +2384,17 @@ 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. +.. _ref-classes-setuptools3-base: + +``setuptools3-base.bbclass`` +============================ + +The ``setuptools3-base`` class provides a reusable base for other classes +that support building Python3 version 3.x extensions. If you need +functionality that is not provided by the ``setuptools3`` class, you may +want to ``inherit setuptools3-base``. Some recipes do not need the tasks +in the ``setuptools3`` class and inherit this class instead. + .. _ref-classes-sign_rpm: ``sign_rpm.bbclass``
Signature · 1 line
2.30.2
Re: [docs] [PATCH 3/3] ref-manual/classes.rst: add setuptools3-base
Hi Tim,
Quoted 31 lines · Tim Orling
Add setuptools3-base class
Deprecate distutils3* classes.
[YOCTO #14610]
Signed-off-by Tim Orling <[email protected]>--- documentation/ref-manual/classes.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)documentation/ref-manual/classes.rst +8
-0@@ -515,6 +515,14 @@ used. - Extensions that use ``distutils``-based build systems require the ``distutils`` class in their recipes. + .. note:: + + ``distutils`` has been deprecated in Python 3.10 and will be removed + in Python 3.12. For this reason the ``distutils3*`` classes are now + deprecated and will be removed from core in the near future. Instead, + use the ``setuptools3*`` classes. + + - Extensions that use build systems based on ``setuptools3`` require the :ref:`setuptools3 <ref-classes-setuptools3>` class in their recipes.
documentation/ref-manual/classes.rst The ``setuptools3`` class supports Python version 3.x extensions that · line 2393
Quoted 10 lines
documentation/ref-manual/classes.rst +7
-0@@ -2376,6 +2384,17 @@ 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. +.. _ref-classes-setuptools3-base: + +``setuptools3-base.bbclass`` +============================ + +The ``setuptools3-base`` class provides a reusable base for other classes +that support building Python3 version 3.x extensions. If you need
"Python3 extensions" or "Python 3.x extensions" but I guess not both at the same time? FWIW, setuptools3 uses the latter.
documentation/ref-manual/classes.rst The ``setuptools3`` class supports Python version 3.x extensions that · line 2394
Quoted 1 line
documentation/ref-manual/classes.rst +1
-0+functionality that is not provided by the ``setuptools3`` class, you may
:ref:setuptools3 <ref-classes-setuptools3>
documentation/ref-manual/classes.rst The ``setuptools3`` class supports Python version 3.x extensions that · line 2397
Quoted 3 lines
documentation/ref-manual/classes.rst +3
-0+want to ``inherit setuptools3-base``. Some recipes do not need the tasks +in the ``setuptools3`` class and inherit this class instead. +
:ref:setuptools3 <ref-classes-setuptools3>
Looks good otherwise,
Thanks!
Quentin
Quoted 14 lines
documentation/ref-manual/classes.rst +0
-1.. _ref-classes-sign_rpm: ``sign_rpm.bbclass`` -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group.
View/Reply Online (#2385): https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.yoctoproject.org_g_docs_message_2385&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=h2Sz3gZJqoPsLKIfwNlfXAYFeX7mpQdP2oEhvb2aGweey-2-dybLOh-TQ4wdUyAn&s=M_b1du7dlXE8qFoFbIMq2Rl5WKpnDzSYPdMNNHYarmk&e=
Mute This Topic: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.yoctoproject.org_mt_88357646_6293953&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=h2Sz3gZJqoPsLKIfwNlfXAYFeX7mpQdP2oEhvb2aGweey-2-dybLOh-TQ4wdUyAn&s=-Zmwc8AjGeJ5swQXxOjJeeJ_PhR3Yr1UOFftrABLXys&e=
Group Owner: [email protected]
Unsubscribe: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.yoctoproject.org_g_docs_unsub&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=h2Sz3gZJqoPsLKIfwNlfXAYFeX7mpQdP2oEhvb2aGweey-2-dybLOh-TQ4wdUyAn&s=rOYWLxd9CDFOLemM4UKT_oz3hU5amnFuC7rGylfmQno&e= [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [docs] [PATCH 3/3] ref-manual/classes.rst: add setuptools3-base
Quoted 56 lines · Quentin Schulz
Hi Tim,
Quoted 4 lines · Tim Orling
Add setuptools3-base class
Deprecate distutils3* classes.
Review
Quoted 8 lines
[YOCTO #14610]
Signed-off-by Tim Orling <[email protected]>--- documentation/ref-manual/classes.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)(quoted diff) +0
-0
b/documentation/ref-manual/classes.rstdocumentation/ref-manual/classes.rst used. · line 520
Quoted 10 lines
index
99d9a7a3e..41360c965100644documentation/ref-manual/classes.rst +3
-0@@ -515,6 +515,14 @@ used. - Extensions that use ``distutils``-based build systems require the ``distutils`` class in their recipes. + .. note:: + + ``distutils`` has been deprecated in Python 3.10 and will beremoved
documentation/ref-manual/classes.rst used. · line 521
Quoted 1 line
documentation/ref-manual/classes.rst +1
-0+ in Python 3.12. For this reason the ``distutils3*`` classes arenow
documentation/ref-manual/classes.rst used. · line 522
Quoted 1 line
documentation/ref-manual/classes.rst +1
-0+ deprecated and will be removed from core in the near future.Instead,
documentation/ref-manual/classes.rst The ``setuptools3`` class supports Python version
Quoted 7 lines
documentation/ref-manual/classes.rst +3
-0+ use the ``setuptools3*`` classes. + + - Extensions that use build systems based on ``setuptools3`` require the :ref:`setuptools3 <ref-classes-setuptools3>` class in their recipes.@@ -2376,6 +2384,17 @@ The ``setuptools3`` class supports Python version3.x extensions that
documentation/ref-manual/classes.rst The ``setuptools3`` class supports Python version 3.x extensions that
Quoted 9 lines
documentation/ref-manual/classes.rst +6
-0use build systems based on ``setuptools``. If your recipe uses these build systems, the recipe needs to inherit the ``setuptools3`` class. +.. _ref-classes-setuptools3-base: + +``setuptools3-base.bbclass`` +============================ + +The ``setuptools3-base`` class provides a reusable base for otherclasses
documentation/ref-manual/classes.rst The ``setuptools3`` class supports Python version 3.x extensions that · line 2393
Quoted 1 line
documentation/ref-manual/classes.rst +1
-0+that support building Python3 version 3.x extensions. If you need"Python3 extensions" or "Python 3.x extensions" but I guess not both at the same time? FWIW, setuptools3 uses the latter.
documentation/ref-manual/classes.rst The ``setuptools3`` class supports Python version 3.x extensions that · line 2394
Quoted 1 line
documentation/ref-manual/classes.rst +1
-0+functionality that is not provided by the ``setuptools3`` class, you may
Quoted 9 lines
:ref:
setuptools3 <ref-classes-setuptools3>documentation/ref-manual/classes.rst The ``setuptools3`` class supports Python version 3.x extensions that · line 2397
Quoted 3 lines
documentation/ref-manual/classes.rst +3
-0+want to ``inherit setuptools3-base``. Some recipes do not need the tasks +in the ``setuptools3`` class and inherit this class instead. +:ref:
setuptools3 <ref-classes-setuptools3>
Good catch. Thank you for the second set of eyes on this.
Quoted 24 lines
Looks good otherwise,
Thanks!Quentin
Quoted 9 lines
documentation/ref-manual/classes.rst +0
-1.. _ref-classes-sign_rpm: ``sign_rpm.bbclass`` -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group. View/Reply Online (#2385):
Quoted 1 line
Mute This Topic:
Quoted 2 lines
Group Owner: [email protected]
Unsubscribe:https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.yoctoproject.org_g_docs_unsub&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=h2Sz3gZJqoPsLKIfwNlfXAYFeX7mpQdP2oEhvb2aGweey-2-dybLOh-TQ4wdUyAn&s=rOYWLxd9CDFOLemM4UKT_oz3hU5amnFuC7rGylfmQno&e=
[[email protected]]Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-