Symlinking only on first-time installation of Python versions on mac OS X
This commit is contained in:
@@ -45,16 +45,16 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
|
|||||||
|
|
||||||
# if this version of python isn't installed, get it from python.org and install
|
# if this version of python isn't installed, get it from python.org and install
|
||||||
python_package_identifier = 'org.python.Python.PythonFramework-%s' % config.version
|
python_package_identifier = 'org.python.Python.PythonFramework-%s' % config.version
|
||||||
|
installation_bin_path = '/Library/Frameworks/Python.framework/Versions/{}/bin'.format(config.version)
|
||||||
if python_package_identifier not in installed_system_packages:
|
if python_package_identifier not in installed_system_packages:
|
||||||
# download the pkg
|
# download the pkg
|
||||||
call(['curl', '-L', '-o', '/tmp/Python.pkg', config.url])
|
call(['curl', '-L', '-o', '/tmp/Python.pkg', config.url])
|
||||||
# install
|
# install
|
||||||
call(['sudo', 'installer', '-pkg', '/tmp/Python.pkg', '-target', '/'])
|
call(['sudo', 'installer', '-pkg', '/tmp/Python.pkg', '-target', '/'])
|
||||||
|
|
||||||
installation_bin_path = '/Library/Frameworks/Python.framework/Versions/{}/bin'.format(config.version)
|
if config.version[0] == '3':
|
||||||
if config.version[0] == '3':
|
os.symlink(os.path.join(installation_bin_path, 'python3'), os.path.join(installation_bin_path, 'python'))
|
||||||
os.symlink(os.path.join(installation_bin_path, 'python3'), os.path.join(installation_bin_path, 'python'))
|
os.symlink(os.path.join(installation_bin_path, 'pip3'), os.path.join(installation_bin_path, 'pip'))
|
||||||
os.symlink(os.path.join(installation_bin_path, 'pip3'), os.path.join(installation_bin_path, 'pip'))
|
|
||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env['PATH'] = os.pathsep.join([
|
env['PATH'] = os.pathsep.join([
|
||||||
|
|||||||
Reference in New Issue
Block a user