From 7626065df8c817c1dfac2ca55b44431c0c2a7940 Mon Sep 17 00:00:00 2001 From: Stephen Lane-Walsh Date: Thu, 16 Jul 2026 13:59:22 -0400 Subject: [PATCH 1/2] Feature: `Add $MDSPLUS_DIR/python` to `PYTHONPATH` in `etc/envsyms` This removes the long-broken `MDSPLUS_SETUP_PY` and instead adds `$MDSPLUS_DIR/python` to the `PYTHONPATH` in `$MDSPLUS_DIR/etc/envsyms`. This should allow users to `import MDSplus` in python after an install with no additional setup --- rpm/envsyms.in | 1 + rpm/python_module_install.sh | 15 +++------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/rpm/envsyms.in b/rpm/envsyms.in index d50b64839d..30e215fd55 100644 --- a/rpm/envsyms.in +++ b/rpm/envsyms.in @@ -10,6 +10,7 @@ # MDS_PATH $MDSPLUS_DIR/tdi MDS_PYDEVICE_PATH $MDSPLUS_DIR/pydevices +PYTHONPATH $MDSPLUS_DIR/python >: PYTHONPATH $MDSPLUS_DIR/pydevices >: MATLABPATH $MDSPLUS_DIR/matlab <: UIDPATH $MDSPLUS_DIR/uid/%U <: diff --git a/rpm/python_module_install.sh b/rpm/python_module_install.sh index 00c17e6946..2e5fac41eb 100755 --- a/rpm/python_module_install.sh +++ b/rpm/python_module_install.sh @@ -7,21 +7,12 @@ if test "${module}" = "MDSplus"; then srcdir=${mdsplus_dir}/python if test "$(${mdsplus_dir}/rpm/python_module_remove.sh ${module} y)" = "y"; then setup_install=y - 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 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} ${srcdir}/${module}/setup.py -q install >/dev/null; then - echo "Could not 'setup.py install' MDSplus for ${python}" - fi - fi - fi -done +if test "${setup_install}" = "y"; then + echo "MDSPLUS_SETUP_PY has been removed, and ${mdsplus_dir}/python has been placed in the PYTHONPATH in ${mdsplus_dir}/etc/envsyms" +fi \ No newline at end of file From 0baa58e24d004e2e7fdc137dd0530b2e285d620a Mon Sep 17 00:00:00 2001 From: Stephen Lane-Walsh Date: Thu, 16 Jul 2026 15:02:03 -0400 Subject: [PATCH 2/2] Add python import to install tests Since MDSplus is now on the PYTHONPATH by default, we're able to test importing during the install tests --- deploy/platform/debian/test-install.sh | 4 +++- deploy/platform/redhat/test-install.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/deploy/platform/debian/test-install.sh b/deploy/platform/debian/test-install.sh index 01f5c844e8..d03c2d877f 100755 --- a/deploy/platform/debian/test-install.sh +++ b/deploy/platform/debian/test-install.sh @@ -13,7 +13,9 @@ DEBIAN_FRONTEND=noninteractive \ echo "=== Testing ===" . /usr/local/mdsplus/setup.sh -mdstcl show version +python3 -c 'import MDSplus; print(MDSplus.__version__)' || exit 42 + +mdstcl show version # MDSplus uses weird return codes [ $? -eq 1 ] || exit 42 diff --git a/deploy/platform/redhat/test-install.sh b/deploy/platform/redhat/test-install.sh index b0e11eba5c..2e8eefa6c2 100755 --- a/deploy/platform/redhat/test-install.sh +++ b/deploy/platform/redhat/test-install.sh @@ -14,7 +14,9 @@ dnf install -y "$@" || exit 1 echo "=== Testing ===" . /usr/local/mdsplus/setup.sh -mdstcl show version +python3 -c 'import MDSplus; print(MDSplus.__version__)' || exit 42 + +mdstcl show version # MDSplus uses weird return codes -[ $? -eq 1 ] || exit 42 +[ $? -eq 1 ] || exit 42 \ No newline at end of file