1""" 2Except on bionic, Travis Linux base image for PPC64LE 3platform lacks the proper 4permissions to the directory ~/.cache/pip/wheels that allow 5the user running travis build to install pip packages. 6TODO: is someone tracking this issue? Maybe just move to bionic? 7""" 8 9import subprocess 10import collections 11import os 12 13 14def patch(): 15 env = collections.defaultdict(str, os.environ) 16 if env['TRAVIS_CPU_ARCH'] != 'ppc64le': 17 return 18 cmd = [ 19 'sudo', 20 'chown', 21 '-Rfv', 22 '{USER}:{GROUP}'.format_map(env), 23 os.path.expanduser('~/.cache/pip/wheels'), 24 ] 25 subprocess.Popen(cmd) 26 27 28__name__ == '__main__' and patch() 29