From: Louise Kilheeney Date: Fri, 10 Jul 2020 10:10:47 +0000 (+0100) Subject: add python2 deprecation notice X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ea0dceba0fd7191442f2e768fc55cf08b59a5203;p=dpdk.git add python2 deprecation notice Prepare for python2 removal in 20.11. Signed-off-by: Louise Kilheeney Acked-by: Neil Horman Acked-by: Nicolas Chautru --- diff --git a/app/test-bbdev/test-bbdev.py b/app/test-bbdev/test-bbdev.py index e127fb2eb3..5ae2dc6c49 100755 --- a/app/test-bbdev/test-bbdev.py +++ b/app/test-bbdev/test-bbdev.py @@ -16,6 +16,10 @@ def kill(process): print("ERROR: Test app timed out") process.kill() +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) + if "RTE_SDK" in os.environ: dpdk_path = os.environ["RTE_SDK"] else: diff --git a/app/test-cmdline/cmdline_test.py b/app/test-cmdline/cmdline_test.py index 3a8fac4261..954428e2bf 100755 --- a/app/test-cmdline/cmdline_test.py +++ b/app/test-cmdline/cmdline_test.py @@ -19,6 +19,9 @@ def runTest(child, test): return 0 child.expect(test["Result"], 1) +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) # # history test is a special case diff --git a/app/test/autotest.py b/app/test/autotest.py index b42f48879c..cf7584ccd7 100644 --- a/app/test/autotest.py +++ b/app/test/autotest.py @@ -17,6 +17,10 @@ if len(sys.argv) < 3: usage() sys.exit(1) +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) + target = sys.argv[2] test_whitelist = None diff --git a/devtools/update_version_map_abi.py b/devtools/update_version_map_abi.py index e2104e61e4..80a61641ed 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.') diff --git a/usertools/cpu_layout.py b/usertools/cpu_layout.py index 6f129b1db8..5423c7965f 100755 --- a/usertools/cpu_layout.py +++ b/usertools/cpu_layout.py @@ -10,6 +10,10 @@ try: except NameError: xrange = range # Python 3 +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) + sockets = [] cores = [] core_map = {} diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index dc008823ff..86b6b53c40 100755 --- a/usertools/dpdk-devbind.py +++ b/usertools/dpdk-devbind.py @@ -10,6 +10,10 @@ import getopt import subprocess from os.path import exists, abspath, dirname, basename +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) + # The PCI base class for all devices network_class = {'Class': '02', 'Vendor': None, 'Device': None, 'SVendor': None, 'SDevice': None} diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py index 12f20735e0..f9ed755176 100755 --- a/usertools/dpdk-pmdinfo.py +++ b/usertools/dpdk-pmdinfo.py @@ -28,7 +28,9 @@ raw_output = False pcidb = None # =========================================== - +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) class Vendor: """ diff --git a/usertools/dpdk-telemetry-client.py b/usertools/dpdk-telemetry-client.py index 35edb7cd26..98d28fa89b 100755 --- a/usertools/dpdk-telemetry-client.py +++ b/usertools/dpdk-telemetry-client.py @@ -23,6 +23,10 @@ try: except NameError: raw_input = input # Python 3 +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) + class Socket: def __init__(self):