-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: fix issue where designer doesn't load pydm widgets when pydm is installed from PyPI using pip #1132
BUG: fix issue where designer doesn't load pydm widgets when pydm is installed from PyPI using pip #1132
Conversation
67d38d2
to
6c963cc
Compare
installed from PyPI using pip When pydm is installed using pip, you should be able to set the env variable PYQTDESIGNERPATH to the pip pydm install location and then designer loads the pydm widgets. But for PYQTDESIGNERPATH to be used to load pydm widgets, it must point to dir containing pydm_designer_plugin.py file. This file was wrongly placed in the pydm repo root dir. But pip only copies to the install location any python-package dirs (dir with a __init__.py), which for pydm is the /pydm subfolder of the root dir (which did not contain the pydm_designer_plugin.py file). So solution is to place the plugin file in the /pydm subdir so pip copies it to the install location, and so PYQTDESIGNERPATH can find the file when set to the install location. (conda installs are not affected, does not use pydm_designer_plugin.py file)
6c963cc
to
95810d4
Compare
tested patch as follows:
|
seems like this shouldn't effect conda installs, since they create their own pydm_designer_plugin.py file: https://github.com/slaclab/pydm/blob/master/conda-recipe/build.sh#L15 |
I think people might miss the warning text and just copy the listed conda cmd, so having this cmd just work could avoid some issues.
526be2c
to
7649015
Compare
This was the origin behind changing the installation guide to unpin pyqt: #999 |
Since pyqt=5 is valid install option, just designer won't work with pydm widgets. Explicity list the cmd for pyqt=5.12.3, to avoid any confusion on how to pin, and maybe to catch anyone's eyes just looking for install cmds.
4c91ae3
to
c4be6f3
Compare
ok agree now on having main listed conda cmd pinned to pyqt=5, thanks! but what about adding an example cmd of pyqt=5.12.3 pinned in the 'warning' section: https://github.com/slaclab/pydm/pull/1132/files#diff-e285c1b9901cd202e89d9f37e3249a6fee524a65428895e1a45fd062cc0f9acaL29
|
I think I actually prefer the pinned 5.12.3 version as the default command for that reason. Or at the very least the warning box appearing before the install command so the reader sees it first. We can also remove the pin of python to 3.8 there as it should work at least from 3.7-3.10, and should be handled by our conda recipe anyway. Should update that recipe during the next release to ensure it is correct. |
ok moved the warning box above the normal cmd, but normal cmd has no pyqt pin. imo this is best of both worlds. |
210c5d3
to
b645c3d
Compare
@jbellister-slac for the python pin, should we pin 3.7-3.10? or think we should list most recent python (3.12)? also in what way should conda recipe be updated? no python version is pinned there atm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I was looking over on conda forge:
https://github.com/conda-forge/pydm-feedstock/blob/main/recipe/meta.yaml
But yeah should update the version you were looking at first so they stay in sync, didn't realize there was no python version here. We could probably put a lower bound of at least 3.8 since even 3.7 has been end of life for a while now.
Running the tests against newer python versions also sounds good, but both of these things can be part of a different PR.
2201a7e
to
dd25549
Compare
…s likely to miss it. Also remove python 3.8 since 3.7-3.10 should work.
dd25549
to
91e2525
Compare
When pydm is installed from PyPI using pip, you should be able to set the env variable PYQTDESIGNERPATH to pip pydm install location so designer can load the pydm widgets.
But for PYQTDESIGNERPATH to be used to load pydm widgets, it needs to point to a dir containing the pydm_designer_plugin.py file. This file was put in the pydm repo's root dir. But pip only copies to the install locations python-package dirs (dir contains __init__.py), which for pydm is the /pydm subfolder of the root dir (which didn't contain the pydm_designer_plugin.py file).
The solution is to place the plugin file in the <pydm_root_dir>/pydm subdir so pip can grab it.
Also make conda install cmd in doc pin pyqt version.