Skip to content

Commit

Permalink
Installing Python packages to user directory on macOS, fixing pypa#122
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickJadoul committed Jan 30, 2019
1 parent c6f4f01 commit e3600ca
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ def call(args, env=None, cwd=None, shell=False):
call(['python', '--version'], env=env)

# install pip & wheel
call(['python', get_pip_script, '--no-setuptools', '--no-wheel'], env=env)
# use '--user', because the removal of the old version of setuptools might cause problems with newer pip versions (see issue #122)
call(['python', get_pip_script, '--user', '--no-setuptools', '--no-wheel'], env=env)
call(['pip', '--version'], env=env)
call(['pip', 'install', '--upgrade', 'setuptools'], env=env)
call(['pip', 'install', 'wheel'], env=env)
call(['pip', 'install', 'delocate'], env=env)
call(['pip', 'install', '--user', '--upgrade', 'setuptools'], env=env)
call(['pip', 'install', '--user', 'wheel'], env=env)
call(['pip', 'install', '--user', 'delocate'], env=env)

# setup dirs
if os.path.exists('/tmp/built_wheel'):
Expand Down Expand Up @@ -118,11 +119,11 @@ def call(args, env=None, cwd=None, shell=False):
delocated_wheel = glob('/tmp/delocated_wheel/*.whl')[0]

# install the wheel
call(['pip', 'install', delocated_wheel], env=env)
call(['pip', 'install', '--user', delocated_wheel], env=env)

# test the wheel
if test_requires:
call(['pip', 'install'] + test_requires, env=env)
call(['pip', 'install', '--user'] + test_requires, env=env)
if test_command:
# run the tests from $HOME, with an absolute path in the command
# (this ensures that Python runs the tests against the installed wheel
Expand Down

0 comments on commit e3600ca

Please sign in to comment.