Choose Qt binding from SPYDER_QT_BINDING environment variable #23055
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
This is a proposal to allow the user to choose the Qt binding to be installed when installing with PIP.
for example using PyQt6 (or PySide6 in the future).
Since the we could not rely on having other imports other than
stdlib
available onsetup.py
when building and installing, we could not test if there is a binding already installed. For example, we could useQtPy
to identify which one was installed, including it tosetup_requires
, and asking forqtpy.QT_API. But, also without success.
After testing some other ways to do that, I have implemented this version that checks the SPYDER_QT_BINDING environment variable to proper set the requirement during installation.
We can use like this:
SPYDER_QT_BINDING='pyqt6' pip install spyder
This is also compatible with test environments, where you can set the variable.
Not sure if this useful for
conda
also, I'm not familiar with it.I want to hear from you guys, let me know your thoughts.
Links related to setup imports:
Issue(s) Resolved
Fixes #20201
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: dpizetta