Skip to contentSkip to conversation

scripts: switch some more scripts explicitly to Python 3

PATCH Superseded Masahiro Yamada 4 participants 5 messages Feb 1, 2021 – Feb 2, 2021

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: switch some more scripts explicitly to Python 3

For the same reason as commit 51839e29cb59 ("scripts: switch explicitly to Python 3"), switch some more scripts, which I tested and confirmed working on Python 3.

---

 scripts/clang-tools/gen_compile_commands.py | 2 +-
 scripts/clang-tools/run-clang-tools.py      | 2 +-
 scripts/spdxcheck.py                        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
scripts/clang-tools/gen_compile_commands.py +1 -1
index 19963708bcf8..8ddb5d099029 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) Google LLC, 2018
scripts/clang-tools/run-clang-tools.py +1 -1
index fa7655c7cec0..f754415af398 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) Google LLC, 2020
scripts/spdxcheck.py +1 -1
index bc87200f9c7c..cbdb5c83c08f 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 # Copyright Thomas Gleixner <[email protected]>
 
Signature · 1 line
2.27.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Masahiro Yamada

For the same reason as commit 51839e29cb59 ("scripts: switch explicitly to Python 3"), switch some more scripts, which I tested and confirmed working on Python 3.

Quoted 40 lines

---

 scripts/clang-tools/gen_compile_commands.py | 2 +-
 scripts/clang-tools/run-clang-tools.py      | 2 +-
 scripts/spdxcheck.py                        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
scripts/clang-tools/gen_compile_commands.py +1 -1
index 19963708bcf8..8ddb5d099029 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) Google LLC, 2018
scripts/clang-tools/run-clang-tools.py +1 -1
index fa7655c7cec0..f754415af398 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) Google LLC, 2020
scripts/spdxcheck.py +1 -1
index bc87200f9c7c..cbdb5c83c08f 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 # Copyright Thomas Gleixner <[email protected]>
 
Signature · 1 line
2.27.0
#2 lore raw
In reply to Masahiro Yamada
Quoted 6 lines · Masahiro Yamada

For the same reason as commit 51839e29cb59 ("scripts: switch explicitly to Python 3"), switch some more scripts, which I tested and confirmed working on Python 3.

Thanks for the patch. It's time to move on from Python 2.

It looks like there's already a patch in -next for scripts/spdxcheck.py. ("spdxcheck.py: Use Python 3") by Bert Vermeulen.
https://lore.kernel.org/r/[email protected]

What about:
scripts/tracing/draw_functrace.py
scripts/show_delta
scripts/jobserver-exec

Or do those need additional source level changes?

Quoted 40 lines

---

 scripts/clang-tools/gen_compile_commands.py | 2 +-
 scripts/clang-tools/run-clang-tools.py      | 2 +-
 scripts/spdxcheck.py                        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
scripts/clang-tools/gen_compile_commands.py +1 -1
index 19963708bcf8..8ddb5d099029 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) Google LLC, 2018
scripts/clang-tools/run-clang-tools.py +1 -1
index fa7655c7cec0..f754415af398 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) Google LLC, 2020
scripts/spdxcheck.py +1 -2
index bc87200f9c7c..cbdb5c83c08f 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 # Copyright Thomas Gleixner <[email protected]>
 
--

2.27.0

Signature · 2 lines
Thanks,
~Nick Desaulniers
#3 lore raw
Quoted 7 lines · Nick Desaulniers
Quoted 5 lines · Masahiro Yamada

For the same reason as commit 51839e29cb59 ("scripts: switch explicitly to Python 3"), switch some more scripts, which I tested and confirmed working on Python 3.

Quoted 7 lines
Quoted 1 line

Thanks for the patch. It's time to move on from Python 2.

It looks like there's already a patch in -next for scripts/spdxcheck.py. ("spdxcheck.py: Use Python 3") by Bert Vermeulen.
https://lore.kernel.org/r/[email protected]

OK, I dropped the spdxcheck.py change in v2.

Quoted 6 lines

What about:
scripts/tracing/draw_functrace.py
scripts/show_delta
scripts/jobserver-exec

Or do those need additional source level changes?

I touched jobserver-exec in this patch:

https://patchwork.kernel.org/project/linux-kbuild/patch/[email protected]/

I have not tested draw_functrac.py or show_delta.

Quoted 45 lines
Quoted 38 lines

---

 scripts/clang-tools/gen_compile_commands.py | 2 +-
 scripts/clang-tools/run-clang-tools.py      | 2 +-
 scripts/spdxcheck.py                        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
scripts/clang-tools/gen_compile_commands.py +1 -1
index 19963708bcf8..8ddb5d099029 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) Google LLC, 2018
scripts/clang-tools/run-clang-tools.py +1 -1
index fa7655c7cec0..f754415af398 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) Google LLC, 2020
scripts/spdxcheck.py +1 -2
index bc87200f9c7c..cbdb5c83c08f 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 # Copyright Thomas Gleixner <[email protected]>
 
--
Quoted 2 lines

2.27.0

--
Thanks,
~Nick Desaulniers

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw
Quoted 29 lines · Masahiro Yamada
Quoted 7 lines · Nick Desaulniers
Quoted 5 lines · Masahiro Yamada

For the same reason as commit 51839e29cb59 ("scripts: switch explicitly to Python 3"), switch some more scripts, which I tested and confirmed working on Python 3.

Quoted 7 lines
Quoted 1 line

Thanks for the patch. It's time to move on from Python 2.

It looks like there's already a patch in -next for scripts/spdxcheck.py. ("spdxcheck.py: Use Python 3") by Bert Vermeulen.
https://lore.kernel.org/r/[email protected]

OK, I dropped the spdxcheck.py change in v2.

Quoted 6 lines

What about:
scripts/tracing/draw_functrace.py
scripts/show_delta
scripts/jobserver-exec

Or do those need additional source level changes?

Quoted 7 lines

I touched jobserver-exec in this patch:

https://patchwork.kernel.org/project/linux-kbuild/patch/[email protected]/

I have not tested draw_functrac.py or show_delta.

As Debian/testing - upcoming bullseye release - has moved to python3.9 (3.9.1-3) as default I am interested in the kbuild transition to python3.

Is it possible to have a Git branch in kbuild.git especially for this transition?

Honestly; I lost a bit the track of all kbuild/python3 patches.

Thanks.

- Sedat -

Quoted 56 lines
Quoted 37 lines
Quoted 37 lines

---

 scripts/clang-tools/gen_compile_commands.py | 2 +-
 scripts/clang-tools/run-clang-tools.py      | 2 +-
 scripts/spdxcheck.py                        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
scripts/clang-tools/gen_compile_commands.py +1 -1
index 19963708bcf8..8ddb5d099029 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) Google LLC, 2018
scripts/clang-tools/run-clang-tools.py +1 -1
index fa7655c7cec0..f754415af398 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) Google LLC, 2020
scripts/spdxcheck.py +1 -1
index bc87200f9c7c..cbdb5c83c08f 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 # Copyright Thomas Gleixner <[email protected]>
 
Quoted 8 lines
Quoted 3 lines

--
2.27.0

--
Thanks,
~Nick Desaulniers

--
Best Regards
Masahiro Yamada

--
You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/CAK7LNATSna9f8cd5Lm%3Dzx2vfJzk%3DWUnAUkA8V593O304zTx%3DvQ%40mail.gmail.com.