[dpdk-dev] [PATCH v1 4/4] doc: add required python versions to coding guidelines

John McNamara john.mcnamara at intel.com
Thu Dec 8 16:51:05 CET 2016


Add a requirement to support both Python 2 and 3 to the
DPDK Python Coding Standards.

Signed-off-by: John McNamara <john.mcnamara at intel.com>
---
 app/test/autotest_data.py                | 188 +++++++++++++++----------------
 doc/guides/contributing/coding_style.rst |   3 +-
 2 files changed, 96 insertions(+), 95 deletions(-)

diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py
index 7be345a..0cf4cfd 100644
--- a/app/test/autotest_data.py
+++ b/app/test/autotest_data.py
@@ -59,46 +59,46 @@ def per_sockets(num):
         "Tests":
         [
             {
-                "Name": "Cycles autotest",
+                "Name":    "Cycles autotest",
                 "Command": "cycles_autotest",
-                "Func": default_autotest,
-                "Report": None,
+                "Func":    default_autotest,
+                "Report":  None,
             },
             {
                 "Name":    "Timer autotest",
-                "Command":     "timer_autotest",
+                "Command": "timer_autotest",
                 "Func":    timer_autotest,
-                "Report":    None,
+                "Report":   None,
             },
             {
                 "Name":    "Debug autotest",
-                "Command":     "debug_autotest",
+                "Command": "debug_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Errno autotest",
-                "Command":     "errno_autotest",
+                "Command": "errno_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Meter autotest",
-                "Command":     "meter_autotest",
+                "Command": "meter_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Common autotest",
-                "Command":     "common_autotest",
+                "Command": "common_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Resource autotest",
-                "Command":    "resource_autotest",
+                "Command": "resource_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ]
     },
@@ -109,51 +109,51 @@ def per_sockets(num):
         [
             {
                 "Name":    "Memory autotest",
-                "Command":    "memory_autotest",
+                "Command": "memory_autotest",
                 "Func":    memory_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Read/write lock autotest",
-                "Command":     "rwlock_autotest",
+                "Command": "rwlock_autotest",
                 "Func":    rwlock_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Logs autotest",
-                "Command":     "logs_autotest",
+                "Command": "logs_autotest",
                 "Func":    logs_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "CPU flags autotest",
-                "Command":     "cpuflags_autotest",
+                "Command": "cpuflags_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Version autotest",
-                "Command":     "version_autotest",
+                "Command": "version_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "EAL filesystem autotest",
-                "Command":     "eal_fs_autotest",
+                "Command": "eal_fs_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "EAL flags autotest",
-                "Command":     "eal_flags_autotest",
+                "Command": "eal_flags_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Hash autotest",
-                "Command":     "hash_autotest",
+                "Command": "hash_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ],
     },
@@ -164,9 +164,9 @@ def per_sockets(num):
         [
             {
                 "Name":    "LPM autotest",
-                "Command":     "lpm_autotest",
+                "Command": "lpm_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "LPM6 autotest",
@@ -176,27 +176,27 @@ def per_sockets(num):
             },
             {
                 "Name":    "Memcpy autotest",
-                "Command":     "memcpy_autotest",
+                "Command": "memcpy_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Memzone autotest",
-                "Command":     "memzone_autotest",
+                "Command": "memzone_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "String autotest",
-                "Command":     "string_autotest",
+                "Command": "string_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Alarm autotest",
-                "Command":    "alarm_autotest",
+                "Command": "alarm_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ]
     },
@@ -207,39 +207,39 @@ def per_sockets(num):
         [
             {
                 "Name":    "PCI autotest",
-                "Command":    "pci_autotest",
+                "Command": "pci_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Malloc autotest",
-                "Command":     "malloc_autotest",
+                "Command": "malloc_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Multi-process autotest",
-                "Command":     "multiprocess_autotest",
+                "Command": "multiprocess_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Mbuf autotest",
-                "Command":     "mbuf_autotest",
+                "Command": "mbuf_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Per-lcore autotest",
-                "Command":     "per_lcore_autotest",
+                "Command": "per_lcore_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Ring autotest",
-                "Command":     "ring_autotest",
+                "Command": "ring_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ]
     },
@@ -250,33 +250,33 @@ def per_sockets(num):
         [
             {
                 "Name":    "Spinlock autotest",
-                "Command":     "spinlock_autotest",
+                "Command": "spinlock_autotest",
                 "Func":    spinlock_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Byte order autotest",
-                "Command":     "byteorder_autotest",
+                "Command": "byteorder_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "TAILQ autotest",
-                "Command":     "tailq_autotest",
+                "Command": "tailq_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Command-line autotest",
-                "Command":     "cmdline_autotest",
+                "Command": "cmdline_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Interrupts autotest",
-                "Command":     "interrupt_autotest",
+                "Command": "interrupt_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ]
     },
@@ -287,33 +287,33 @@ def per_sockets(num):
         [
             {
                 "Name":    "Function reentrancy autotest",
-                "Command":     "func_reentrancy_autotest",
+                "Command": "func_reentrancy_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Mempool autotest",
-                "Command":     "mempool_autotest",
+                "Command": "mempool_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Atomics autotest",
-                "Command":     "atomic_autotest",
+                "Command": "atomic_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Prefetch autotest",
-                "Command":     "prefetch_autotest",
+                "Command": "prefetch_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
-                "Name": "Red autotest",
+                "Name":    "Red autotest",
                 "Command": "red_autotest",
-                "Func": default_autotest,
-                "Report": None,
+                "Func":    default_autotest,
+                "Report":  None,
             },
         ]
     },
@@ -324,21 +324,21 @@ def per_sockets(num):
         [
             {
                 "Name":    "PMD ring autotest",
-                "Command":    "ring_pmd_autotest",
+                "Command": "ring_pmd_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
                 "Name":    "Access list control autotest",
-                "Command":     "acl_autotest",
+                "Command": "acl_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
             {
-                "Name": "Sched autotest",
+                "Name":    "Sched autotest",
                 "Command": "sched_autotest",
-                "Func": default_autotest,
-                "Report": None,
+                "Func":    default_autotest,
+                "Report":  None,
             },
         ]
     },
@@ -354,9 +354,9 @@ def per_sockets(num):
         [
             {
                 "Name":    "KNI autotest",
-                "Command":    "kni_autotest",
+                "Command": "kni_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ]
     },
@@ -367,9 +367,9 @@ def per_sockets(num):
         [
             {
                 "Name":    "Mempool performance autotest",
-                "Command":     "mempool_perf_autotest",
+                "Command": "mempool_perf_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ]
     },
@@ -380,9 +380,9 @@ def per_sockets(num):
         [
             {
                 "Name":    "Memcpy performance autotest",
-                "Command":     "memcpy_perf_autotest",
+                "Command": "memcpy_perf_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ]
     },
@@ -393,9 +393,9 @@ def per_sockets(num):
         [
             {
                 "Name":    "Hash performance autotest",
-                "Command":     "hash_perf_autotest",
+                "Command": "hash_perf_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ]
     },
@@ -408,7 +408,7 @@ def per_sockets(num):
                 "Name":       "Power autotest",
                 "Command":    "power_autotest",
                 "Func":       default_autotest,
-                "Report":     None,
+                "Report":      None,
             },
         ]
     },
@@ -445,9 +445,9 @@ def per_sockets(num):
         [
             {
                 "Name":    "Timer performance autotest",
-                "Command":     "timer_perf_autotest",
+                "Command": "timer_perf_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ]
     },
@@ -462,9 +462,9 @@ def per_sockets(num):
         [
             {
                 "Name":    "Ring performance autotest",
-                "Command":     "ring_perf_autotest",
+                "Command": "ring_perf_autotest",
                 "Func":    default_autotest,
-                "Report":    None,
+                "Report":  None,
             },
         ]
     },
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index 1eb67f3..4163960 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -690,6 +690,7 @@ Control Statements
 Python Code
 -----------
 
-All python code should be compliant with `PEP8 (Style Guide for Python Code) <https://www.python.org/dev/peps/pep-0008/>`_.
+All Python code should work with Python 2.7+ and 3.2+ and be compliant with
+`PEP8 (Style Guide for Python Code) <https://www.python.org/dev/peps/pep-0008/>`_.
 
 The ``pep8`` tool can be used for testing compliance with the guidelines.
-- 
2.7.4



More information about the dev mailing list