-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Choose Qt binding to install from SPYDER_QT_BINDING
environment variable
#23055
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -111,6 +111,37 @@ def get_packages(): | |||||
packages = get_subpackages(LIBNAME) | ||||||
return packages | ||||||
|
||||||
def get_qt_requirements(qt_requirements, default='pyqt5'): | ||||||
""" | ||||||
Return a list of requirements for the Qt binding according to the | ||||||
environment variable SPYDER_QT_BINDING. If this variable is not set | ||||||
or has an unsupported value it defaults to 'pyqt5'. | ||||||
|
||||||
Parameters | ||||||
---------- | ||||||
qt_requirements : dict | ||||||
A dictionary whose keys are supported Qt bindings and whose values are | ||||||
lists of required packages to install for each binding. | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
No need of a blank line here. |
||||||
default : str | ||||||
Default Qt binding to use if the environment variable is not | ||||||
in qt_requirements. Default is 'pyqt5'. | ||||||
|
||||||
Returns | ||||||
------- | ||||||
install_requires : list | ||||||
A list of required packages to install for the given Qt binding. | ||||||
""" | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think this is unnecessary. |
||||||
install_requires = [] | ||||||
|
||||||
# Check if a Qt binding is set in the environment and normalizes | ||||||
env_qt_binding = os.environ.get('SPYDER_QT_BINDING', default) | ||||||
env_qt_binding = env_qt_binding.lower() | ||||||
install_requires = qt_requirements.get(env_qt_binding, qt_requirements[default]) | ||||||
|
||||||
return install_requires | ||||||
|
||||||
|
||||||
# ============================================================================= | ||||||
# Make Linux detect Spyder desktop file (will not work with wheels) | ||||||
|
@@ -201,8 +232,16 @@ def run(self): | |||||
cmdclass=CMDCLASS, | ||||||
) | ||||||
|
||||||
# Qt bindings requirements | ||||||
qt_requirements = { | ||||||
'pyqt5' : ['pyqt5>=5.15,<5.16', 'pyqtwebengine>=5.15,<5.16'], | ||||||
'pyqt6' : ['pyqt6>=6,<7', 'pyqt6-webengine>=6,<7'], | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This is our minimal supported version of pyqt6. |
||||||
} | ||||||
|
||||||
# Get the proper requirements for the selected Qt binding | ||||||
install_requires = get_qt_requirements(qt_requirements, default='pyqt5') | ||||||
|
||||||
install_requires = [ | ||||||
install_requires += [ | ||||||
'aiohttp>=3.9.3', | ||||||
'applaunchservices>=0.3.0;platform_system=="Darwin"', | ||||||
'asyncssh>=2.14.0,<3.0.0', | ||||||
|
@@ -232,8 +271,6 @@ def run(self): | |||||
'pylint>=3.1,<4', | ||||||
'pylint-venv>=3.0.2', | ||||||
'pyls-spyder>=0.4.0', | ||||||
'pyqt5>=5.15,<5.16', | ||||||
'pyqtwebengine>=5.15,<5.16', | ||||||
'python-lsp-black>=2.0.0,<3.0.0', | ||||||
'python-lsp-server[all]>=1.12.0,<1.13.0', | ||||||
'pyuca>=1.2', | ||||||
|
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.
Just a nitpick: In my opinion it’s better to throw an error when an invalid/unsupported value is passed.