diff --git a/.travis.yml b/.travis.yml index d12a9ecee9..7d8c102629 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,6 @@ jobs: allow_failures: # suppress failures due to pypa/setuptools#2000 - python: pypy3 - - arch: ppc64le - python: pypy3 - <<: *latest_py3 env: TOXENV=docs @@ -39,15 +37,7 @@ jobs: cache: pip before_install: - - | - # Except on bionic, Travis Linux base image for PPC64LE - # platform lacks the proper - # permissions to the directory ~/.cache/pip/wheels that allow - # the user running travis build to install pip packages. - # TODO: is someone tracking this issue? Maybe just move to bionic? - if [[ "$TRAVIS_CPU_ARCH" == "ppc64le" ]]; then - sudo chown -Rfv $USER:$GROUP ~/.cache/pip/wheels - fi +- python tools/ppc64le-patch.py install: diff --git a/tools/ppc64le-patch.py b/tools/ppc64le-patch.py new file mode 100644 index 0000000000..2a8ff8e0a0 --- /dev/null +++ b/tools/ppc64le-patch.py @@ -0,0 +1,28 @@ +""" +Except on bionic, Travis Linux base image for PPC64LE +platform lacks the proper +permissions to the directory ~/.cache/pip/wheels that allow +the user running travis build to install pip packages. +TODO: is someone tracking this issue? Maybe just move to bionic? +""" + +import subprocess +import collections +import os + + +def patch(): + env = collections.defaultdict(str, os.environ) + if env['TRAVIS_CPU_ARCH'] != 'ppc64le': + return + cmd = [ + 'sudo', + 'chown', + '-Rfv', + '{USER}:{GROUP}'.format_map(env), + os.path.expanduser('~/.cache/pip/wheels'), + ] + subprocess.Popen(cmd) + + +__name__ == '__main__' and patch()