Re: [PATCH v2 00/12] Python: Fix 'make check-dev' and modernize to 3.9+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2025/06/13 5:54, John Snow wrote:
This series does a couple things that I'll probably end up splitting out
into smaller series if history is any guide, but either way, here it
goes:

I'm surprised with the large number of Ccs. I suggest splitting the series with subsystem boundaries to reduce the number of Ccs for each split series.


A) Convert qemu.git/python/ to a PEP517/pyproject.toml
package. Ultimately this means deleting setup.py and fully migrating to
newer python infrastructure. I think this should be safe to do by now,
but admittedly I am not *confident* as it relies on setuptools versions
in the wild, not python versions. My motivation for trying it is to fix
"make check-dev", which has been broken for the last two Fedora releases
under newer setuptools which have started removing support for the
pre-PEP517 packaging formats, which will only continue to get worse from
here on out.

I'm afraid this change may not be safe.

The documentation of setuptools says pyproject.toml is supported since 61.0.0:
https://setuptools.pypa.io/en/stable/userguide/pyproject_config.html

Looking at Repology as suggested in docs/about/build-platforms.rst, the following distributions have older setuptools, unfortunately:
CentOS Stream 9: 53.0.0
Debian 11: 44.1.1
Ubuntu 22.04: 44.1.1

docs/about/build-platforms.rst also says:
> Optional build dependencies
>   Build components whose absence does not affect the ability to build
>   QEMU may not be available in distros, or may be too old for our
>   requirements. Many of these, such as additional modules for the
>   functional testing framework or various linters, are written in
>   Python and therefore can also be installed using ``pip``.

In my understanding, QEMU Python Tooling is an optional component so dropping the support of old Linux distribution is tolerated according to the documentation. But I think we still need to assess the potential impact on the usability to justify that.

A possible option is to fetch a new version of setuptools version when necessary. The same documentation says:
> Python build dependencies
>   Some of QEMU's build dependencies are written in Python.  Usually
>   these are only packaged by distributions for the default Python
>   runtime.
>   If QEMU bumps its minimum Python version and a non-default runtime
>   is required, it may be necessary to fetch python modules from the
>   Python Package Index (PyPI) via ``pip``, in order to build QEMU.

Automatically fetching a compatible version of setuptools as described here will reduce the adverse effect of the change.

The documentation page of setuptools I mentioned earlier has the following note:
> If compatibility with legacy builds or versions of tools that don’t
> support certain packaging standards (e.g. PEP 517 or PEP 660), a
> simple setup.py script can be added to your project [1] (while keeping
> the configuration in pyproject.toml):
>
> from setuptools import setup
>
> setup()

I have no idea what it means though. (Will it automatically fetch new setuptools to parse pyproject.toml or something?)

C) Move us to 3.9+ style type hints. They are deprecated in 3.9, and
*could* be removed at any time. I figured now was a good time as any to
get rid of them before they become a problem randomly some day in the
future.

I guess you meant that the old style type hints are deprecated.

Regards,
Akihiko Odaki




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux