Skip to content

Commit

Permalink
Try to be smarter about which python to use installing
Browse files Browse the repository at this point in the history
Temporary fix for dials/dials#2222
  • Loading branch information
ndevenish committed Sep 27, 2022
1 parent 3e259e9 commit b8a70b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions libtbx/auto_build/create_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@
INSTALL_SH = """\
#!/bin/bash
if [ -z "$PYTHON_EXE" ]; then
PYTHON_EXE='/usr/bin/python'
if [ -f "/usr/bin/python2.7" ]; then
PYTHON_EXE='/usr/bin/python2.7'
elif [ -f "/usr/bin/python2.6" ]; then
PYTHON_EXE='/usr/bin/python2.6'
elif [ -f "/usr/bin/python2" ]; then
PYTHON_EXE='/usr/bin/python2'
elif [ -f "./conda_base/bin/python" ]; then
PYTHON_EXE='./conda_base/bin/python'
PYTHON_EXE="$(command -v python3 || command -v python2)"
if [ ! -f "$PYTHON_EXE" ]; then
PYTHON_EXE='/usr/bin/python'
if [ -f "/usr/bin/python2.7" ]; then
PYTHON_EXE='/usr/bin/python2.7'
elif [ -f "/usr/bin/python2.6" ]; then
PYTHON_EXE='/usr/bin/python2.6'
elif [ -f "/usr/bin/python2" ]; then
PYTHON_EXE='/usr/bin/python2'
elif [ -f "./conda_base/bin/python" ]; then
PYTHON_EXE='./conda_base/bin/python'
fi
fi
fi
$PYTHON_EXE ./bin/install.py $@
Expand Down
2 changes: 1 addition & 1 deletion libtbx/auto_build/install_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def install_from_binary(self):
unpack_cmd = os.path.join('.', 'bin', 'conda-unpack')
if sys.platform == 'win32':
unpack_cmd = os.path.join('.', 'Scripts', 'conda-unpack.exe')
subprocess.check_call([unpack_cmd])
subprocess.check_call([sys.executable, unpack_cmd])
os.chdir(cwd)

# Reconfigure
Expand Down

0 comments on commit b8a70b3

Please sign in to comment.