This was removed downstream-only to give impacted packages more time.
However, we actually want the warning,
so packagers learn pkg_resources is deprecated.
No remaining Fedora 40 package fails to build because of this warning.
Before:
/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer, pypa/build or
other standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
After:
/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer, pypa/build or
other standards-based tools.
Follow the current Python packaging guidelines when building
Python RPM packages.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html
and https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/ for details.
********************************************************************************
!!
The generators only need packaging and packaging only needs flit.core.
We can now build:
0. python-rpm-macros bumped to 3.N
1. python3.N --with bootstrap ...
2. python-flit --with bootstrap
3. python-packaging --with bootstrap
4. python-setuptools --with bootstrap (already using the generators at this point)
5. ...
The setup.py install command tries to import distutils
but the distutils-precedence.pth file is not yet respected
and Python 3.12+ no longer has distutils in the standard library.
The error was:
Executing(%install): ...
...
+ /usr/bin/python3 setup.py install -O1 --skip-build --root /builddir/build/BUILDROOT/python-setuptools-65.5.1-3.fc39~bootstrap.x86_64 --prefix /usr
running install
...
writing byte-compilation script '/tmp/tmpuud06dfj.py'
/usr/bin/python3 /tmp/tmpuud06dfj.py
Traceback (most recent call last):
File "/tmp/tmpuud06dfj.py", line 1, in <module>
from distutils.util import byte_compile
ModuleNotFoundError: No module named 'distutils'
error: command '/usr/bin/python3' failed with exit code 1
The initial build for new Python version does not yet have the script available.
Multiple input files for the script are supported since Fedora 35,
but we keep the versioned BuildRequires for RHEL's sake.
The $PWD makes no sense --without bootstrap and the script should not even import pkg_resources,
see https://src.fedoraproject.org/rpms/python-rpm-generators/pull-request/59
It is obvious to me now that this is not going to be removed,
but will be reused for RHEL 10, 11, etc.
The new %bcond syntax is nicer.
Some checks can run even --without tests, do it.
The `du` tool estimates disk usage, so filesystem settings
(block size, compression, holes, etc.) might change the result.
Use `stat` instead for a more reproducible result.
Note that I've changed 900 (KiB) to 900000 (bytes) which is in fact not correct
(900 KiB is 921600 bytes),
but I assumed a human-readable round number works better here.
I've updated the comment to say kB instead of KiB.
Fixes https://bugzilla.redhat.com/2143393