Bug 1737972 - cppcheck depends on Python 2
Summary: cppcheck depends on Python 2
Alias: None
Product: Fedora
Classification: Fedora
Component: cppcheck
Version: 31
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Susi Lehtola
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: F31_PY2REMOVAL
TreeView+ depends on / blocked
Reported: 2019-08-06 12:10 UTC by Lumír Balhar
Modified: 2019-08-22 06:29 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-08-22 06:29:20 UTC
Type: Bug

Attachments (Terms of Use)

Description Lumír Balhar 2019-08-06 12:10:58 UTC
Python 2.7 will reach end-of-life in January 2020, over 9 years after it was released. This falls within the Fedora 31 lifetime.
Packages that depend on Python 2 are being switched to Python 3 or removed from Fedora: https://fedoraproject.org/wiki/Changes/F31_Mass_Python_2_Package_Removal#Information_on_Remaining_Packages
Python 2 will be retired in Fedora 32: https://fedoraproject.org/wiki/Changes/RetirePython2

To help planning, we'd like to know the plans for cppcheck's future. Specifically:

- What is the reason for the Python2 dependency? (Is it software written in Python, or does it just provide Python bindings, or use Python in the build system or test runner?) 

- What are the upstream/community plans/timelines regarding Python 3?

- What is the guidance for porting to Python 3? (Assuming that there is someone who generally knows how to port to Python 3, but doesn't know anything about the particular package, what are the next steps to take?)

This bug is filed semi-automatically, and might not have all the context specific to cppcheck.
If you need anything from us, or something is unclear, please mention it here.

Thank you.

Comment 1 Susi Lehtola 2019-08-06 18:16:30 UTC
sgrubb: the explicit Python2 dependence was added by you, but there's no description in the spec why. Could you fix this?

Comment 2 Steve Grubb 2019-08-06 18:49:20 UTC
OK. Note added. FTR, htmlreport README.txt says it's written in python 2.7. The rpm macros for the build system enforces a rule that you cannot have env python as that makes migration to python 3 problematic. It emits the following error message at the end of the build:

*** ERROR: ambiguous python shebang in /usr/bin/cppcheck-htmlreport: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.

Comment 3 Ben Cotton 2019-08-13 16:50:39 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 4 Ben Cotton 2019-08-13 17:35:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 5 Lumír Balhar 2019-08-14 07:46:30 UTC
It seems that the htmlreport utility should be Python 3 compatible so it should be enough to just use sed to change the shebang line to Python 3 as suggested in the error message.

Comment 6 Susi Lehtola 2019-08-14 09:05:46 UTC
Indeed, it appears that the fix is as simple as switching to python3.

Comment 7 Petr Viktorin (pviktori) 2019-08-14 11:21:28 UTC
Thank you!

Comment 8 Lumír Balhar 2019-08-16 08:03:04 UTC
Could you please do one more build in rawhide? Right now it's strange that

cppcheck-htmlreport-1.88-4.fc32.x86_64.rpm depends on Python 3 but
cppcheck-htmlreport-1.88-4.fc31.x86_64.rpm still depends on Python 2.


Comment 9 Lumír Balhar 2019-08-22 06:29:20 UTC
cppcheck-htmlreport-1.88-5.fc32 does not depend on Python 2. Thank you!

Note You need to log in before you can comment on or make changes to this bug.