[dpdk-dev,v2,3/4] app: give python apps a consistent shebang line

Message ID 1481213032-14935-3-git-send-email-john.mcnamara@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
checkpatch/checkpatch success coding style OK

Commit Message

John McNamara Dec. 8, 2016, 4:03 p.m. UTC
  Add a consistent "env python" shebang line to the DPDK Python
apps so that they can call the default system python.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
---
 app/test/autotest_test_funcs.py | 2 +-
 doc/guides/conf.py              | 2 ++
 tools/dpdk-devbind.py           | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon Dec. 8, 2016, 4:20 p.m. UTC | #1
2016-12-08 16:03, John McNamara:
> Add a consistent "env python" shebang line to the DPDK Python
> apps so that they can call the default system python.

The shebang is only useful for executable scripts.
Those included by other python scripts should not have this line.
Please could you remove the shebang for conf.py and data files?
  
John McNamara Dec. 8, 2016, 8:44 p.m. UTC | #2
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Thursday, December 8, 2016 4:21 PM
> To: Mcnamara, John <john.mcnamara@intel.com>
> Cc: dev@dpdk.org; mkletzan@redhat.com
> Subject: Re: [dpdk-dev] [PATCH v2 3/4] app: give python apps a consistent
> shebang line
> 
> 2016-12-08 16:03, John McNamara:
> > Add a consistent "env python" shebang line to the DPDK Python apps so
> > that they can call the default system python.
> 
> The shebang is only useful for executable scripts.
> Those included by other python scripts should not have this line.
> Please could you remove the shebang for conf.py and data files?

Good point. In that case I'll squash 3/4 into 2/4 since the shebang change
only affects one executable file, even though it isn't strictly a Python 3
change.

John
  

Patch

diff --git a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py
index c482ea8..1fa8cf0 100644
--- a/app/test/autotest_test_funcs.py
+++ b/app/test/autotest_test_funcs.py
@@ -1,4 +1,4 @@ 
-#!/usr/bin/python
+#!/usr/bin/env python
 
 #   BSD LICENSE
 #
diff --git a/doc/guides/conf.py b/doc/guides/conf.py
index 34c62de..97c5d0e 100644
--- a/doc/guides/conf.py
+++ b/doc/guides/conf.py
@@ -1,3 +1,5 @@ 
+#!/usr/bin/env python
+
 #   BSD LICENSE
 #   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
 #   All rights reserved.
diff --git a/tools/dpdk-devbind.py b/tools/dpdk-devbind.py
index 4f51a4b..a5b2af5 100755
--- a/tools/dpdk-devbind.py
+++ b/tools/dpdk-devbind.py
@@ -1,4 +1,5 @@ 
-#! /usr/bin/python
+#!/usr/bin/env python
+
 #
 #   BSD LICENSE
 #