qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 6/7] CI: Stop building docs on centos8


From: Markus Armbruster
Subject: Re: [PATCH v2 6/7] CI: Stop building docs on centos8
Date: Thu, 16 Feb 2023 02:46:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Tue, Feb 14, 2023 at 09:52:44PM +0100, Paolo Bonzini wrote:
>> Il mar 14 feb 2023, 18:26 Kevin Wolf <kwolf@redhat.com> ha scritto:
>> 
>> > Am 14.02.2023 um 15:03 hat Paolo Bonzini geschrieben:
>> > > In the case of Python the issue is not the interpreter per se, though
>> > > there are a couple new feature in Python 3.7 that are quite nice (for
>> > > example improved data classes[1] or context variables[2]). The main
>> > > problem as far as I understood (and have seen in my experience) is
>> > > linting tools. New versions fix bugs that caused false positives, but
>> > > also become more strict at the same time. The newer versions at the
>> > > same time are very quick at dropping support for old versions of
>> > > Python; while older versions sometimes throw deprecation warnings on
>> > > new versions of Python. This makes it very hard to support a single
>> > > version of, say, mypy that works on all versions from RHEL8 and SLE15
>> > > to Fedora 38 and Ubuntu 23.04.
>> >
>> > Why do we have to support a single version of mypy? What is wrong with
>> > running an old mypy version with old Python version, and a newer mypy
>> > with newer Python versions?
>> >
>> > Sure, they will complain about different things, but it doesn't feel
>> > that different from supporting multiple C compilers in various versions.
>> >
>> 
>> It's more like having to support only C++03 on RHEL 8 and only C++20 in
>> Fedora 37, without even being able to use a preprocessor.
>> 
>> For example old versions might not understand some type annotations and
>> will fail mypy altogether, therefore even with newer versions you can't
>> annotate the whole source and have to fall back to non-strict mode.
>
> In terms of back compatibility, is there a distinction to be
> made between mypy compat and the python runtime compat ?
>
> If we add annotations wanted by new mypy, and old mypy doesn't
> understand them, that's not a huge problem. We can simply declare
> that we don't support old mypy, and skip the validation tests if
> old mypy is installed.

In theory, type hints are transparent at run time.  In practice, use of
modern type hints is known to break 3.6 at run time.  I don't remember
the details offhand, but John should be able to dig them up if you're
interested.

So, it should not be a problem, but it is.

Checking types only with sufficiently new mypy still makes sense
regardless.

>                        The mypy results are targetted at upstream
> maintainers primarily, not people consuming QEMU, unless they are
> backporting huge amounts of code and need to validate it. IOW it
> should be sufficient to test once with an arbitrary version of
> mypy of our choosing.
>
> If we add annotations wanted by new mypy, and old python runtime
> barfs, then that's a significant problem, which would require us
> to either bump the min python or avoid the new mypy annotations.

Yup.

Avoiding new mypy leaves us with underpowered type checking.

If dropping 3.6 had serious drawbacks, then we'd have to weigh type
checking improvements against them.  However, the only drawback we can
see is "CentOS 8 provides no suitable Sphinx", which we can either
accept or mitigate, I think.

> The same could be asked for the other linting tools we use like
> pylint / flake8. Is it sufficient to declare a min versions for
> those tools and skip the tests if not satisfied, while still
> retaining ability to execute the code on 3.6 ?

Yes, let's try to narrow the version range for linting tools.

> Or are there some core python runtime features we also want to
> take advantage of at the same time ?

Those are gravy.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]