Skip to content

Commit

Permalink
[Python] Try to install sdist with pip during packaging, fall back to…
Browse files Browse the repository at this point in the history
… setup.py
  • Loading branch information
matthewfeickert committed Jan 18, 2022
1 parent 6e6606f commit 822b150
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packaging/wheel/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,19 @@ if [ "$res" -ne "0" ]; then
fi

cd ../bindings/python
$6 setup.py install $3 # $6 holds the python sys.executable
res=$?

# Determine if shutil.which is available for a modern Python package install
${6} -c 'import shutil.which' &> /dev/null # $6 holds the python sys.executable
shutil_which_available=$?
if [ "${shutil_which_available}" -ne "0" ]; then
${6} setup.py install ${3}
res=$?
else
${6} -m pip install ${3} .
res=$?
fi
unset shutil_which_available

if [ "$res" -ne "0" ]; then
exit 1
fi
Expand Down

0 comments on commit 822b150

Please sign in to comment.