All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC PATCH v3 0/2] use python3 explicitly
@ 2021-09-21 21:04 Petr Vorel
  2021-09-21 21:04 ` [Buildroot] [RFC PATCH v3 1/2] support: utils: " Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Petr Vorel @ 2021-09-21 21:04 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, David Laight, Edgar Bonet

Hi,

changes v2->v3:
* remove __future__ from utils/getdeveloperlib.py (previously in 3rd
commit [1]; noted by Romain [2])

changes v1->v2:
* 3 more commits
* remove also python2 compatibility imports

Kind regards,
Petr

[1] https://lore.kernel.org/buildroot/20210915194839.22122-4-petr.vorel@gmail.com/
[2] https://lore.kernel.org/buildroot/41cb0bdf-845d-ab94-0322-c4d1393f40b8@gmail.com/

Petr Vorel (2):
  support: utils: use python3 explicitly
  utils/scanpypi: remove python2 compatibility imports

 support/scripts/cve.py                                 | 2 +-
 support/scripts/graph-build-time                       | 2 +-
 support/scripts/graph-depends                          | 2 +-
 support/scripts/pycompile.py                           | 4 +---
 support/scripts/size-stats                             | 2 +-
 support/testing/tests/package/sample_gst1_python.py    | 2 +-
 support/testing/tests/package/sample_python_gobject.py | 2 +-
 utils/check-package                                    | 3 +--
 utils/genrandconfig                                    | 4 +---
 utils/get-developers                                   | 2 +-
 utils/getdeveloperlib.py                               | 1 -
 utils/scanpypi                                         | 2 --
 utils/size-stats-compare                               | 2 +-
 13 files changed, 11 insertions(+), 19 deletions(-)

-- 
2.33.0

_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [RFC PATCH v3 1/2] support: utils: use python3 explicitly
  2021-09-21 21:04 [Buildroot] [RFC PATCH v3 0/2] use python3 explicitly Petr Vorel
@ 2021-09-21 21:04 ` Petr Vorel
  2021-09-22  3:09   ` James Knight
  2021-09-21 21:04 ` [Buildroot] [RFC PATCH v3 2/2] utils/scanpypi: remove python2 compatibility imports Petr Vorel
  2021-09-22 19:46 ` [Buildroot] [RFC PATCH v3 0/2] use python3 explicitly Arnout Vandecappelle
  2 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2021-09-21 21:04 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, David Laight, Edgar Bonet

Python 2 is EOL sice 2020 [1], it's still available on distros, but may not
be installed by default (as being replaced by python3).

Thus remove compatibility imports:
from __future__ import print_function
from __future__ import absolute_import

Tested with python3 -m py_compile.

[1] https://www.python.org/doc/sunset-python-2/

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
Changes v2->v3:
* remove __future__ from utils/getdeveloperlib.py (previously in 3rd

 support/scripts/cve.py                                 | 2 +-
 support/scripts/graph-build-time                       | 2 +-
 support/scripts/graph-depends                          | 2 +-
 support/scripts/pycompile.py                           | 4 +---
 support/scripts/size-stats                             | 2 +-
 support/testing/tests/package/sample_gst1_python.py    | 2 +-
 support/testing/tests/package/sample_python_gobject.py | 2 +-
 utils/check-package                                    | 3 +--
 utils/genrandconfig                                    | 4 +---
 utils/get-developers                                   | 2 +-
 utils/getdeveloperlib.py                               | 1 -
 utils/size-stats-compare                               | 2 +-
 12 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/support/scripts/cve.py b/support/scripts/cve.py
index 13c29fabe0..7cd6fce4d8 100755
--- a/support/scripts/cve.py
+++ b/support/scripts/cve.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Copyright (C) 2009 by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 # Copyright (C) 2020 by Gregory CLEMENT <gregory.clement@bootlin.com>
diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
index ba3cdad85b..742c9a7a50 100755
--- a/support/scripts/graph-build-time
+++ b/support/scripts/graph-build-time
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Copyright (C) 2011 by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 # Copyright (C) 2013 by Yann E. MORIN <yann.morin.1998@free.fr>
diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends
index d42bebce9d..a66fb28f41 100755
--- a/support/scripts/graph-depends
+++ b/support/scripts/graph-depends
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Usage (the graphviz package must be installed in your distribution)
 #  ./support/scripts/graph-depends [-p package-name] > test.dot
diff --git a/support/scripts/pycompile.py b/support/scripts/pycompile.py
index b8cd3cee6c..8774144a90 100644
--- a/support/scripts/pycompile.py
+++ b/support/scripts/pycompile.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 """
 Byte compile all .py files from provided directories. This script is an
@@ -6,8 +6,6 @@ alternative implementation of compileall.compile_dir written with
 cross-compilation in mind.
 """
 
-from __future__ import print_function
-
 import argparse
 import os
 import py_compile
diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index dea3a6007c..bf3d12a9b7 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Copyright (C) 2014 by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 
diff --git a/support/testing/tests/package/sample_gst1_python.py b/support/testing/tests/package/sample_gst1_python.py
index fab7e74f40..2d7e0e1ed9 100644
--- a/support/testing/tests/package/sample_gst1_python.py
+++ b/support/testing/tests/package/sample_gst1_python.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """A simple test that uses gst1-python to run a fake videotestsrc for 100
 frames
 """
diff --git a/support/testing/tests/package/sample_python_gobject.py b/support/testing/tests/package/sample_python_gobject.py
index 50564aa79f..4490a73613 100644
--- a/support/testing/tests/package/sample_python_gobject.py
+++ b/support/testing/tests/package/sample_python_gobject.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """A simple test that uses python-gobject to find the path of sh."""
 from gi.repository import GLib
 
diff --git a/utils/check-package b/utils/check-package
index dd18d19c25..a959fef079 100755
--- a/utils/check-package
+++ b/utils/check-package
@@ -1,7 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # See utils/checkpackagelib/readme.txt before editing this file.
 
-from __future__ import print_function
 import argparse
 import inspect
 import os
diff --git a/utils/genrandconfig b/utils/genrandconfig
index 622cfd4891..a1431bf1a8 100755
--- a/utils/genrandconfig
+++ b/utils/genrandconfig
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Copyright (C) 2014 by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 #
@@ -18,8 +18,6 @@
 
 # This script generates a random configuration for testing Buildroot.
 
-from __future__ import print_function
-
 import contextlib
 import csv
 import os
diff --git a/utils/get-developers b/utils/get-developers
index 9182b2d85f..22accaf181 100755
--- a/utils/get-developers
+++ b/utils/get-developers
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import argparse
 import getdeveloperlib
diff --git a/utils/getdeveloperlib.py b/utils/getdeveloperlib.py
index ce822320f8..438d26d68d 100644
--- a/utils/getdeveloperlib.py
+++ b/utils/getdeveloperlib.py
@@ -1,4 +1,3 @@
-from __future__ import print_function
 from io import open
 import os
 import re
diff --git a/utils/size-stats-compare b/utils/size-stats-compare
index a3d7f250c6..422972e488 100755
--- a/utils/size-stats-compare
+++ b/utils/size-stats-compare
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Copyright (C) 2016 Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
 
-- 
2.33.0

_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [RFC PATCH v3 2/2] utils/scanpypi: remove python2 compatibility imports
  2021-09-21 21:04 [Buildroot] [RFC PATCH v3 0/2] use python3 explicitly Petr Vorel
  2021-09-21 21:04 ` [Buildroot] [RFC PATCH v3 1/2] support: utils: " Petr Vorel
@ 2021-09-21 21:04 ` Petr Vorel
  2021-10-05  6:20   ` Peter Korsgaard
  2021-09-22 19:46 ` [Buildroot] [RFC PATCH v3 0/2] use python3 explicitly Arnout Vandecappelle
  2 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2021-09-21 21:04 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, David Laight, Edgar Bonet

ee8b680816 ("utils/scanpypi: use python3 explicitly") started to use python3,
thus compatibility can be removed:

from __future__ import print_function
from __future__ import absolute_import

Tested with python3 -m py_compile.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
Changes v2->v3:
* The same as v2

 utils/scanpypi | 2 --
 1 file changed, 2 deletions(-)

diff --git a/utils/scanpypi b/utils/scanpypi
index 9dede4e119..1f3326cf4d 100755
--- a/utils/scanpypi
+++ b/utils/scanpypi
@@ -6,8 +6,6 @@ Utility for building Buildroot packages for existing PyPI packages
 Any package built by scanpypi should be manually checked for
 errors.
 """
-from __future__ import print_function
-from __future__ import absolute_import
 import argparse
 import json
 import sys
-- 
2.33.0

_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [RFC PATCH v3 1/2] support: utils: use python3 explicitly
  2021-09-21 21:04 ` [Buildroot] [RFC PATCH v3 1/2] support: utils: " Petr Vorel
@ 2021-09-22  3:09   ` James Knight
  2021-09-22 19:12     ` Arnout Vandecappelle
  0 siblings, 1 reply; 7+ messages in thread
From: James Knight @ 2021-09-22  3:09 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Romain Naour, David Laight, Edgar Bonet, buildroot

On Tue, Sep 21, 2021 at 5:04 PM Petr Vorel <petr.vorel@gmail.com> wrote:
> Python 2 is EOL sice 2020 [1], it's still available on distros, but may not
> be installed by default (as being replaced by python3).

I do not mind if everyone wants to make a transition to Python 3-only
support utilities, but I just wanted to mention that RHEL still
supports Python 2.x until June 2024 [1]. I am not aware of what
environments may be using RHEL8 to perform Buildroot-related
development and RHEL8 does support Python 3, so it may not be an
issue.

[1]: https://access.redhat.com/support/policy/updates/rhel8-app-streams-life-cycle
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [RFC PATCH v3 1/2] support: utils: use python3 explicitly
  2021-09-22  3:09   ` James Knight
@ 2021-09-22 19:12     ` Arnout Vandecappelle
  0 siblings, 0 replies; 7+ messages in thread
From: Arnout Vandecappelle @ 2021-09-22 19:12 UTC (permalink / raw)
  To: James Knight, Petr Vorel
  Cc: Romain Naour, David Laight, Edgar Bonet, buildroot



On 22/09/2021 05:09, James Knight wrote:
> On Tue, Sep 21, 2021 at 5:04 PM Petr Vorel <petr.vorel@gmail.com> wrote:
>> Python 2 is EOL sice 2020 [1], it's still available on distros, but may not
>> be installed by default (as being replaced by python3).
> 
> I do not mind if everyone wants to make a transition to Python 3-only
> support utilities, but I just wanted to mention that RHEL still
> supports Python 2.x until June 2024 [1]. I am not aware of what
> environments may be using RHEL8 to perform Buildroot-related
> development and RHEL8 does support Python 3, so it may not be an
> issue.

  Even on RHEL, it's possible to install python3.6 (maybe even 3.7) through 
rhscl. So RedHat is definitely not keeping us back to switch to Python3.

  The reason RHEL still maintains python2 is to keep existing scripts that 
*don't* work on python3 operational.


  Regards,
  Arnout

> 
> [1]: https://access.redhat.com/support/policy/updates/rhel8-app-streams-life-cycle
> _______________________________________________
> buildroot mailing list
> buildroot@lists.buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
> 
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [RFC PATCH v3 0/2] use python3 explicitly
  2021-09-21 21:04 [Buildroot] [RFC PATCH v3 0/2] use python3 explicitly Petr Vorel
  2021-09-21 21:04 ` [Buildroot] [RFC PATCH v3 1/2] support: utils: " Petr Vorel
  2021-09-21 21:04 ` [Buildroot] [RFC PATCH v3 2/2] utils/scanpypi: remove python2 compatibility imports Petr Vorel
@ 2021-09-22 19:46 ` Arnout Vandecappelle
  2 siblings, 0 replies; 7+ messages in thread
From: Arnout Vandecappelle @ 2021-09-22 19:46 UTC (permalink / raw)
  To: Petr Vorel, buildroot; +Cc: Romain Naour, David Laight, Edgar Bonet



On 21/09/2021 23:04, Petr Vorel wrote:
> Hi,
> 
> changes v2->v3:
> * remove __future__ from utils/getdeveloperlib.py (previously in 3rd
> commit [1]; noted by Romain [2])
> 
> changes v1->v2:
> * 3 more commits
> * remove also python2 compatibility imports
> 
> Kind regards,
> Petr
> 
> [1] https://lore.kernel.org/buildroot/20210915194839.22122-4-petr.vorel@gmail.com/
> [2] https://lore.kernel.org/buildroot/41cb0bdf-845d-ab94-0322-c4d1393f40b8@gmail.com/
> 
> Petr Vorel (2):
>    support: utils: use python3 explicitly
>    utils/scanpypi: remove python2 compatibility imports

  Both applied to master, thanks.

  I found that also utils/diffconfig was still using pyhon, so I sent a patch to 
fix that one as well. I checked in the kernel, they made the same change there.

  Regards,
  Arnout

> 
>   support/scripts/cve.py                                 | 2 +-
>   support/scripts/graph-build-time                       | 2 +-
>   support/scripts/graph-depends                          | 2 +-
>   support/scripts/pycompile.py                           | 4 +---
>   support/scripts/size-stats                             | 2 +-
>   support/testing/tests/package/sample_gst1_python.py    | 2 +-
>   support/testing/tests/package/sample_python_gobject.py | 2 +-
>   utils/check-package                                    | 3 +--
>   utils/genrandconfig                                    | 4 +---
>   utils/get-developers                                   | 2 +-
>   utils/getdeveloperlib.py                               | 1 -
>   utils/scanpypi                                         | 2 --
>   utils/size-stats-compare                               | 2 +-
>   13 files changed, 11 insertions(+), 19 deletions(-)
> 
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [RFC PATCH v3 2/2] utils/scanpypi: remove python2 compatibility imports
  2021-09-21 21:04 ` [Buildroot] [RFC PATCH v3 2/2] utils/scanpypi: remove python2 compatibility imports Petr Vorel
@ 2021-10-05  6:20   ` Peter Korsgaard
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2021-10-05  6:20 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Romain Naour, David Laight, Edgar Bonet, buildroot

>>>>> "Petr" == Petr Vorel <petr.vorel@gmail.com> writes:

 > ee8b680816 ("utils/scanpypi: use python3 explicitly") started to use python3,
 > thus compatibility can be removed:

 > from __future__ import print_function
 > from __future__ import absolute_import

 > Tested with python3 -m py_compile.

 > Signed-off-by: Petr Vorel <petr.vorel@gmail.com>

Committed to 2021.02.x, 2021.05.x and 2021.08.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-05  6:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-21 21:04 [Buildroot] [RFC PATCH v3 0/2] use python3 explicitly Petr Vorel
2021-09-21 21:04 ` [Buildroot] [RFC PATCH v3 1/2] support: utils: " Petr Vorel
2021-09-22  3:09   ` James Knight
2021-09-22 19:12     ` Arnout Vandecappelle
2021-09-21 21:04 ` [Buildroot] [RFC PATCH v3 2/2] utils/scanpypi: remove python2 compatibility imports Petr Vorel
2021-10-05  6:20   ` Peter Korsgaard
2021-09-22 19:46 ` [Buildroot] [RFC PATCH v3 0/2] use python3 explicitly Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.