cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

drop python<=3.7 support

Open kloczek opened this issue 1 year ago • 9 comments

Accordint to https://endoflife.date/python python 3.7 as been EOSed 27 Jun 2023. Fileter all python code over `pupgrade --py38-plus'.

kloczek avatar May 29 '24 00:05 kloczek

Thanks for your contribution.

We are intentionally supporting those EOL Python versions. The oldest platform we are targeting is Ubuntu 16.04 and that comes with Python 3.5.

But there are some modernization in these changes which could be applied as they are supported by that version. Also there are some changes I do not like in general which I will comment on separately.

firewave avatar May 29 '24 07:05 firewave

An additional note - the CI passes because we are not testing all the parts on those older platform. That was done in the scriptcheck.yml workflow but as those versions no longer work when freshly installed as non-distro supported versions we had to disable it. That needs to be re-added in a different way to the docker-based jobs but I didn't get around to it yet.

firewave avatar May 29 '24 07:05 firewave

See #3596 about properly fixating, testing and documenting the targeted platforms.

firewave avatar May 29 '24 07:05 firewave

We are intentionally supporting those EOL Python versions. The oldest platform we are targeting is Ubuntu 16.04 and that comes with Python 3.5.

Using latest cppcheck on so old version does not make to much sense. Isn't it? 🤔 Last cppcheck supported by 16.04 is 1.72. https://launchpad.net/ubuntu/xenial/+package/cppcheck Update policy for that version says only about fixing only critical/security bugs. Update to latest 2.x could not fit in such criteria.

kloczek avatar May 29 '24 09:05 kloczek

Using latest cppcheck on so old version does not make to much sense. Isn't it? 🤔 Last cppcheck supported by 16.04 is 1.72. https://launchpad.net/ubuntu/xenial/+package/cppcheck

That is exactly why we need to support it, because people have to do their own build to get the latest version.

This could also be mitigated by offering something like an up-to-date (and especially official) Snapcraft package but that is not available on all distros.

firewave avatar May 29 '24 09:05 firewave

What is pupgrade? Did you mean https://github.com/asottile/pyupgrade?

Also we still support Python 2.7. But that will be removed in 2.16 so we cannot make any changes until then.

firewave avatar May 29 '24 09:05 firewave

What is pupgrade? Did you mean https://github.com/asottile/pyupgrade?

Yes .. typo.

Also we still support Python 2.7. But that will be removed in 2.16 so we cannot make any changes until then.

AFAIK there is no even single still supported distro which still uses python 2.7. Python 2.7 has been EOSed in 2020 (in few days will be 4 years ago).

kloczek avatar May 29 '24 09:05 kloczek

AFAIK there is no even single still supported distro which still uses python 2.7. Python 2.7 has been EOSed in 2020 (in few days will be 4 years ago).

We still had CentOS 7 support a while ago. And we are very few people some things might not be taken care of so Python 2.7 wasn't deprecated until recently.

I think most of these changes can also be detected by pylint. We have that disabled in the CI but I will try to enable it again.

firewave avatar May 29 '24 11:05 firewave

Please check which one version of the cppcheck is in CentOS 7. If it would be any critical issue probably it will be resolved by apply some patch instead upgrade to latest version.

kloczek avatar May 29 '24 15:05 kloczek