Message ID | 20210915194839.22122-4-petr.vorel@gmail.com |
---|---|
State | Rejected |
Headers | show |
Series | use python3 explicitly | expand |
On 15/09/2021 21:48, Petr Vorel wrote: > + remove python2 compatibility imports > > library is used by support/scripts/pkg-stats and utils/get-developers > which both use python3. Although library does not require shebang, > it's better to state python3 use. Do you have some supporting evidence of this claim "it's better to add a shebang"? Looking at a few random projects with python files, I see none that do it. And it seems like a lot of noise to add this for no obvious gain. If it's about documenting the minimum python version, it's not even correct: some of these scripts will require python3.4 or python3.5 and that's not documented... Regards, Arnout > > Tested with python3 -m py_compile. > > Signed-off-by: Petr Vorel <petr.vorel@gmail.com> > --- > New in v2 > > utils/getdeveloperlib.py | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/utils/getdeveloperlib.py b/utils/getdeveloperlib.py > index ce822320f8..74a3a420ee 100644 > --- a/utils/getdeveloperlib.py > +++ b/utils/getdeveloperlib.py > @@ -1,4 +1,5 @@ > -from __future__ import print_function > +#!/usr/bin/env python3 > + > from io import open > import os > import re >
Hi Arnout, > On 15/09/2021 21:48, Petr Vorel wrote: > > + remove python2 compatibility imports > > library is used by support/scripts/pkg-stats and utils/get-developers > > which both use python3. Although library does not require shebang, > > it's better to state python3 use. > Do you have some supporting evidence of this claim "it's better to add a shebang"? No. > Looking at a few random projects with python files, I see none that do it. I'm sorry, I was obviously wrong. > And it seems like a lot of noise to add this for no obvious gain. If it's about > documenting the minimum python version, it's not even correct: some of these > scripts will require python3.4 or python3.5 and that's not documented... Agree => setting this commit and the 4th commit in patchwork as Rejected. Thanks a lot for your input. Kind regards, Petr > Regards, > Arnout
diff --git a/utils/getdeveloperlib.py b/utils/getdeveloperlib.py index ce822320f8..74a3a420ee 100644 --- a/utils/getdeveloperlib.py +++ b/utils/getdeveloperlib.py @@ -1,4 +1,5 @@ -from __future__ import print_function +#!/usr/bin/env python3 + from io import open import os import re
+ remove python2 compatibility imports library is used by support/scripts/pkg-stats and utils/get-developers which both use python3. Although library does not require shebang, it's better to state python3 use. Tested with python3 -m py_compile. Signed-off-by: Petr Vorel <petr.vorel@gmail.com> --- New in v2 utils/getdeveloperlib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)