Skip to content

deprecation of distutils

Tim Orling openembedded-core 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest22 patches 2 repliesIn review
  2. v1 RFC26 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- dropped the import of distutils.version into bb. in favor of bb.utils.vercmp_string_op()
- dropped some patches that have been addressed already
- update email
- fix typos
- drop already merged scripts/buildhistory-diff patch
The following changes since commit 16110cdca7211b0efc59464afbb253527c033cad:

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22classes/distutils-*: add warning of deprecationmeta/classes/distutils-common-base.bbclass meta/classes/distutils3-base.bbclass meta/classes/distutils3.bbclass+10 -00 replies
2/22setuptools3: refactor for no distutils bbclassesmeta/classes/setuptools3-base.bbclass meta/classes/setuptools3.bbclass+96 -10 replies
3/22python3-cython: DISTUTILS_* -> SETUPTOOLS_*meta/recipes-devtools/python/python3-cython_0.29.26.bb+1 -10 replies
4/22dnf: inherit setuptools3-base instead of distutilsmeta/recipes-devtools/dnf/dnf_4.10.0.bb+1 -10 replies
5/22libdnf: inherit setuptools3-base not distutilsmeta/recipes-devtools/libdnf/libdnf_0.65.0.bb+1 -10 replies
6/22python3-dbus: inherit setuptools3-base not distuilsmeta/recipes-devtools/python/python3-dbus_1.2.18.bb+1 -10 replies
7/22gpgme: inherit setuptools-base not distuilsmeta/recipes-support/gpgme/gpgme_1.16.0.bb+1 -10 replies
8/22python3-pip: inherit setuptools3 not distuils3meta/recipes-devtools/python/python3-pip_21.3.1.bb+1 -10 replies
9/22systemtap: use setuptools-base not distutilsmeta/recipes-kernel/systemtap/systemtap_git.bb+1 -10 replies
10/22libcomps: inherit setuptools3-base not distutilsmeta/recipes-devtools/libcomps/libcomps_0.1.18.bb+1 -10 replies
11/22createrepo-c: inherit setuptools3-base not distutilsmeta/recipes-devtools/createrepo-c/createrepo-c_0.18.0.bb+1 -10 replies
12/22librepo: inherit setuptools3-base not distutilsmeta/recipes-devtools/librepo/librepo_1.14.2.bb+1 -10 replies
13/22btrfs-tools: use setuptools3-base not distutilsmeta/recipes-devtools/btrfs-tools/btrfs-tools_5.15.1.bb+1 -10 replies
14/22python3-pygobject: setuptools instead of distuilsmeta/recipes-devtools/python/python3-pygobject_3.42.0.bb+1 -10 replies
15/22bind: inherit setuptools3-base instead of distutilsmeta/recipes-connectivity/bind/bind_9.16.24.bb+1 -10 replies
16/22python3-setuptools: do not depend on distutilsmeta/recipes-devtools/python/python3-setuptools_59.5.0.bb+0 -10 replies
17/22gstreamer1.0-python: inherit setuptools3-basemeta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.18.5.bb+1 -10 replies
18/22recipetool/create_buildsys_python.py: less distutilsscripts/lib/recipetool/create_buildsys_python.py+6 -20 replies
19/22waf.bbclass: drop usage of distutilsmeta/classes/waf.bbclass+1 -20 replies
20/22dnf: drop python3-distutils dependencymeta/recipes-devtools/dnf/dnf_4.10.0.bb+0 -10 replies
21/22python3native.bbclass: distutils -> sysconfigmeta/classes/python3native.bbclass+1 -10 replies
22/22rootfs_rpm.bbclass: distutils -> sysconfig modulemeta/classes/rootfs_rpm.bbclass+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/22] deprecation of distutils

distutils is deprecated in Python 3.10 and will be removed in Python 3.12 (~October 2023).

This series inserts a deprecation warning into the distutils*.bbclasses and drops or replaces distutils usage wherever possible.

Instead of distutils3-base, we introduce setuptools3-base, which also incorporates distutils-common-base.

Remaining usage is in:
* lib/recipetool/create_buildsys_python.py until we are ready to factor it out (and add pyproject.toml and setup.cfg handling)
* oeqa selftests which are testing distutils3 functionality
* glib-2.0: upstream is still using distutils.version.LooseVersion
* gpgme: Still checks for distutils in m4/ax_python_devel.m4
* python3-numpy: upstream still has a distutils/ module
* python3-setuptools has a vendored _distutils

I might have missed something else.

No attempt has been made to look at layers outside of oe-core.

The intent is to let this percolate for a few weeks and then drop distutils*.bbclasses (and move them to meta-python, but with the warnings).

[YOCTO #14610]

Changes in v2:
- dropped the import of distutils.version into bb. in favor of bb.utils.vercmp_string_op()
- dropped some patches that have been addressed already
- update email
- fix typos
- drop already merged scripts/buildhistory-diff patch
The following changes since commit 16110cdca7211b0efc59464afbb253527c033cad:

oeqa/sstate: Fix allarch samesigs test (2022-01-11 15:48:11 +0000)

are available in the Git repository at:

git://git.yoctoproject.org/git/poky-contrib timo/deprecate_distutils_14610_v2
http://git.yoctoproject.org/cgit.cgi/git/poky-contrib/log/?h=timo/deprecate_distutils_14610_v2

Tim Orling (22):
classes/distutils-*: add warning of deprecation
setuptools3: refactor for no distutils bbclasses
python3-cython: DISTUTILS_* -> SETUPTOOLS_*
dnf: inherit setuptools3-base instead of distutils
libdnf: inherit setuptools3-base not distutils
python3-dbus: inherit setuptools3-base not distuils
gpgme: inherit setuptools-base not distuils
python3-pip: inherit setuptools3 not distuils3
systemtap: use setuptools-base not distutils
libcomps: inherit setuptools3-base not distutils
createrepo-c: inherit setuptools3-base not distutils
librepo: inherit setuptools3-base not distutils
btrfs-tools: use setuptools3-base not distutils
python3-pygobject: setuptools instead of distuils
bind: inherit setuptools3-base instead of distutils
python3-setuptools: do not depend on distutils gstreamer1.0-python: inherit setuptools3-base recipetool/create_buildsys_python.py: less distutils waf.bbclass: drop usage of distutils
dnf: drop python3-distutils dependency python3native.bbclass: distutils -> sysconfig rootfs_rpm.bbclass: distutils -> sysconfig module

 meta/classes/distutils-common-base.bbclass    |  3 +
 meta/classes/distutils3-base.bbclass          |  3 +
 meta/classes/distutils3.bbclass               |  4 ++
 meta/classes/python3native.bbclass            |  2 +-
 meta/classes/rootfs_rpm.bbclass               |  2 +-
 meta/classes/setuptools3-base.bbclass         | 31 +++++++++
 meta/classes/setuptools3.bbclass              | 66 ++++++++++++++++++-
 meta/classes/waf.bbclass                      |  3 +-
 .../recipes-connectivity/bind/bind_9.16.24.bb |  2 +-
 .../btrfs-tools/btrfs-tools_5.15.1.bb         |  2 +-
 .../createrepo-c/createrepo-c_0.18.0.bb       |  2 +-
 meta/recipes-devtools/dnf/dnf_4.10.0.bb       |  3 +-
 .../libcomps/libcomps_0.1.18.bb               |  2 +-
 meta/recipes-devtools/libdnf/libdnf_0.65.0.bb |  2 +-
 .../librepo/librepo_1.14.2.bb                 |  2 +-
 .../python/python3-cython_0.29.26.bb          |  2 +-
 .../python/python3-dbus_1.2.18.bb             |  2 +-
 .../python/python3-pip_21.3.1.bb              |  2 +-
 .../python/python3-pygobject_3.42.0.bb        |  2 +-
 .../python/python3-setuptools_59.5.0.bb       |  1 -
 .../recipes-kernel/systemtap/systemtap_git.bb |  2 +-
 .../gstreamer/gstreamer1.0-python_1.18.5.bb   |  2 +-
 meta/recipes-support/gpgme/gpgme_1.16.0.bb    |  2 +-
 .../lib/recipetool/create_buildsys_python.py  |  8 ++-
 24 files changed, 129 insertions(+), 23 deletions(-)
 create mode 100644 meta/classes/setuptools3-base.bbclass
Signature · 1 line
2.30.2