Skip to content

Commit

Permalink
Merge pull request pypa#66 from mayeut/drop-linux-python3.3
Browse files Browse the repository at this point in the history
Give ownership of the wheel files to the current user instead of root on Linux
  • Loading branch information
YannickJadoul authored May 6, 2018
2 parents 7448ca3 + d186b0b commit 57a2259
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
36 changes: 11 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,28 @@ matrix:
# Linux Python 2
- sudo: required
language: python
services:
- docker
env:
- "PYTHON=python2"
python: 2.7
services: docker
env: PYTHON=python

# Linux Python 3
- sudo: required
language: python
services:
- docker
env:
- "PYTHON=python3"
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y python3-pip
python: 3.4
services: docker
env: PYTHON=python

# macOS Python 2
- os: osx
env:
- "PYTHON=python2"
env: PYTHON=python2

# macOS Python 3
- os: osx
env:
- "PYTHON=python3"
env: PYTHON=python3
before_install:
- brew update
- brew outdated python || brew upgrade python

script:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
$PYTHON -m pip install -r requirements-dev.txt
$PYTHON ./bin/run_tests.py
else
# linux test requires root to clean up the wheelhouse (docker runs as root)
sudo $PYTHON -m pip install -r requirements-dev.txt
sudo $PYTHON ./bin/run_tests.py
fi
install: $PYTHON -m pip install -r requirements-dev.txt

script: $PYTHON ./bin/run_tests.py
3 changes: 3 additions & 0 deletions cibuildwheel/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
# we're all done here; move it to output
mv "$delocated_wheel" /output
chown {uid}:{gid} "/output/$(basename "$delocated_wheel")"
done
'''.format(
package_name=package_name,
Expand All @@ -108,6 +109,8 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
),
build_verbosity_flag=' '.join(get_build_verbosity_extra_flags(build_verbosity)),
environment_exports='\n'.join(environment.as_shell_commands()),
uid=os.getuid(),
gid=os.getgid(),
)

docker_process = subprocess.Popen([
Expand Down

0 comments on commit 57a2259

Please sign in to comment.