adding support for pyqtgraph editable install#2892
adding support for pyqtgraph editable install#2892spchamp wants to merge 5 commits intopyqtgraph:masterfrom
Conversation
This change adds build-system metadata to pyproject.toml and ensures the dir for setup.py is in sys.path. The sys.path modification is to ensure the project ./tools/ modules can be imported in setup.py during editable install. With this tweak to the project metadata, it should be possible to install pyqtgraph with an editable install, using setuptools ``` mkdir newproject; cd newproject python3 -m venv --prompt newproject env source env/bin/activate pip install -e ../pyqtgraph/ --config-settings editable_mode=compat ```
|
Did this change break the rtd build? Noticed the following in the build log for Read the Docs:
Of course PyQt6 is listed in doc/requirements.txt and it was installed under that step:
Maybe this change produced some kind of a side effect for how the rtd build resolves the imports for the docs build? I'll try to see if I can figure this out with a glance at |
After sending a push request for the previous change in this patch branch, I noticed the following in the build log for Read the Docs: > PyQtGraph requires one of PyQt5, PyQt6, PySide2 or PySide6; none of these packages could be imported. Of course PyQt6 is listed in doc/requirements.txt and it was installed under that step: > python -m pip install --exists-action=w --no-cache-dir -r doc/requirements.txt > [...] > Successfully installed PyQt6-6.6.0 [...] Maybe this change produced some kind of a side effect for how the rtd build resolves the imports for the docs build? So here is a first guess, to try to unbreak it if the change would break the docs build. Appending to sys.path instead of adding the project root path to the front of sys.path
|
Huh. If this change is breaking the read the docs build, my second guess is that it's because of It installs completely, when not using the editable option |
|
There is a new pyqt6 build that having issues, I wouldn’t worry about it
…On Fri, Dec 1, 2023 at 23:24 Sean Champ ***@***.***> wrote:
Huh. If this change is breaking the read the docs build, my second guess
is that it's because of sys.path lol 🤷
—
Reply to this email directly, view it on GitHub
<#2892 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE5Z7QSNGP4PC2OUMMXQMTYHLJTVAVCNFSM6AAAAABADZYQ5CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGA3TENBSGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
thx! Apologies for the chatter, lol. I think the RTD build is using Python 3.12. So, I've installed Python 3.12. I've tested the build with sphinx there, the docs built OK ... with pyside6 installed. After uninstalling pyside6 in 3.12 and running the tests with just pyqt6 installed, saw the same error as with the rtd build:
So, good to know! |
With the dependency `PyQt6==6.6.0` pip may install a PyQt6-Qt6 version greater than the PyQt6 version, e.g 6.6.1. This version mismatch may result in an errors after loading the PyQt6 libraries, such as seen when running the pyqtgraph tests with Python 3.12 > E Exception: PyQtGraph requires one of PyQt5, PyQt6, PySide2 or PySide6; none of these packages could be imported. After adding a dependency line to ensure a version parity for the pyqt6 and pyqt6-qt6 installations with pip, then installing with `pip -r doc/requirements.txt` the pyqtgraph tests and the docs build should run successfully with PyQt6 in Python 3.12
|
added a patch for PyQt6 version parity in doc/requirements.txt fwiw the tests all run successfully under Python 3.12 and the docs build |
updating pyqt6, pyqt6-qt6 version deps for the test-pip gh workflow and in tox.ini This may serve to address the error seen under the rtd docs build, such that might also show up in the test-pip build: > Exception: PyQtGraph requires one of PyQt5, PyQt6, PySide2 or PySide6; none of these packages could be imported. Ensuring an exact version match for pyqt6 and pyqt6-qt6 depdencies in test-pip and in tox.ini
updating pyqt6, pyqt6-qt6 version deps for the test-pip gh workflow for Python 3.11
|
fwiw I've folded a couple more patches into this pull request, to ensure version alignment for the pyqt6 parts in the CI builds |
| - python-version: "3.10" | ||
| qt-lib: "pyqt" | ||
| qt-version: "PyQt6~=6.2.0 PyQt6-Qt6~=6.2.0" | ||
| qt-version: "PyQt6==6.2.0 PyQt6-Qt6==6.2.0" |
There was a problem hiding this comment.
why this change, I'm fairly certain that ~= is what I want in this case, I want to get the latest patch version of PyQt6 6.2
| @@ -1,4 +1,5 @@ | |||
| PyQt6==6.6.0 | |||
| PyQt6-Qt6==6.6.0 | |||
There was a problem hiding this comment.
Got fixed in another PR already, go ahead and remove this 👍🏻
| pyqt6_62: pyqt6~=6.2.0 | ||
| pyqt6_62: PyQt6-Qt6~=6.2.0 | ||
| pyqt6_62: pyqt6==6.2.0 | ||
| pyqt6_62: PyQt6-Qt6==6.2.0 |
There was a problem hiding this comment.
Again, why is there the == and not ~= here?
There was a problem hiding this comment.
This ensures that the same version is drawn in for both
|
hi @spchamp Thanks for the PR, I didn't realize that some modules might not be captured via editable installs in the current form. I have no problem merging the changes to pyproject.toml and setup.py, but I think the other changes for |
This change adds build-system metadata to pyproject.toml and ensures the dir for setup.py is in sys.path.
The sys.path modification is to ensure the project ./tools/ modules can be imported in setup.py during editable install.
With this tweak to the project metadata, it should be possible to install pyqtgraph with an editable install, using setuptools
Previous to this change, while it was possible to run
pip install -e ../pyqtgraphbut that might not have resulted in the modules actually being installed and available under the user environment.Files that need updates
Confirm the following files have been either updated or there has been a determination that no update is needed.
README.mdsetup.pytox.ini.github/workflows/main.ymland associatedrequirements.txtand condaenvironemt.ymlfilespyproject.tomlbinder/requirements.txtI don't think this would affect the workflow builds. Hoping it would test out though lol