Skip to content
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

Choose Qt binding from SPYDER_QT_BINDING environment variable #23055

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dpizetta
Copy link
Contributor

@dpizetta dpizetta commented Nov 22, 2024

Description of Changes

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)
  • Included a screenshot or animation (if affecting the UI, see Licecap)

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 thanstdlibavailable on setup.py when building and installing, we could not test if there is a binding already installed. For example, we could use QtPy to identify which one was installed, including it to setup_requires, and asking for qtpy.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

@pep8speaks
Copy link

Hello @dpizetta! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 114:1: E302 expected 2 blank lines, found 1
Line 141:80: E501 line too long (84 > 79 characters)
Line 237:12: E203 whitespace before ':'
Line 238:12: E203 whitespace before ':'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Qt6
2 participants