Skip to content

With Python >= 3.12, dependency on python-setuptools is missing

Description:

Python >=3.12 does not ship distutils anymore. As such, this package needs a dependency on setuptools or something else that provides distutils:

$ grep distutils /usr/lib/python3.12/site-packages/tensorflow/__init__.py
import distutils as _distutils
if "sysconfig" in dir(_distutils):
  _site_packages_dirs += [_distutils.sysconfig.get_python_lib()]

This causes build failures of dependent packages (e.g. python-etils) when building in clean chroot:

==> Starting check()...
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.1.2, pluggy-1.4.0
rootdir: /build/python-etils/src/etils-1.8.0
configfile: pyproject.toml
plugins: subtests-0.12.1
collected 220 items / 7 errors

==================================== ERRORS ====================================
________________ ERROR collecting etils/enp/array_spec_test.py _________________
ImportError while importing test module '/build/python-etils/src/etils-1.8.0/etils/enp/array_spec_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
etils/enp/array_spec_test.py:24: in <module>
    import tensorflow as tf
/usr/lib/python3.12/site-packages/tensorflow/__init__.py:30: in <module>
    import distutils as _distutils
E   ModuleNotFoundError: No module named 'distutils'

Additional info:

  • package version(s): python-tensorflow-opt-cuda 2.16.1-2
  • config and/or log files: N/A
  • link to upstream bug report, if any: N/A

Steps to reproduce:

  1. Build python-etils in a clean chroot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information