-
Notifications
You must be signed in to change notification settings - Fork 1.5k
use python3 on debians too #3812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
in Debian 11 which is Bullseye, /usr/bin/python is a Python2 interpreter, which means that cppcheck-htmlreport fails to run here. So I've chenged the shebang to use python3
|
Thanks for your contribution. How does it fail with Python 2.7? We are currently still targeting Python 2.7 as the minimum version for most of our scripts (something that might change soon) so it should be working. The tests for cppcheck/.github/workflows/scriptcheck.yml Line 117 in 2c79481
|
|
It's an import error actually; debian seems to not ship python-pygments in the standard repositories. Perhaps they stopped shipping it with Bullseye. But of course, they do ship python3-pygments. EDIT: I just checked, Debian stopped shipping python-pygments with Buster, which is oldstable now. This means any new debian installs will not be able to run cppcheck-htmlreport without this change. |
Ugh. Well - you can still install it yourself via pip.
Depending on the alternative set for IIRC there's a patch in the debian packaging which also does this change so if you are using the packaged version it will work. |
|
well we could change the shebang I guess. for most users it would make better sense to use python3. For users that have old unix systems it's possible to run with explicit python, they can execute the script like: |
As seen in the overview at #3596 (comment) Python 3.x is available across even quite old platforms. I really thinking we should get rid of Python 2.7. We are also inconsistent with |
I don't have a very strong opinion right now actually. Python 2.x is probably not entirely dead yet. But even if a user is stuck with python 2.x for some reason, the cppcheck core functionality can still be used without python scripts. |
In that case he could override it with |
That is OK. Use python3 in all the shebangs. People that are stuck with python2 have to override.. |
I've changed all the shebangs that had python to python3 |
So let me adjust the CI first via #3776 first and then we should be able to put this in. |
|
I think we should flag all those |
I would suggest that you use |
|
I need to adjust the docker jobs as well - I already expected such. Will take a look later.
It's definitely better but since we "squash merge" it doesn't matter at all. FYI It makes a big difference in case you utilize reviews since a merge doesn't reset the review status where as a rebase does.. |
|
There's also a ticket about this - https://trac.cppcheck.net/ticket/10274. |
|
Please rebase this after #4004 has been merged. I had to switch to Python 3.x in some of the jobs and made several adjustments which should make these changes work at last. |
|
That PR has been merged. Please rebase. |
|
@omarandlorraine I would like to add you in our AUTHORS file. What name would you like that I add? |
in Debian 11 which is Bullseye, /usr/bin/python is a Python2
interpreter, which means that cppcheck-htmlreport fails to run here.
So I've changed the shebang to use python3
I'm really not sure what the package supplied by Debian themselves does; maybe they have to maintain a diff themselves or something!