pymol-open-source icon indicating copy to clipboard operation
pymol-open-source copied to clipboard

Pyside2==5.13.2 dependency: newer versions break the UI

Open KrisJanssen opened this issue 9 months ago • 2 comments

Our users of pymol-oss indicated preferring the single window style of Qt5/Pyside builds of pymol as opposed to the multi-window style you get with build option --glut.

Similarly, the draw/render menu behavies differently, users again preferring the Qt5/Pyside flavor:

image

To this end, when trying to build PyMol for internal use on RHEL7 and 8, we use following process:

     yum -y group install "Development Tools"
     yum -y install --disableplugin=subscription-manager \
     gcc gcc-c++ kernel-devel python3-devel tkinter python-pmw glew-devel \
     freeglut-devel libpng-devel freetype-devel libxml2-devel glm-devel \
     msgpack-devel netcdf-devel \
     xcb-util xcb-util-wm xcb-util-image xcb-util-keysyms \
     xcb-util-renderutil compat-libxcb libxkbcommon-x11 mesa-dri-drivers 

Clone and build

   git clone https://github.com/schrodinger/pymol-open-source.git && \
   cd /pymol-open-source && \
   git checkout tags/v2.5.0 && \
   cd / && \
   git clone https://github.com/rcsb/mmtf-cpp.git && \
   mv mmtf-cpp/include/mmtf* pymol-open-source/include/
   pip3 install PySide2==5.13.2 && \
   python3 setup.py build install

on RHEL8, python is 3.6.8 OOTB

Note we explicitly need to set PySide==5.13.2 if we do not do this, we hit issues with Module pyside2 not being found and following code failing:

https://github.com/schrodinger/pymol-open-source/blob/a610ff1f38284594c595c02bf2899586ee4fc506/modules/pymol/Qt/utils.py#L288

image

Here, following code edit restores functionality (i.e. replace the uic call to pyside2-uic):

   p = subprocess.Popen(['**pyside2-uic**', '-g', 'python', uifile],
                             stdout=subprocess.PIPE)

https://github.com/schrodinger/pymol-open-source/blob/a610ff1f38284594c595c02bf2899586ee4fc506/modules/pmg_qt/forms/render.ui#L67C12-L67C32

The only issue which then remains is an error about the argument to setSuffix being passed as int while string is expected for these UI elements (there are 2):

<item row="0" column="2">
   <widget class="QDoubleSpinBox" name="input_width_units">
      <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
         </sizepolicy>
      </property>
      <property name="suffix">
         <string notr="true">cm</string>
       </property>
       <property name="maximum">
          <double>999.000000000000000</double>
       </property>
    </widget>
 </item>

image

Oddly, the Pyside2 converted render.ui seems OK:

   self.input_height_units.setSuffix(u"cm")\n

Any idea how this could be addressed such that pymol can be built with more recent versions of python and dependencies?

KrisJanssen avatar Sep 19 '23 08:09 KrisJanssen

I experimented with PySide6 and also ran into the setSuffix issue. This commit works around the issue: https://github.com/speleo3/pymol-open-source/commit/5eb6de645aced9d0419b6eb9c686d55fc4dbf869

speleo3 avatar Sep 19 '23 19:09 speleo3

Thanks for the update and the commit! I will be sure to give that a go later today and comment on findings.

KrisJanssen avatar Sep 20 '23 14:09 KrisJanssen