prepare contrib directory which holds third party library
- create ryu/contrib directory - adjust module load path for third party library and prioritize our own copy than system's - teach ryu-manager ryu/contrib - run_tests.sh: exclude contrib dir for pep8 third party files will be included under ryu/contrib. Third party files aren't suitable to our pep8 check because they aren't under our control. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
This commit is contained in:
parent
6eeddaa2a4
commit
0ae9c29687
@ -33,6 +33,12 @@ from ryu.app import wsgi
|
||||
from ryu.base.app_manager import AppManager
|
||||
from ryu.controller import controller
|
||||
|
||||
# TODO:
|
||||
# Right now, we have our own patched copy of ovs python bindings
|
||||
# Once our modification is upstreamed and widely deployed,
|
||||
# use it
|
||||
import ryu.contrib
|
||||
|
||||
|
||||
FLAGS = gflags.FLAGS
|
||||
gflags.DEFINE_bool('version', False, 'output version information and exit')
|
||||
|
@ -99,7 +99,7 @@ function run_pylint {
|
||||
function run_pep8 {
|
||||
echo "Running pep8 ..."
|
||||
|
||||
PEP8_EXCLUDE="vcsversion.py,*.pyc"
|
||||
PEP8_EXCLUDE="vcsversion.py,*.pyc,contrib"
|
||||
PEP8_OPTIONS="--exclude=$PEP8_EXCLUDE --repeat --show-source"
|
||||
PEP8_INCLUDE="bin/* ryu setup*.py"
|
||||
PEP8_LOG=pep8.log
|
||||
|
11
ryu/contrib/__init__.py
Normal file
11
ryu/contrib/__init__.py
Normal file
@ -0,0 +1,11 @@
|
||||
# Ajust module loading path for third party library
|
||||
import os
|
||||
import sys
|
||||
|
||||
for path in __path__:
|
||||
if path in sys.path:
|
||||
sys.path.remove(path)
|
||||
path = os.path.abspath(path)
|
||||
if path in sys.path:
|
||||
sys.path.remove(path)
|
||||
sys.path.insert(0, path) # prioritize our own copy than system's
|
Loading…
Reference in New Issue
Block a user