Skip to content

Commit

Permalink
Merge pull request pypa#2398 from pypa/extract-ppc-patch
Browse files Browse the repository at this point in the history
Extract ppc patch
  • Loading branch information
jaraco authored Sep 24, 2020
2 parents 896ef66 + 72e14ea commit 1ea521c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
12 changes: 1 addition & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,14 @@ jobs:
allow_failures:
# suppress failures due to pypa/setuptools#2000
- python: pypy3
- arch: ppc64le
python: pypy3
- <<: *latest_py3
env: TOXENV=docs


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:

Expand Down
28 changes: 28 additions & 0 deletions tools/ppc64le-patch.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 1ea521c

Please sign in to comment.