diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/buildgen/plugins/transitive_dependencies.py | 15 | ||||
-rwxr-xr-x | tools/distrib/check_copyright.py | 24 | ||||
-rwxr-xr-x | tools/distrib/python/submit.py | 2 | ||||
-rw-r--r-- | tools/jenkins/grpc_interop_python/Dockerfile | 1 | ||||
-rwxr-xr-x | tools/jenkins/grpc_interop_python/build_interop.sh | 2 | ||||
-rw-r--r-- | tools/jenkins/grpc_jenkins_slave/Dockerfile | 2 | ||||
-rw-r--r-- | tools/jenkins/grpc_jenkins_slave_32bits/Dockerfile | 2 | ||||
-rwxr-xr-x | tools/jenkins/run_jenkins.sh | 3 | ||||
-rwxr-xr-x | tools/run_tests/build_python.sh | 8 | ||||
-rwxr-xr-x | tools/run_tests/jobset.py | 3 | ||||
-rwxr-xr-x | tools/run_tests/run_interop_tests.py | 14 | ||||
-rwxr-xr-x | tools/run_tests/run_python.sh | 6 |
12 files changed, 48 insertions, 34 deletions
diff --git a/tools/buildgen/plugins/transitive_dependencies.py b/tools/buildgen/plugins/transitive_dependencies.py index c2d3da3a3b..01e7f61ea9 100644 --- a/tools/buildgen/plugins/transitive_dependencies.py +++ b/tools/buildgen/plugins/transitive_dependencies.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -36,10 +36,13 @@ of the list of dependencies. """ def get_lib(libs, name): - return next(lib for lib in libs if lib['name']==name) + try: + return next(lib for lib in libs if lib['name']==name) + except StopIteration: + return None def transitive_deps(lib, libs): - if 'deps' in lib: + if lib is not None and 'deps' in lib: # Recursively call transitive_deps on each dependency, and take the union return set.union(set(lib['deps']), *[set(transitive_deps(get_lib(libs, dep), libs)) @@ -58,6 +61,10 @@ def mako_plugin(dictionary): node_modules = dictionary.get('node_modules') targets = dictionary.get('targets') - for target_list in (libs, node_modules, targets): + for target_list in (libs, targets, node_modules): for target in target_list: target['transitive_deps'] = transitive_deps(target, libs) + + python_dependencies = dictionary.get('python_dependencies') + python_dependencies['transitive_deps'] = ( + transitive_deps(python_dependencies, libs)) diff --git a/tools/distrib/check_copyright.py b/tools/distrib/check_copyright.py index f54e5fad80..5e948e2dee 100755 --- a/tools/distrib/check_copyright.py +++ b/tools/distrib/check_copyright.py @@ -54,6 +54,9 @@ argp.add_argument('-a', '--ancient', default=0, action='store_const', const=1) +argp.add_argument('-f', '--fix', + default=False, + action='store_true'); args = argp.parse_args() # open the license text @@ -90,7 +93,7 @@ KNOWN_BAD = set([ ]) -RE_YEAR = r'Copyright (?:[0-9]+\-)?([0-9]+), Google Inc\.' +RE_YEAR = r'Copyright (?P<first_year>[0-9]+\-)?(?P<last_year>[0-9]+), Google Inc\.' RE_LICENSE = dict( (k, r'\n'.join( LICENSE_PREFIX[k] + @@ -103,6 +106,9 @@ def load(name): with open(name) as f: return '\n'.join(line.rstrip() for line in f.read().splitlines()) +def save(name, text): + with open(name, 'w') as f: + f.write(text) assert(re.search(RE_LICENSE['LICENSE'], load('LICENSE'))) assert(re.search(RE_LICENSE['Makefile'], load('Makefile'))) @@ -117,6 +123,7 @@ def log(cond, why, filename): # scan files, validate the text +ok = True for filename in subprocess.check_output('git ls-tree -r --name-only -r HEAD', shell=True).splitlines(): if filename in KNOWN_BAD: continue @@ -130,14 +137,25 @@ for filename in subprocess.check_output('git ls-tree -r --name-only -r HEAD', log(args.skips, 'skip', filename) continue text = load(filename) - ok = True m = re.search(re_license, text) if m: + gdict = m.groupdict() last_modified = int(subprocess.check_output('git log -1 --format="%ad" --date=short -- ' + filename, shell=True)[0:4]) - latest_claimed = int(m.group(1)) + latest_claimed = int(gdict['last_year']) if last_modified > latest_claimed: print '%s modified %d but copyright only extends to %d' % (filename, last_modified, latest_claimed) ok = False + if args.fix: + span_start, span_end = m.span(2) + if not gdict['first_year']: + # prepend the old year to the current one. + text = '{}-{}{}'.format(text[:span_end], last_modified, text[span_end:]) + else: # already a year range + # simply update the last year + text = '{}{}{}'.format(text[:span_start], last_modified, text[span_end:]) + save(filename, text) + print 'Fixed!' + ok = True elif 'DO NOT EDIT' not in text and 'AssemblyInfo.cs' not in filename and filename != 'src/boringssl/err_data.c': log(1, 'copyright missing', filename) ok = False diff --git a/tools/distrib/python/submit.py b/tools/distrib/python/submit.py index dffbefd5fe..08ace7c690 100755 --- a/tools/distrib/python/submit.py +++ b/tools/distrib/python/submit.py @@ -59,7 +59,7 @@ args = parser.parse_args() # Move to the root directory of Python GRPC. pkgdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), - '../../../src/python/grpcio') + '../../../') # Remove previous distributions; they somehow confuse twine. try: shutil.rmtree(os.path.join(pkgdir, 'dist/')) diff --git a/tools/jenkins/grpc_interop_python/Dockerfile b/tools/jenkins/grpc_interop_python/Dockerfile index 6034cbf955..047604b1b7 100644 --- a/tools/jenkins/grpc_interop_python/Dockerfile +++ b/tools/jenkins/grpc_interop_python/Dockerfile @@ -48,6 +48,7 @@ RUN apt-get update && apt-get install -y \ libc6-dbg \ libc6-dev \ libgtest-dev \ + libssl-dev \ libtool \ make \ strace \ diff --git a/tools/jenkins/grpc_interop_python/build_interop.sh b/tools/jenkins/grpc_interop_python/build_interop.sh index 8f5bfd11e2..39c93677d8 100755 --- a/tools/jenkins/grpc_interop_python/build_interop.sh +++ b/tools/jenkins/grpc_interop_python/build_interop.sh @@ -43,5 +43,5 @@ make install-certs make # build Python interop client and server -CONFIG=opt ./tools/run_tests/build_python.sh 2.7 +CONFIG=opt ./tools/run_tests/build_python.sh diff --git a/tools/jenkins/grpc_jenkins_slave/Dockerfile b/tools/jenkins/grpc_jenkins_slave/Dockerfile index f3bf6bc4f0..b1ac024dfb 100644 --- a/tools/jenkins/grpc_jenkins_slave/Dockerfile +++ b/tools/jenkins/grpc_jenkins_slave/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/tools/jenkins/grpc_jenkins_slave_32bits/Dockerfile b/tools/jenkins/grpc_jenkins_slave_32bits/Dockerfile index 1a86c5a5d7..348a333d3e 100644 --- a/tools/jenkins/grpc_jenkins_slave_32bits/Dockerfile +++ b/tools/jenkins/grpc_jenkins_slave_32bits/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/tools/jenkins/run_jenkins.sh b/tools/jenkins/run_jenkins.sh index 9b6ba71948..84b4ea51ed 100755 --- a/tools/jenkins/run_jenkins.sh +++ b/tools/jenkins/run_jenkins.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -92,4 +92,3 @@ if [ "$TESTS_FAILED" != "" ] then exit 1 fi - diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index 57080ce934..e0fcbb602d 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,16 +34,14 @@ set -ex cd $(dirname $0)/../.. ROOT=`pwd` -GRPCIO=$ROOT/src/python/grpcio export LD_LIBRARY_PATH=$ROOT/libs/$CONFIG export DYLD_LIBRARY_PATH=$ROOT/libs/$CONFIG export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH -export CFLAGS="-I$ROOT/include -std=c89" +export CFLAGS="-I$ROOT/include -std=gnu99" export LDFLAGS="-L$ROOT/libs/$CONFIG" export GRPC_PYTHON_BUILD_WITH_CYTHON=1 export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1 -cd $GRPCIO tox --notest -$GRPCIO/.tox/py27/bin/python $GRPCIO/setup.py build +$ROOT/.tox/py27/bin/python $ROOT/setup.py build diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index 0b01bc4bec..e33433daf2 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -450,4 +450,3 @@ def run(cmdlines, js.set_remaining(remaining) js.finish() return js.get_num_failures(), js.resultset - diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index e69e9877c5..40bbe3cc3c 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -298,11 +298,8 @@ class PythonLanguage: def client_cmd(self, args): return [ - 'src/python/grpcio/.tox/py27/bin/python', - 'src/python/grpcio/setup.py', - 'run_interop', - '--client', - '--args=\'{}\''.format(' '.join(args)) + 'tox -einterop_client --', + ' '.join(args) ] def cloud_to_prod_env(self): @@ -310,11 +307,8 @@ class PythonLanguage: def server_cmd(self, args): return [ - 'src/python/grpcio/.tox/py27/bin/python', - 'src/python/grpcio/setup.py', - 'run_interop', - '--server', - '--args=\'{}\''.format(' '.join(args) + ' --use_tls=true') + 'tox -einterop_server --', + ' '.join(args) + ' --use_tls=true' ] def global_env(self): diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 042b40485d..ffe9c12af1 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,7 +34,6 @@ set -ex cd $(dirname $0)/../.. ROOT=`pwd` -GRPCIO=$ROOT/src/python/grpcio export LD_LIBRARY_PATH=$ROOT/libs/$CONFIG export DYLD_LIBRARY_PATH=$ROOT/libs/$CONFIG export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH @@ -43,9 +42,8 @@ export LDFLAGS="-L$ROOT/libs/$CONFIG" export GRPC_PYTHON_BUILD_WITH_CYTHON=1 export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1 -cd $GRPCIO tox mkdir -p $ROOT/reports rm -rf $ROOT/reports/python-coverage -(mv -T $GRPCIO/htmlcov $ROOT/reports/python-coverage) || true +(mv -T $ROOT/htmlcov $ROOT/reports/python-coverage) || true |