[4/9] devtools/update_version_map: add python2 deprecation notice

Message ID 20200710101055.33671-5-louise.kilheeney@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series python2 deprecation notice |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Louise Kilheeney July 10, 2020, 10:10 a.m. UTC
  Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Ray Kinsella <mdr@ashroe.eu>

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
---
 devtools/update_version_map_abi.py | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Neil Horman July 10, 2020, 10:59 a.m. UTC | #1
On Fri, Jul 10, 2020 at 11:10:50AM +0100, Louise Kilheeney wrote:
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: Ray Kinsella <mdr@ashroe.eu>
> 
> Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
> ---
>  devtools/update_version_map_abi.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/devtools/update_version_map_abi.py b/devtools/update_version_map_abi.py
> index e2104e61e..80a61641e 100755
> --- a/devtools/update_version_map_abi.py
> +++ b/devtools/update_version_map_abi.py
> @@ -160,6 +160,10 @@ def __generate_internal_abi(f_out, lines):
>      print("};", file=f_out)
>  
>  def __main():
> +    if sys.version_info.major < 3:
> +        print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
> +        print("Please use Python 3 instead", file=sys.stderr)
> +
>      arg_parser = argparse.ArgumentParser(
>          description='Merge versions in linker version script.')
>  
> -- 
> 2.17.1
> 
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com><
  
Ray Kinsella July 13, 2020, 8:12 a.m. UTC | #2
On 10/07/2020 11:10, Louise Kilheeney wrote:
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: Ray Kinsella <mdr@ashroe.eu>
> 
> Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
> ---
>  devtools/update_version_map_abi.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/devtools/update_version_map_abi.py b/devtools/update_version_map_abi.py
> index e2104e61e..80a61641e 100755
> --- a/devtools/update_version_map_abi.py
> +++ b/devtools/update_version_map_abi.py
> @@ -160,6 +160,10 @@ def __generate_internal_abi(f_out, lines):
>      print("};", file=f_out)
>  
>  def __main():
> +    if sys.version_info.major < 3:
> +        print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
> +        print("Please use Python 3 instead", file=sys.stderr)
> +
>      arg_parser = argparse.ArgumentParser(
>          description='Merge versions in linker version script.')
>  
> 

Is the simpler way to resolve this, for the script be explicit about its requirements.

Something like 
#!/usr/bin/env python3

I also noted recently that rpm packaging requirements, seem to demands this from scripts now?

Thanks,

Ray K
  

Patch

diff --git a/devtools/update_version_map_abi.py b/devtools/update_version_map_abi.py
index e2104e61e..80a61641e 100755
--- a/devtools/update_version_map_abi.py
+++ b/devtools/update_version_map_abi.py
@@ -160,6 +160,10 @@  def __generate_internal_abi(f_out, lines):
     print("};", file=f_out)
 
 def __main():
+    if sys.version_info.major < 3:
+        print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
+        print("Please use Python 3 instead", file=sys.stderr)
+
     arg_parser = argparse.ArgumentParser(
         description='Merge versions in linker version script.')