Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/MDSplus/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@ def use_setuptools():
sys.exit(1)
try:
use_setuptools()
except ImportError:
except (ImportError, RuntimeError):
use_distutils()
11 changes: 5 additions & 6 deletions rpm/python_module_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@ mdsplus_dir=$(readlink -f $(dirname ${0})/..)
module=${1}

if test "${module}" = "MDSplus"; then
setup_install=${MDSPLUS_SETUP_PY}
srcdir=${mdsplus_dir}/python
if test "$(${mdsplus_dir}/rpm/python_module_remove.sh ${module} y)" = "y"; then
setup_install=y
elif ( echo ${PYTHONPATH} | grep ${mdsplus_dir}/python >/dev/null ); then
setup_install=n
else
read -t 10 -p "Do you wish to run setup.py install? (y/N) " setup_install
elif test -z "${MDSPLUS_SETUP_PY}"; then
echo "Set MDSPLUS_SETUP_PY=y if you wish to run setup.py install."
fi
else
setup_install=
srcdir=${mdsplus_dir}/pydevices
setup_install=n
fi

for python in python2 python3; do
if ( ${python} -c pass >/dev/null 2>&1 ); then
${python} -m compileall -q -f ${srcdir}/${module} >/dev/null 2>&1
if test "${setup_install}" = "y"; then
if ! ${python} ${mdsplus_dir}/python/MDSplus/setup.py -q install >/dev/null; then
if ! ${python} ${srcdir}/${module}/setup.py -q install >/dev/null; then
echo "Could not 'setup.py install' MDSplus for ${python}"
fi
fi
Expand Down